From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QHAkF20e6WCOdwAAgWs5BA (envelope-from ) for ; Sat, 10 Jul 2021 06:13:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KnbYEm0e6WCMKAAAB5/wlQ (envelope-from ) for ; Sat, 10 Jul 2021 04:13:33 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8B21413B92 for ; Sat, 10 Jul 2021 06:13:32 +0200 (CEST) Received: from localhost ([::1]:34832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m24Ms-0004bq-Vm for larch@yhetil.org; Sat, 10 Jul 2021 00:13:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m24Mk-0004bg-BY for help-guix@gnu.org; Sat, 10 Jul 2021 00:13:22 -0400 Received: from w1.tutanota.de ([81.3.6.162]:32778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m24Mi-00011J-FY for help-guix@gnu.org; Sat, 10 Jul 2021 00:13:22 -0400 Received: from w3.tutanota.de (unknown [192.168.1.164]) by w1.tutanota.de (Postfix) with ESMTP id 36C54FBF2F0; Sat, 10 Jul 2021 04:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1625890397; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=5LZmgbvsFIwKa0NINj3YBMMmt8dvh8f6Fp3RhZzU97k=; b=nj1GiNKKBqvgAipk9BelGLY1ooH7q3+0H1xFGQLF0dbr6vNsyO8fFIK709EeEeK6 wfmPiU8JxefuwuJp7UGPZsPq0VvgxLEWNrN9FDeZVHdNArjiAiQNuYTKrPK4Fk6xiLR yQuUzexw+G6aZSdhEDZS4sZa6FIVohOIEjH1eCWaeer6gVGFVgLjTk4Xl8DJ6vHLYFl k5fvNF5s/9TSfZw7NSB77kD+JrgGKAwDTD2PX3ipO6K+QwIlpn456p554cJnns3jPaa ZjvR01OG3q5pa3z+0812R6OE/Rpn1CXN89eoMcemG0ZyvIOVp+2q/90LnUlU0XRLsgb xmQBvw6L6A== Date: Sat, 10 Jul 2021 06:13:17 +0200 (CEST) To: Ekaitz Zarraga Cc: Help Guix Message-ID: In-Reply-To: References: Subject: Re: Auto-start service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=81.3.6.162; envelope-from=excalamus@tutanota.com; helo=w1.tutanota.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" Reply-to: excalamus@tutanota.com From: excalamus--- via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625890413; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=5LZmgbvsFIwKa0NINj3YBMMmt8dvh8f6Fp3RhZzU97k=; b=kb5lcf9UYCvtBC+TDQNeb8jj60MW0i3XtyzRqQj2cZNmD400HwirhEWDfXTwRcvkviWRn/ hFFC+epDfa6+pyUwGddLYKu7wUkB9XFV0OAlyoP9B/qKJKjgCqk6IYfdmDTzPif/DxFuas p3G3Xe0PSnZ5I9elRzgJWbd8YlZAHbdlGKzLgf72Sv2zMRo/Hsprb3XxNjDGJZZH1nlhyW 4W+vvCCgpmUrzEuhoGsXJd/IfGkFzXkiWe+ZnIqdkCKVcnNEso4PqF2+EpMPzrLnRWsb5J N0GyJcjHiph1mwiDmR/DvjX5AMma0fugN2BZakJi07eHvOrz64iuGcoOQPWblQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625890413; a=rsa-sha256; cv=none; b=EZe/VKXpRbqOFdUJJNuDrug++Q3TVXBfbz6g9fikjmh4ttYK0Ud6CRO0JR9ACdGMSHE8KK uTurxH46lDKCemj/5a4jT5XCvHa8ViP8a8SA1lteJMTPWdVkcgP48uKeVejzGe2gpmYhkl 373rNyuqtxoLJZnoctk2c7q+bnfx4en3JpvBQTYoDmyQnCymm6cBoPwexpL9CHzX71idEa LAFthS2hckM8+9wTU7Eg1sW7WsDsNOf26GtMM5LmPGExUbMoSewtoGs7tWiqPNpKHBq1jd S58pj6Y6dyUhtl+DTpj11LQ8jS3oruDW6bltDsy0PNCcwnKpfaDW8wl4S66hww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tutanota.com header.s=s1 header.b=nj1GiNKK; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tutanota.com header.s=s1 header.b=nj1GiNKK; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 8B21413B92 X-Spam-Score: -2.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: tw/Tgbvi8ct1 > I had to activate the user-level Shepherd by hand in any file that is exe= cuted when the system is started. In my case I have it in my i3 config. You= can put it in .xsession like the thread you shared suggests. > *expletives*=C2=A0 Call 'shepherd'.=C2=A0 That's it.=C2=A0 Call 'shepherd'.= =C2=A0 Goodness gracious...thank you. I see now the docs mention this.=C2=A0 Yet, because user error (pun intende= d) is never my fault (sarcasm), I wonder if the docs might express it more = clearly. The information I overlooked is that Shepherd may (and likely will) be run = concurrently by two or more users (e.g. 'root' and 'Joe Shmoe').=C2=A0 The relevant docs are: 1.=C2=A0 The (shepherd) Introduction says,=20 """The Shepherd is the =E2=80=9Cinit system=E2=80=9D of the GNU operating s= ystem=E2=80=94it is the first user process that gets started, typically wit= h PID 1, and runs as =E2=80=98root=E2=80=99.""" I believe the phrase "the first user process" might be better as "the first= process". Are there processes which are not "user processes" within userland?=C2=A0 T= he kernel starts the init process (i.e. Shepherd).=C2=A0 However, because u= sers can access it as 'root', it can be considered a userland process.=C2= =A0 Therefore, the edit could happen without loss of meaning.=C2=A0=20 When reading the phrase "the first user process", the word "user" stuck wit= h me.=C2=A0 Maybe I read too much Hacker News, but when developers speak of= "users", I interpret it as "a non-developer or someone without access to c= ontrols, such as admin privileges".=C2=A0 I read "user" and thought of "unp= rivileged", despite the sentence literally saying Shepherd runs as 'root'!= =20 2. The (shepherd) Jump Start says, """When =E2=80=98shepherd=E2=80=99 gets started, it reads and evaluates a c= onfiguration file.=C2=A0 When it is started with superuser privileges, it t= ries to use =E2=80=98/etc/shepherd.scm=E2=80=99.=C2=A0 When started as norm= al user, it looks for a file called =E2=80=98$XDG_CONFIG_HOME/shepherd/init= .scm=E2=80=99.=C2=A0 If the =E2=80=98XDG_CONFIG_HOME=E2=80=99 environment v= ariable is not defined, =E2=80=98$HOME/.config/shepherd/init.scm=E2=80=99 i= s used instead.=C2=A0 With the option =E2=80=98--config=E2=80=99 (or, for s= hort, =E2=80=98-c=E2=80=99), you can specify where to look instead.=C2=A0 S= o if you want to start =E2=80=98shepherd=E2=80=99 with an alternative file,= use one of the following commands: =C2=A0=C2=A0=C2=A0=C2=A0 shepherd --config=3D/etc/shepherd.scm.old =C2=A0=C2=A0=C2=A0=C2=A0 shepherd -c /etc/shepherd.scm.old """ I followed the first and second paragraphs well enough.=C2=A0 I placed my i= nit.scm in the 'normal user' location.=C2=A0 I expressly didn't put it in /= etc/shepherd.scm because I knew I was non-root.=C2=A0 Although Shepherd sta= rts on init, I overlooked that it's *not* started for unprivileged users. Expecting Shepherd to auto-start for unprivileged users comes, in part, fro= m my experience with systemd.=C2=A0 On Debian, I recall being able to run `= systemctl --user restart emacsd` without sudo.=C2=A0 There's the --user opt= ion, sure.=C2=A0 However, I could manage a service as a non-privileged user= and didn't explicitly need to start systemd. Is there a reason why Shepher= d must be explicitly started as a non-privileged user? This expectation, and the confusion, was reinforced by the paragraph immedi= ately following in the docs, """As the final =E2=80=9Cd=E2=80=9D suggests, =E2=80=98shepherd=E2=80=99 is= just a daemon that (usually) runs in the background, so you will not inter= act with it directly.=C2=A0 After it is started, =E2=80=98shepherd=E2=80=99= will listen on a socket special file, usually =E2=80=98/var/run/shepherd/s= ocket=E2=80=99, for further commands.=C2=A0 You use the tool =E2=80=9Cherd= =E2=80=9D to send these commands to =E2=80=98shepherd=E2=80=99.""" The important fact that Shepherd must be 1) started by an unprivileged user= 2) using the 'shepherd' command is hidden in the conjunction(?) "After it = is started".=C2=A0 The manual emphasizes to use 'herd' and that interacting= with Shepherd through the 'shepherd' command is unusual.=C2=A0 Yet, isn't = starting Shepherd as a regular user with 'shepherd' the usual approach? This again begs the question, why isn't Shepherd started for non-privileged= users? 3. Section (shepherd) herd and shepherd says, """Thus, you start =E2=80=98shepherd=E2=80=99 once, and then always use her= d whenever you want to do something service-related.""" Looking at it now, I see this describes a procedure: 1. Run 'shepherd' 2. Always use 'herd' It's not mentioned that 'shepherd' isn't automatically started for non-priv= ileged users.=C2=A0 The sentence is also buried in Section 3.=C2=A0 Section= 2 explicitly says, "It [Section 2] is enough if you just need the basic features of it [Shepherd]".=C2=A0 Is it enough? I'm happy to provide language suggestions for improving the docs.=C2=A0 I f= eel I need to understand things a little better first.=C2=A0 Maybe the manu= al needs to clarify that 'shepherd' must be run by non-privileged users bef= ore they can use services and 'herd'?=C2=A0 Maybe 'shepherd' should be setu= p to automatically run for non-privileged users so that 'herd' is available= immediately? Thoughts?