From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: Invoking user shepherd; Was: Re: Defining *user* services in Guix Date: Tue, 13 Jun 2017 16:32:43 +0200 Message-ID: <20170613163243.16baca6d@scratchpost.org> References: <87o9vowfn0.fsf@gmail.com> <20170422203131.610f2a30@scratchpost.org> <878tmsghzk.fsf@gnu.org> <87inlvdr76.fsf@gmail.com> <87r30hbbi7.fsf@gmail.com> <87fugwsx2s.fsf@elephly.net> <8737cu7z0s.fsf@gnu.org> <877f24pnem.fsf@gmail.com> <87mvavk243.fsf@gnu.org> <20170611032900.6ac194b9@scratchpost.org> <87fuf448hz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKmsK-00088h-Ti for guix-devel@gnu.org; Tue, 13 Jun 2017 10:33:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKmsF-0008Kf-8j for guix-devel@gnu.org; Tue, 13 Jun 2017 10:32:56 -0400 In-Reply-To: <87fuf448hz.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org Hi Ludo, On Tue, 13 Jun 2017 10:06:16 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > The =E2=80=98delete-file=E2=80=99 was to avoid EADDRINUSE but I wonder if= it=E2=80=99s really a > good idea. Not a good idea. We should just put the shepherd socket somewhere in /run/user/4711 where 47= 11 is the user id (the entire name is present in an environment variable ca= lled XDG_RUNTIME_DIR). That's a new tmpfs created by the login process (el= ogind) on the first session of that user. That way, this EADDRINUSE can ne= ver happen except when it should (see below). Everything else is a weird w= orkaround. > What=E2=80=99s the difference between a =E2=80=9Cuser bus=E2=80=9D and a = =E2=80=9Csession bus=E2=80=9D? In > general, my understanding is that the user dbus-daemon (session bus?) is > started on demand. The user bus is started once per user. The session bus is started once per= session. For example let's say you have a terminal server and log in as ludo on seat= 1 and also as ludo on seat2, then you have two session buses and one user b= us.=20 Filesystem-based services usually run per-user because almost no one create= s extra directories for seats. Many programmers don't even think about it = and so their services are per-user whether they want to or not. > > Or should we just expect the user to put a (shepherd with fix) invocati= on into their HOME startup scripts like .xinitrc ? Note that if we did tha= t there's some session-specific stuff in the session's environment that she= pherd will inherit. Probably not that bad if invoked early enough. =20 >=20 > Currently that=E2=80=99s what I do: my ~/.xinitrc runs shepherd and that= =E2=80=99s it. Yeah, me too. That's how I found the bug... when I logged in to multiple s= eats suddenly I had a LOT of duplicate "user" services running :)