From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 24 10:21:31 2022 Received: (at submit) by debbugs.gnu.org; 24 Mar 2022 14:21:31 +0000 Received: from localhost ([127.0.0.1]:49108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXOLD-0005WR-Bv for submit@debbugs.gnu.org; Thu, 24 Mar 2022 10:21:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:58644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXOLB-0005WJ-Ct for submit@debbugs.gnu.org; Thu, 24 Mar 2022 10:21:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXOLB-0005fm-6f for bug-guix@gnu.org; Thu, 24 Mar 2022 10:21:29 -0400 Received: from [2001:470:142:3::e] (port=57682 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXOLA-0007Uv-Oe for bug-guix@gnu.org; Thu, 24 Mar 2022 10:21:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=STOfp9XuRggaUjmvSX4sVFi6OZZEZs443brdeHO1858=; b=MGWDrjm+LPqFZg dZ8ytUEXnZhbQZffIb6aRAl1KlAO1hROUBd7JRfGJh+PiEXZcsMIuvr5HOBwBftAjxsl59PBFyxii Rq+9r8AUalpZHD1Ty9Lpg85Cx9OBi/aeW+OiJiy/2d+mbCzxVXrjSBlVc/tQ8S4641p5yPYb4eQ7M HrteCAAf80Gh5keWgH5S/+GBNHEEsxGTUGjj5Hurbz/4rcj8zdQllJQHzlX5Fjdhcz6f0izGuje3+ JCujHiAPeSMWCrogaysnDRNwlHOzUkAdbNug57tvYHLq8ADKS1EMy+vY7l7zYPHxcZUfoyuSLVKog e6b9GV33S3O+SjrEXf5g==; Received: from [193.50.110.177] (port=51518 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXOLA-0002FW-86 for bug-guix@gnu.org; Thu, 24 Mar 2022 10:21:28 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org Subject: [Guix Home] =?utf-8?B?4oCYc2hlcGhlcmTigJk=?= started twice? X-Debbugs-Cc: Andrew Tropin X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 Germinal an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 24 Mar 2022 15:21:26 +0100 Message-ID: <87a6dfbfdl.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, >From what can be seen in =E2=80=98guix home container=E2=80=99, it would se= em that =E2=80=98shepherd=E2=80=99 is started twice, leading to this error while at= tempting to bind(2) the second time (thus it=E2=80=99s actually harmless, but suboptima= l): --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix home container /tmp/t.scm WARNING: (guile-user): imported module (guix build utils) overrides core bi= nding `delete' Symlinking /home/ludo/.bash_profile -> /gnu/store/flqaxzvgfv2g3415mhmq6c0zb= zdzv2k4-bash_profile... done Symlinking /home/ludo/.profile -> /gnu/store/dann7r1095xll0kji5yl0ql07096rc= 8j-shell-profile... done Symlinking /home/ludo/.bashrc -> /gnu/store/g78w0adqg25z3jl8jq71n0n0z32f7db= x-bashrc... done Symlinking /home/ludo/.config/fontconfig/fonts.conf -> /gnu/store/4261pxafn= y0g2myhh9yj1771ry7k05lc-fonts.conf... done done Finished updating symlinks. Comparing /gnu/store/non-existing-generation/profile/share/fonts and /gnu/store/vvfrdbvmb0g41k00xxmd9qpgzavkvd32-home/profile/share/fo= nts... done (same) Evaluating on-change gexps. On-change gexps evaluation finished. Service root has been started. WARNING: Use of `load' in declarative module (#{ g56}#). Add #:declarative= ? #f to your define-module invocation. Starting services... Service mcron has been started. Service root has been started. WARNING: Use of `load' in declarative module (#{ g56}#). Add #:declarative= ? #f to your define-module invocation. Starting services... Service mcron has been started. Backtrace: 4 (primitive-load "/gnu/store/vza48khbaq0fdmcsrn27xj5y5yy?") In shepherd.scm: ~$ 316:10 3 (main "--logfile" "/home/ludo/.local/var/log/shepherd.?" ?) 56:14 2 (call-with-server-socket "/run/user/1000/shepherd/sock?" ?) 49:6 1 (open-server-socket "/run/user/1000/shepherd/socket") In unknown file: 0 (bind # #(1 "/run/user/1000?") #) ERROR: In procedure bind: In procedure bind: Address already in use --8<---------------cut here---------------end--------------->8--- I suspect the problem is in activation snippets, but I=E2=80=99m open to ot= her hypotheses. :-) Thoughts? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 02:41:18 2022 Received: (at 54545) by debbugs.gnu.org; 4 Apr 2022 06:41:18 +0000 Received: from localhost ([127.0.0.1]:50313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbGOs-0003On-JD for submit@debbugs.gnu.org; Mon, 04 Apr 2022 02:41:18 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:44361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbGOq-0003OX-Fv for 54545@debbugs.gnu.org; Mon, 04 Apr 2022 02:41:17 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id B49EB240005; Mon, 4 Apr 2022 06:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1649054470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wOckvcRZk3vh/UQ099HIwUiAHRxI530LeFj2cNKkTPo=; b=JUiPvKhKoJJJhOGUwirnWW+/YEaPgTFLc4obbu82lZyGoxtcaGsjtlsmOheebccGQe5Fz8 MShXpFj8gaVjJG5ZWXqzg4L9C4/K7wjrszhoCdkmrAb2uPs7ELDl4LFBS9UyzicY4S7Mnw 1QS0C+X5GcHdyzb5WuHqywzurmpsBTAVZQJfV7jF3Xd3Zy3qr7aNOJz3wvbnpQgXhHIP5R k4JoS/tJDWQeBw67MVrI1nb7EM5aFGjQbDX+ywgVaX7hDKwpdd5zH+lxNfvHXaqjIfeAAd uotPTtt/hKnfLJKvQfhDow2PLdPzNZ7nBpWneFcqKuDRwNvKvH9WxafvWcjelw== From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= , 54545@debbugs.gnu.org Subject: Re: bug#54545: [Guix Home] =?utf-8?B?4oCYc2hlcGhlcmTigJk=?= started twice? In-Reply-To: <87a6dfbfdl.fsf@inria.fr> References: <87a6dfbfdl.fsf@inria.fr> Date: Mon, 04 Apr 2022 09:41:06 +0300 Message-ID: <87sfqt2vwd.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54545 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-03-24 15:21, Ludovic Court=C3=A8s wrote: > Hi, > > From what can be seen in =E2=80=98guix home container=E2=80=99, it would = seem that > =E2=80=98shepherd=E2=80=99 is started twice, leading to this error while = attempting to > bind(2) the second time (thus it=E2=80=99s actually harmless, but subopti= mal): > > --8<---------------cut here---------------start------------->8--- > $ ./pre-inst-env guix home container /tmp/t.scm > WARNING: (guile-user): imported module (guix build utils) overrides core = binding `delete' > Symlinking /home/ludo/.bash_profile -> /gnu/store/flqaxzvgfv2g3415mhmq6c0= zbzdzv2k4-bash_profile... done > Symlinking /home/ludo/.profile -> /gnu/store/dann7r1095xll0kji5yl0ql07096= rc8j-shell-profile... done > Symlinking /home/ludo/.bashrc -> /gnu/store/g78w0adqg25z3jl8jq71n0n0z32f7= dbx-bashrc... done > Symlinking /home/ludo/.config/fontconfig/fonts.conf -> /gnu/store/4261pxa= fny0g2myhh9yj1771ry7k05lc-fonts.conf... done > done > Finished updating symlinks. > > Comparing /gnu/store/non-existing-generation/profile/share/fonts and > /gnu/store/vvfrdbvmb0g41k00xxmd9qpgzavkvd32-home/profile/share/= fonts... done (same) > Evaluating on-change gexps. > > On-change gexps evaluation finished. > > Service root has been started. > WARNING: Use of `load' in declarative module (#{ g56}#). Add #:declarati= ve? #f to your define-module invocation. > Starting services... > Service mcron has been started. > > Service root has been started. > WARNING: Use of `load' in declarative module (#{ g56}#). Add #:declarati= ve? #f to your define-module invocation. > Starting services... > Service mcron has been started. > > Backtrace: > 4 (primitive-load "/gnu/store/vza48khbaq0fdmcsrn27xj5y5yy?") > In shepherd.scm: > ~$ 316:10 3 (main "--logfile" "/home/ludo/.local/var/log/shepherd.?" = ?) > 56:14 2 (call-with-server-socket "/run/user/1000/shepherd/sock?" ?) > 49:6 1 (open-server-socket "/run/user/1000/shepherd/socket") > In unknown file: > 0 (bind # #(1 "/run/user/1000?") #) > > ERROR: In procedure bind: > In procedure bind: Address already in use > --8<---------------cut here---------------end--------------->8--- > > I suspect the problem is in activation snippets, but I=E2=80=99m open to = other > hypotheses. :-) > > Thoughts? > > Ludo=E2=80=99. > > Can confirm. Activation script tries to load latest shepherd configuration with `herd load root ./path/to/config.scm` and it starts a shepherd process. Login shell starts the shepherd process as well. Probably we need to do config reload using on-change service and also not trigger on-change stuff if user isn't logged in. I can think on the proper solution and make a patch with a fix later this week or beginning of the next week. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmJKkwIPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wAm8P/RgZVSBwXkyeRoZdoswslQPp6bnBF1Awc0a0 67ZoOZhJcMl7NHlk/Pk4fWTqsnqacSp3v6DWLnaQBWMmS9NdLGlqIn3vUqEvqhg6 zAtT3V17SSN0jj5OxzyVtiSDKz1wo7wCAyh2TWCpfa+/05fC/ivP48MM+YEswgiq gbtAwx//7LfQ5jHnatzWZoG+itI8q9TyvuTDp4uyePCDk2jk08Nuxu2zcOUMYkUD x0+q1YsQwSDwr+zLo6/HvyujeA8MIhvyB76X/kZ0uM8s9GrFulsH7dVdetPR6dEC H1Et/b4utZrDzqpQA4KzK0e5g3ES3EVmefGpOXeBHien8/E90v3a7SOBBUl1MNkT D3RTW9WCdjCdqTJ5L1VEpJ1BSFd96o7T7meiQ+RLyfzL1tB7yaCgcCux+ImiuIiV OeeaoKyhRSqj+T+v0wM+5oza0Tz7g5nbvaI68OCCcjZGsCGVAovUfBCkYgN5kX0e ic/Oa6MZQkzZByZqFxTMoD2pMi5XB7yNUu/Z1iPLu8S6W9M8Yeau2DuLTscpQHJZ FBGIbXPucZXzRGtWdPGJFEzC0fISbhdIVoKpkFWeoHFsNkAjC3OfTDyGPHb1kTgI HefZJOiB0adzapHdHeGRnV+83tJVInTij/nxnxsfkUDXNr3vxUIazjl3zPHChs+l bIPyDsob =DWez -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 16:17:05 2022 Received: (at 54545) by debbugs.gnu.org; 4 Apr 2022 20:17:05 +0000 Received: from localhost ([127.0.0.1]:53154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbT8L-00081r-0t for submit@debbugs.gnu.org; Mon, 04 Apr 2022 16:17:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbT8J-00081G-DC for 54545@debbugs.gnu.org; Mon, 04 Apr 2022 16:17:03 -0400 Received: from [2001:470:142:3::e] (port=41786 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbT8D-0001Ae-Qd; Mon, 04 Apr 2022 16:16:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=huFG8QF8VoMRRM1gJxcMXWskvyjFroKegRCs7vaNqjg=; b=lHUb6Zbsl12QjW/TAExP /1V3Kw+L3OmjxdowuyBeTVUIhsz2sLH6zCD1bWf93VLxKMVExE5LDIN+xUohRlPEbkri9LT1nUGx/ SAJpOrKtr3L32MqcjpN9++UDD0+yuiyxiyaaLnFQBzrq2B5Hej5Du/Vv5VH0mZUF2UdTwY3iQQssP 2gF6uuqeDhvWRL7hMZSrnTYmDGMU0d4pX+VmYucMh+RlfZNn4EdE1+P0Bmr60xss6FGDN14OHt2OW cn8+VTZYwksFiwlchKqSb3m/jprlamV9d+trRSuMkKukd5L1I5ea25Z6GejVhP56B0snlji/maj8v A9u+p7trO2wpSQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58142 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbT8D-00072w-CD; Mon, 04 Apr 2022 16:16:57 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: bug#54545: [Guix Home] =?utf-8?B?4oCYc2hlcGhlcmTigJk=?= started twice? References: <87a6dfbfdl.fsf@inria.fr> <87sfqt2vwd.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 15 Germinal an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 04 Apr 2022 22:16:55 +0200 In-Reply-To: <87sfqt2vwd.fsf@trop.in> (Andrew Tropin's message of "Mon, 04 Apr 2022 09:41:06 +0300") Message-ID: <871qyctxhk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54545 Cc: 54545@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Andrew Tropin skribis: > Activation script tries to load latest shepherd configuration with `herd > load root ./path/to/config.scm` and it starts a shepherd process. Login > shell starts the shepherd process as well. Probably we need to do > config reload using on-change service and also not trigger on-change > stuff if user isn't logged in. Makes sense. > I can think on the proper solution and make a patch with a fix later > this week or beginning of the next week. Awesome, thanks for taking a look! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 12 05:28:08 2022 Received: (at 54545) by debbugs.gnu.org; 12 Apr 2022 09:28:08 +0000 Received: from localhost ([127.0.0.1]:47536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neCoh-0006DS-SW for submit@debbugs.gnu.org; Tue, 12 Apr 2022 05:28:08 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:56493) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neCog-0006Cu-0F for 54545@debbugs.gnu.org; Tue, 12 Apr 2022 05:28:06 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 59E6220007; Tue, 12 Apr 2022 09:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1649755679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4f2Xyko9X2L2LAw73TW/hVvuyNYpRxawrB3FciDXQGE=; b=NxU3XI4LZeuS7kwyQBIO/QdS/NpkNdpmr35iFs0E85Qx1eORDebMD3Gyp0cm6qov4adAHx P6hmnn1BK2ekvaqOQ8FNWvKYwEsFCM6sQ821dt9Sws9nrBC4DVzUQg2zTnP2keQ4HgCU+Y yqafgY0M9vpLzVd4LcMTLCtc2EagDVf/bYItWiYv7V9BHNlF9F7exmwesB+7zej6Ya4IA4 PzDuvMe79qLWRjQVPM6vGF9dC8ctdmDBNJ/kmnT5q88yF2r+5cOmKidA155xktxJX0DSDg uu+8inzCw89lEEGi1AR/Dgt3b5F/bb/Ej8Jk5RB+Pe92I7LUOCGdUb9wcdmviw== From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#54545: [Guix Home] =?utf-8?B?4oCYc2hlcGhlcmTigJk=?= started twice? In-Reply-To: <871qyctxhk.fsf@gnu.org> References: <87a6dfbfdl.fsf@inria.fr> <87sfqt2vwd.fsf@trop.in> <871qyctxhk.fsf@gnu.org> Date: Tue, 12 Apr 2022 12:27:55 +0300 Message-ID: <871qy2irc4.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54545 Cc: 54545@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-04-04 22:16, Ludovic Court=C3=A8s wrote: > Hi, > > Andrew Tropin skribis: > >> Activation script tries to load latest shepherd configuration with `herd >> load root ./path/to/config.scm` and it starts a shepherd process. Login >> shell starts the shepherd process as well. Probably we need to do >> config reload using on-change service and also not trigger on-change >> stuff if user isn't logged in. > > Makes sense. > >> I can think on the proper solution and make a patch with a fix later >> this week or beginning of the next week. > > Awesome, thanks for taking a look! > > Ludo=E2=80=99. Prepared a patch series, which fixes the issues and sligthly adjusts the way home shepherd reload configuration logic works, now it happens only if configuration is changed and also it doesn't try to be smart and start a shepherd if it's not started yet. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-home-shepherd-Prevent-launching-the-second-instance.patch Content-Transfer-Encoding: quoted-printable From=20d2578f8924217451ca20f0b61fd6f9b9d31c930d Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Tue, 12 Apr 2022 11:30:58 +0300 Subject: [PATCH 1/3] home: shepherd: Prevent launching the second instance. * gnu/home/services/shepherd.scm: Prevent launching the second instance. =2D-- gnu/home/services/shepherd.scm | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm index 012585fea4..df6bbb30e6 100644 =2D-- a/gnu/home/services/shepherd.scm +++ b/gnu/home/services/shepherd.scm @@ -93,17 +93,21 @@ (define (launch-shepherd-gexp config) (services (home-shepherd-configuration-services config))) (if (home-shepherd-configuration-auto-start? config) (with-imported-modules '((guix build utils)) =2D #~(let ((log-dir (or (getenv "XDG_LOG_HOME") =2D (format #f "~a/.local/var/log" (getenv "H= OME"))))) =2D ((@ (guix build utils) mkdir-p) log-dir) =2D (system* =2D #$(file-append shepherd "/bin/shepherd") =2D "--logfile" =2D (string-append =2D log-dir =2D "/shepherd.log") =2D "--config" =2D #$(home-shepherd-configuration-file services shepherd)))) + #~(unless (file-exists? + (string-append + (or (getenv "XDG_RUNTIME_DIR") + (format #f "/run/user/~a" (getuid))) + "/shepherd/socket")) + (let ((log-dir (or (getenv "XDG_LOG_HOME") + (format #f "~a/.local/var/log" + (getenv "HOME"))))) + ((@ (guix build utils) mkdir-p) log-dir) + (system* + #$(file-append shepherd "/bin/shepherd") + "--logfile" + (string-append log-dir "/shepherd.log") + "--config" + #$(home-shepherd-configuration-file services shepherd))))) #~""))) =20 (define (reload-configuration-gexp config) =2D-=20 2.35.1 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-home-shepherd-Use-run-on-change-to-reload-shepherd-c.patch Content-Transfer-Encoding: quoted-printable From=2056d16b4cd511f6837329b888dade0c6d6da4d89d Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Tue, 12 Apr 2022 12:19:50 +0300 Subject: [PATCH 2/3] home: shepherd: Use run-on-change to reload shepherd config. * gnu/home/services/shepherd.scm: Add shepherd configuration to XDG_CONFIG_HOME and use it instead of full path to the store. It's necessary to use run-on-change service. =2D-- gnu/home/services/shepherd.scm | 40 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm index df6bbb30e6..9a99fed2b5 100644 =2D-- a/gnu/home/services/shepherd.scm +++ b/gnu/home/services/shepherd.scm @@ -105,27 +105,30 @@ (define (launch-shepherd-gexp config) (system* #$(file-append shepherd "/bin/shepherd") "--logfile" =2D (string-append log-dir "/shepherd.log") =2D "--config" =2D #$(home-shepherd-configuration-file services shepherd))= ))) + (string-append log-dir "/shepherd.log"))))) #~""))) =20 (define (reload-configuration-gexp config) (let* ((shepherd (home-shepherd-configuration-shepherd config)) (services (home-shepherd-configuration-services config))) =2D #~(system* =2D #$(file-append shepherd "/bin/herd") =2D "load" "root" =2D #$(home-shepherd-configuration-file services shepherd)))) + #~(when (file-exists? + (string-append + (or (getenv "XDG_RUNTIME_DIR") + (format #f "/run/user/~a" (getuid))) + "/shepherd/socket")) + (system* + #$(file-append shepherd "/bin/herd") + "load" "root" + #$(home-shepherd-configuration-file services shepherd))))) =20 =2D(define (ensure-shepherd-gexp config) =2D #~(if (file-exists? =2D (string-append =2D (or (getenv "XDG_RUNTIME_DIR") =2D (format #f "/run/user/~a" (getuid))) =2D "/shepherd/socket")) =2D #$(reload-configuration-gexp config) =2D #$(launch-shepherd-gexp config))) +(define (add-shepherd-configuration config) + (let* ((shepherd (home-shepherd-configuration-shepherd config)) + (services (home-shepherd-configuration-services config))) + `(("shepherd/init.scm" + ,(home-shepherd-configuration-file services shepherd))))) + +(define (home-shepherd-run-on-change config) + `(("files/.config/shepherd/init.scm" ,(reload-configuration-gexp config)= ))) =20 (define-public home-shepherd-service-type (service-type (name 'home-shepherd) @@ -134,8 +137,11 @@ (define-public home-shepherd-service-type home-run-on-first-login-service-type launch-shepherd-gexp) (service-extension =2D home-activation-service-type =2D ensure-shepherd-gexp) + home-xdg-configuration-files-service-type + add-shepherd-configuration) + (service-extension + home-run-on-change-service-type + home-shepherd-run-on-change) (service-extension home-profile-service-type (lambda (config) =2D-=20 2.35.1 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-home-run-on-first-login-Add-a-startup-message-to-the.patch Content-Transfer-Encoding: quoted-printable From=20e80e9fae6f6bcd478fa904aad8eb426da3f42f10 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Tue, 12 Apr 2022 12:23:26 +0300 Subject: [PATCH 3/3] home: run-on-first-login: Add a startup message to the script. gnu/home/services.scm: Add a startup message to the script to make it clear when it begins. =2D-- gnu/home/services.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/home/services.scm b/gnu/home/services.scm index 49bd6e3555..e2c51910a8 100644 =2D-- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -344,6 +344,7 @@ (define (compute-on-first-login-script _ gexps) #~(begin (use-modules (guix i18n)) #$%initialize-gettext + (display (G_ "Starting run-on-first-login script.\n\n")) =20 (let* ((xdg-runtime-dir (or (getenv "XDG_RUNTIME_DIR") (format #f "/run/user/~a" (getuid)))) =2D-=20 2.35.1 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Best regards, Andrew Tropin --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmJVRhsPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6w80UQAIfYq0VN7pjUn3N/auRzgWNSFPW08MKUz6cI QmAa2Xo8JLH4Vdq6uHuiJreA107bevnbpTMZiGGKh1Tg9/mmVjTYg8HxZLFcAFhv 2MxZVBxcd9P3vDUreYx+NF6OatlLCFXvEw+evtbn6dLSsuUE/OsPq8Bcx1x92tcu WbF5PZjvTe8Uc8p3Lb/fX+Q6Y76nQJseWZZkEJtstaqwHWSE4QC5Q5BoWlq5UTOI mY+W8Aqt0aqfsszTV0ZX7QtnJmzVHTnD7+O9A45BFtZGz1oyIFFs8v41nTQbdk9U j5jRbNGF7rezdp7lM1ffr1bGwcjCHPz2KYI7oaFDtt7lq+W8eg9KA0P7dJtkoNuL FMoOAXwmmXcKebdSTbqXnjqZKW8vx+HlfTgzBVEsryjZP0bOutXWQQrobi2ipvmE 2a7GJveJZH//IO/9VX6t0B4yA3F+j3IGcn/pCrZ4n7YxljXbydZ/x0oyb4dUrH0Y q0yG7/zFj1QstmQFKYQcURTxzQH/7HWziyzp8GJVJRfb5esTkeD5IAkfW6qYZySC Nc+JVZ6EwI3ax4Nf6yaedZsWlMgfeeXIHv6OhnJf8IP36t7P6Fbw95J6B6ijWwBA RJ+VhfnqmbwliL/MfqEk8ig35lm69iU0r5XTuGiH7uMvqMJVVrbGHvxuVjXnD4nQ wk6dXnIn =SCWs -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 12 14:28:13 2022 Received: (at 54545) by debbugs.gnu.org; 12 Apr 2022 18:28:13 +0000 Received: from localhost ([127.0.0.1]:49766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neLFM-0006Kz-Go for submit@debbugs.gnu.org; Tue, 12 Apr 2022 14:28:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neLFK-0006Km-Pk for 54545@debbugs.gnu.org; Tue, 12 Apr 2022 14:28:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neLFF-000101-5m; Tue, 12 Apr 2022 14:28:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=jxxUC3Ic9kZ1OwNMaj/fjOJJEqosClsBFN60phXUhZ0=; b=fMkz3y7vF9XQXcHHGp+v fophxCQNO80mgJ4VYj1MgOJlRQM+xGGwhFqgi0wJUHO5dUAQcMlT+xUseGACgs+Q5b2YOfBJEbXbS jwT/wSFwtMCk2Y9iEm6G/SLtSaOJZvWGlgxX8YLzSxbfaFwVENn9PhsiozoRVAXAuB9YRrp6v3fJJ gfqyMkk8aMcN7Xzc9ZHMb2jnllbGpqbD2cats68BONFLL82y3074YDcAENvdbrcNeuoOt5wvNVF+H PxMvdMFd4eoqpNbFOEbvUlc07UUdeIJ3+mnJeJSoQSRu0vslCHxHVUr9EpRbqPD7R2TI3CN7kKe0l tk9wY6tykTpcZA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60544 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neLFD-0000Rs-Uu; Tue, 12 Apr 2022 14:28:04 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: bug#54545: [Guix Home] =?utf-8?B?4oCYc2hlcGhlcmTigJk=?= started twice? References: <87a6dfbfdl.fsf@inria.fr> <87sfqt2vwd.fsf@trop.in> <871qyctxhk.fsf@gnu.org> <871qy2irc4.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 23 Germinal an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 12 Apr 2022 20:28:01 +0200 In-Reply-To: <871qy2irc4.fsf@trop.in> (Andrew Tropin's message of "Tue, 12 Apr 2022 12:27:55 +0300") Message-ID: <87czhmcg26.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54545 Cc: 54545@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Andrew Tropin skribis: > Prepared a patch series, which fixes the issues and sligthly adjusts the > way home shepherd reload configuration logic works, now it happens only > if configuration is changed and also it doesn't try to be smart and > start a shepherd if it's not started yet. > > From d2578f8924217451ca20f0b61fd6f9b9d31c930d Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Tue, 12 Apr 2022 11:30:58 +0300 > Subject: [PATCH 1/3] home: shepherd: Prevent launching the second instanc= e. > > * gnu/home/services/shepherd.scm: Prevent launching the second instance. I applied this one with a convention commit log, including a =E2=80=9CFixes= =E2=80=9D line, which is important for traceability. (Please check the ChangeLog convention for future patches.) > From 56d16b4cd511f6837329b888dade0c6d6da4d89d Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Tue, 12 Apr 2022 12:19:50 +0300 > Subject: [PATCH 2/3] home: shepherd: Use run-on-change to reload shepherd > config. > > * gnu/home/services/shepherd.scm: Add shepherd configuration to > XDG_CONFIG_HOME and use it instead of full path to the store. It's necess= ary > to use run-on-change service. [...] > +++ b/gnu/home/services/shepherd.scm > @@ -105,27 +105,30 @@ (define (launch-shepherd-gexp config) > (system* > #$(file-append shepherd "/bin/shepherd") > "--logfile" > - (string-append log-dir "/shepherd.log") > - "--config" > - #$(home-shepherd-configuration-file services shepherd))= ))) > + (string-append log-dir "/shepherd.log"))))) > #~""))) >=20=20 > (define (reload-configuration-gexp config) > (let* ((shepherd (home-shepherd-configuration-shepherd config)) > (services (home-shepherd-configuration-services config))) > - #~(system* > - #$(file-append shepherd "/bin/herd") > - "load" "root" > - #$(home-shepherd-configuration-file services shepherd)))) > + #~(when (file-exists? > + (string-append > + (or (getenv "XDG_RUNTIME_DIR") > + (format #f "/run/user/~a" (getuid))) > + "/shepherd/socket")) > + (system* > + #$(file-append shepherd "/bin/herd") > + "load" "root" > + #$(home-shepherd-configuration-file services shepherd))))) >=20=20 > -(define (ensure-shepherd-gexp config) > - #~(if (file-exists? > - (string-append > - (or (getenv "XDG_RUNTIME_DIR") > - (format #f "/run/user/~a" (getuid))) > - "/shepherd/socket")) > - #$(reload-configuration-gexp config) > - #$(launch-shepherd-gexp config))) > +(define (add-shepherd-configuration config) > + (let* ((shepherd (home-shepherd-configuration-shepherd config)) > + (services (home-shepherd-configuration-services config))) > + `(("shepherd/init.scm" > + ,(home-shepherd-configuration-file services shepherd))))) > + > +(define (home-shepherd-run-on-change config) > + `(("files/.config/shepherd/init.scm" ,(reload-configuration-gexp confi= g)))) How does this relate to the bug at hand? https://issues.guix.gnu.org/54545 As discussed elsewhere, I find it less ambiguous to pass store file names for configuration files. That can be a drawback in some cases, for daemons that won=E2=80=99t be abl= e to load a new config from a different location, but shepherd is not in that category: it can load a config file via =E2=80=98herd load root=E2=80=99 fr= om any place. Last, it would be nice if we could use the (guix scripts system reconfigure) machinery like =E2=80=98guix system reconfigure=E2=80=99 and = =E2=80=98guix deploy=E2=80=99 to upgrade services. An idea for future work. :-) > From e80e9fae6f6bcd478fa904aad8eb426da3f42f10 Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Tue, 12 Apr 2022 12:23:26 +0300 > Subject: [PATCH 3/3] home: run-on-first-login: Add a startup message to t= he > script. > > gnu/home/services.scm: Add a startup message to the script to make it cle= ar > when it begins. > --- > gnu/home/services.scm | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gnu/home/services.scm b/gnu/home/services.scm > index 49bd6e3555..e2c51910a8 100644 > --- a/gnu/home/services.scm > +++ b/gnu/home/services.scm > @@ -344,6 +344,7 @@ (define (compute-on-first-login-script _ gexps) > #~(begin > (use-modules (guix i18n)) > #$%initialize-gettext > + (display (G_ "Starting run-on-first-login script.\n\n")) I=E2=80=99m not fond of unconditional low-level logging. In Guix there=E2= =80=99s relatively little logging and whatever logging there is is controlled by =E2=80=98-v=E2=80=99; I think we should follow that approach as much as pos= sible. Thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 13 02:22:39 2022 Received: (at 54545) by debbugs.gnu.org; 13 Apr 2022 06:22:39 +0000 Received: from localhost ([127.0.0.1]:51356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neWOl-0000HG-BB for submit@debbugs.gnu.org; Wed, 13 Apr 2022 02:22:39 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:52301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neWOj-0000H2-4Z for 54545@debbugs.gnu.org; Wed, 13 Apr 2022 02:22:38 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 064A660005; Wed, 13 Apr 2022 06:22:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1649830951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nmwJkmbxwtbk80DF7zfb5Our9TdUh/gfZ8WIx94tCtw=; b=GNwjIfsNAhdI+CmXQYrtum1OU79NcYweD/DZYdKFZaSIeynDrt/+Pu8aGPSJBSphxiBdBF oYWiOurUMuxLD520DwjSCCvKeb3WTQmniCv7Pht4QgERA3XjhQ/dc1S8OSM0YnXTL3hnLR jv8ziQao54qkv2Zn6TzaKA7yrHVtGJ3mIz6FHcbbzxkcA9pVcKCI6F5vCckZJ26fOuL6ze 8hR853f0ktmMTwCH8X/XYqTCHkRkkNmy5UrmbBJJ7/zLoCaiHerBwDiJPuvY38KefUd7D/ TQPow3XukE6jEyncGOyXPZN2I6rfC/8LwA/WuhBMn5Nl7Vcyzw2fp2hmKXyz/A== From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#54545: [Guix Home] =?utf-8?B?4oCYc2hlcGhlcmTigJk=?= started twice? In-Reply-To: <87czhmcg26.fsf@gnu.org> References: <87a6dfbfdl.fsf@inria.fr> <87sfqt2vwd.fsf@trop.in> <871qyctxhk.fsf@gnu.org> <871qy2irc4.fsf@trop.in> <87czhmcg26.fsf@gnu.org> Date: Wed, 13 Apr 2022 09:22:27 +0300 Message-ID: <87y209jye4.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54545 Cc: 54545@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-04-12 20:28, Ludovic Court=C3=A8s wrote: > Hi, > > Andrew Tropin skribis: > >> Prepared a patch series, which fixes the issues and sligthly adjusts the >> way home shepherd reload configuration logic works, now it happens only >> if configuration is changed and also it doesn't try to be smart and >> start a shepherd if it's not started yet. >> >> From d2578f8924217451ca20f0b61fd6f9b9d31c930d Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 12 Apr 2022 11:30:58 +0300 >> Subject: [PATCH 1/3] home: shepherd: Prevent launching the second instan= ce. >> >> * gnu/home/services/shepherd.scm: Prevent launching the second instance. > > I applied this one with a convention commit log, including a =E2=80=9CFix= es=E2=80=9D > line, which is important for traceability. (Please check the ChangeLog > convention for future patches.) > Read it from time to time, but the information about contribution guidelines is too much spreaded, for example I can't find info about Fixes line even with search, but maybe I just not very attentive. https://guix.gnu.org/en/manual/devel/en/guix.html#Sending-a-Patch-Series-1 https://www.gnu.org/prep/standards/standards.html#Change-Logs >> From 56d16b4cd511f6837329b888dade0c6d6da4d89d Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 12 Apr 2022 12:19:50 +0300 >> Subject: [PATCH 2/3] home: shepherd: Use run-on-change to reload shepherd >> config. >> >> * gnu/home/services/shepherd.scm: Add shepherd configuration to >> XDG_CONFIG_HOME and use it instead of full path to the store. It's neces= sary >> to use run-on-change service. > > [...] > >> +++ b/gnu/home/services/shepherd.scm >> @@ -105,27 +105,30 @@ (define (launch-shepherd-gexp config) >> (system* >> #$(file-append shepherd "/bin/shepherd") >> "--logfile" >> - (string-append log-dir "/shepherd.log") >> - "--config" >> - #$(home-shepherd-configuration-file services shepherd)= )))) >> + (string-append log-dir "/shepherd.log"))))) >> #~""))) >>=20=20 >> (define (reload-configuration-gexp config) >> (let* ((shepherd (home-shepherd-configuration-shepherd config)) >> (services (home-shepherd-configuration-services config))) >> - #~(system* >> - #$(file-append shepherd "/bin/herd") >> - "load" "root" >> - #$(home-shepherd-configuration-file services shepherd)))) >> + #~(when (file-exists? >> + (string-append >> + (or (getenv "XDG_RUNTIME_DIR") >> + (format #f "/run/user/~a" (getuid))) >> + "/shepherd/socket")) >> + (system* >> + #$(file-append shepherd "/bin/herd") >> + "load" "root" >> + #$(home-shepherd-configuration-file services shepherd))))) >>=20=20 >> -(define (ensure-shepherd-gexp config) >> - #~(if (file-exists? >> - (string-append >> - (or (getenv "XDG_RUNTIME_DIR") >> - (format #f "/run/user/~a" (getuid))) >> - "/shepherd/socket")) >> - #$(reload-configuration-gexp config) >> - #$(launch-shepherd-gexp config))) >> +(define (add-shepherd-configuration config) >> + (let* ((shepherd (home-shepherd-configuration-shepherd config)) >> + (services (home-shepherd-configuration-services config))) >> + `(("shepherd/init.scm" >> + ,(home-shepherd-configuration-file services shepherd))))) >> + >> +(define (home-shepherd-run-on-change config) >> + `(("files/.config/shepherd/init.scm" ,(reload-configuration-gexp conf= ig)))) > > How does this relate to the bug at hand? > > https://issues.guix.gnu.org/54545 > Almost directly. During activation if there is no shepherd process we tried to launch a new one, which was useful back in the days, when I was testing changes frequently, but can be kinda unexpected for user, if they stopped Shepherd for some reason, but during activation it started again automatically. As we discussed earlier: >>> Probably we need to do config reload using on-change service and also >>> not trigger on-change stuff if user isn't logged in. >> Makes sense. it would be nice to reload configuration only if it's changed. To make run-on-change work we need to store a config somewhere in home-environment, to make it possible to compare with previous generation. files/.config/shepherd/init.scm looks like a good match here, in addition to on-change functionality it increases explorability. > As discussed elsewhere, I find it less ambiguous to pass store file > names for configuration files. > I don't know how much value in it, but we can keep those lines: >> - "--config" >> - #$(home-shepherd-configuration-file services shepherd)= )))) >=20 > That can be a drawback in some cases, for daemons that won=E2=80=99t be a= ble > to load a new config from a different location, but shepherd is not in > that category: it can load a config file via =E2=80=98herd load root=E2= =80=99 from any > place. > It is how reload gexp works. > Last, it would be nice if we could use the (guix scripts system > reconfigure) machinery like =E2=80=98guix system reconfigure=E2=80=99 and= =E2=80=98guix deploy=E2=80=99 > to upgrade services. An idea for future work. :-) > >> From e80e9fae6f6bcd478fa904aad8eb426da3f42f10 Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 12 Apr 2022 12:23:26 +0300 >> Subject: [PATCH 3/3] home: run-on-first-login: Add a startup message to = the >> script. >> >> gnu/home/services.scm: Add a startup message to the script to make it cl= ear >> when it begins. >> --- >> gnu/home/services.scm | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/gnu/home/services.scm b/gnu/home/services.scm >> index 49bd6e3555..e2c51910a8 100644 >> --- a/gnu/home/services.scm >> +++ b/gnu/home/services.scm >> @@ -344,6 +344,7 @@ (define (compute-on-first-login-script _ gexps) >> #~(begin >> (use-modules (guix i18n)) >> #$%initialize-gettext >> + (display (G_ "Starting run-on-first-login script.\n\n")) > > I=E2=80=99m not fond of unconditional low-level logging. In Guix there= =E2=80=99s > relatively little logging and whatever logging there is is controlled by > =E2=80=98-v=E2=80=99; I think we should follow that approach as much as p= ossible. > > Thank you! > > Ludo=E2=80=99. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmJWbCMPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wUlAP/0JcTeqD3pfB0HsKQkHyKkFFUmA4Pl5Wc5bx 5ONYQJgqk2aB4+VAFLu8zZkyc1g3jfLcflLyJI57Y78vU93GjUG790GAy35fPI4o 2FMe822qrI5K0Uxkp03IucPKan4zSeKVWzFyfGE5UnK2Qw/x9TqzWd7FhWq1ZUv4 c3Gk6Bt+6ax/DdJSwCc672FXX/0MqepVaX60MStlbinRUx1WzL9O9/IDJ36A9Ina E4ZEHjZQPJkpwNF+XwH888VuN+ntp0k9SUEA3xoIMDvVlSi0IKIqCFkuY76bmwRB liUJwCbzUgp9RKQ4LEYC31DJFL6UJyXSbfX7jBizWqyp9yhSXEbEg3d8Z6VEMU18 d9IfbVPbqkqjQR9c7pYk1unKVi+OsOyqScopmt7ooGxCvsNMljkksCFKe0nQAOZW KGMoHeBZI87dArbq8aRkNm6NDcZEFQrJ801/yAMuZSSGv/CGxT4+UGLi+khTM7b8 8IQNkwHNfYyW9KXBwRVR7NMt6FFIzsCGPS/T3/sVlkZTGeoxekehp13qLJMA6imm sGTRVjw92p9fUFYf17gpSNslxocPrFD3nnW2oX5r8oQHi9VMdRp/0jMhozOAcWuz MkB8a1pxTVuiCUxnxXYwZ/IcERjLhhlGSuJdt2pORDUiJAkaKAgT1YM6Biromh8H rFSx3eFr =qPbw -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 15 11:59:25 2022 Received: (at 54545-done) by debbugs.gnu.org; 15 Apr 2022 15:59:26 +0000 Received: from localhost ([127.0.0.1]:60152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfOM1-000204-Kb for submit@debbugs.gnu.org; Fri, 15 Apr 2022 11:59:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfOLz-0001zp-OQ for 54545-done@debbugs.gnu.org; Fri, 15 Apr 2022 11:59:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfOLt-0001pR-Ea; Fri, 15 Apr 2022 11:59:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=I+4jaenbxPSGeemLKw5NoLO5XOz9xbFcyNV8eICCPhk=; b=iMl7KQKyK7dMwFJpDEQT gOSGx6jzWGS6bxq25lX/TqD7ynC8DqEBv/0nBUe4mrsC6mB8RwtrgvnTzfkin9Dc8oE2cSb83lFRB HdyZyaBFTwSfFn2M7TzfXueDCtTh6JBY2J1cLAlYWDmbRH0kLpuOjdpdb13OtIpb7azaxnLqWdLlM W42DGmRWxaS0uYV5b4DlyMuKIKJ8DOuJfj8bRHDh9CDpMNjX827TzoYmykCk4ryfXkPtf1H9ETJy7 GqqJo0EBbUHQdPyQH5wRuLnT0p/Ry2EsUzd+omrsXRKYzMAgoDLGne1WXN34s1RPnPupL7zwkhjbt 4oXbFE06iA0l9A==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:52588 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfOLs-0000I5-Co; Fri, 15 Apr 2022 11:59:17 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: bug#54545: [Guix Home] =?utf-8?B?4oCYc2hlcGhlcmTigJk=?= started twice? References: <87a6dfbfdl.fsf@inria.fr> <87sfqt2vwd.fsf@trop.in> <871qyctxhk.fsf@gnu.org> <871qy2irc4.fsf@trop.in> <87czhmcg26.fsf@gnu.org> <87y209jye4.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 Germinal an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 15 Apr 2022 17:59:14 +0200 In-Reply-To: <87y209jye4.fsf@trop.in> (Andrew Tropin's message of "Wed, 13 Apr 2022 09:22:27 +0300") Message-ID: <87h76u49t9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54545-done Cc: 54545-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Andrew Tropin skribis: [...] > for example I can't find info about > Fixes line even with search That part is not written (yet!), but you=E2=80=99ve had the opportunity to = look at the Git log I guess. :-) >>> From 56d16b4cd511f6837329b888dade0c6d6da4d89d Mon Sep 17 00:00:00 2001 >>> From: Andrew Tropin >>> Date: Tue, 12 Apr 2022 12:19:50 +0300 >>> Subject: [PATCH 2/3] home: shepherd: Use run-on-change to reload shephe= rd >>> config. >>> >>> * gnu/home/services/shepherd.scm: Add shepherd configuration to >>> XDG_CONFIG_HOME and use it instead of full path to the store. It's nece= ssary >>> to use run-on-change service. [...] >> How does this relate to the bug at hand? >> >> https://issues.guix.gnu.org/54545 >> > > Almost directly. > > During activation if there is no shepherd process we tried to launch a > new one, which was useful back in the days, when I was testing changes > frequently, but can be kinda unexpected for user, if they stopped > Shepherd for some reason, but during activation it started again > automatically. As we discussed earlier: > >>>> Probably we need to do config reload using on-change service and also >>>> not trigger on-change stuff if user isn't logged in. > >>> Makes sense. > > it would be nice to reload configuration only if it's changed. To make > run-on-change work we need to store a config somewhere in > home-environment, to make it possible to compare with previous > generation. files/.config/shepherd/init.scm looks like a good match > here, in addition to on-change functionality it increases explorability. Hmm let=E2=80=99s not invent some new fancy way to update Shepherd services= and instead use what we already have for Guix System. I=E2=80=99m closing this issue; please open a new one if there=E2=80=99s mo= re to discuss! Thanks, Ludo=E2=80=99. From unknown Fri Sep 05 15:37:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 14 May 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator