From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Feb 2018 17:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 30532@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.151906034417803 (code B ref -1); Mon, 19 Feb 2018 17:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Feb 2018 17:12:24 +0000 Received: from localhost ([127.0.0.1]:51522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enoz9-0004cw-J8 for submit@debbugs.gnu.org; Mon, 19 Feb 2018 12:12:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enoz2-0004cb-7d for submit@debbugs.gnu.org; Mon, 19 Feb 2018 12:12:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enoyv-0006Ib-HP for submit@debbugs.gnu.org; Mon, 19 Feb 2018 12:12:02 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59047) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enoyv-0006IS-BP for submit@debbugs.gnu.org; Mon, 19 Feb 2018 12:12:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoyt-0005nZ-CP for guix-patches@gnu.org; Mon, 19 Feb 2018 12:12:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enoyp-0006GF-UK for guix-patches@gnu.org; Mon, 19 Feb 2018 12:11:59 -0500 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]:40615) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enoyp-0006FU-HF for guix-patches@gnu.org; Mon, 19 Feb 2018 12:11:55 -0500 Received: by mail-wr0-x230.google.com with SMTP id o76so10374327wrb.7 for ; Mon, 19 Feb 2018 09:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:user-agent:from:to:subject:date:message-id:mime-version; bh=vnPAXbsuINmhZSUlcknFqN47YyMt3ytZaCEYSQL8Ono=; b=RLMcZrzIifsVFKrEXgBWn+pXPmvFVMmxs5EGsiTZkm/Su5YtL0w2ySP8Q24oUvydew EtZRDIpn2PfwN9j5Y0Ck+iFMQI4nhrJ3TrOlpxvkcYXxOD8+edfbMRIorUcnvJr/AlO2 ymNPL9zFSMsC+7FXycKZxnEU8VuYTcUXf3ObVeqBrP6TJJ1sWHh+SPdkNO6Oyi9IhaCm 2bD4+qAY6C1roTgEUSD1s56C1cbVZZsTzxZXLskDstiYx6SfVvDFDa0/BA+XGHcEzl6n i/x8t/YuljmKJ+PZY/pwizf6gwqLB5s/pROAzlxRg5U02QkfvcVZKcCdAPb0I3tbpWwG Ua7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:user-agent:from:to:subject:date :message-id:mime-version; bh=vnPAXbsuINmhZSUlcknFqN47YyMt3ytZaCEYSQL8Ono=; b=dI5hmgeunzRGEshVEXYl2i7fT0V0GOUFfsEU2m1pI09TfxeAeBpz0MchzZT3Pz/UUD v62fp54Sb1NAVIZJV+xyRXo39gXR7IcHXvPkPR3cY//Y3oeiqzitgxfXeeFMvkvOAU+r 1lLT5RT29aTylGuBfnqLmC9xCJXtXAgUr+R0BodfpdBR1trC3REx94OPjkrlpEnkIOI+ qxzHDa2RL50bLdBrz6zk/45dzpA6eQtrx/GMVmT0BGru2xYZo8JQ7+3Pqt+zF+5j0cxW he1895P1wecNVlYcD3E/2nIcwZk6DkI93Ya4h0QqOWGff67uUzZ8fQCY9T28v1VwKKyf THEA== X-Gm-Message-State: APf1xPC4lT6o1HuFJA2N2XAibN/GbqxuWHtzd74zUwUDDsCuTbeMifLG E0JwTsvlS0LcB9pt/0P3PxabJ17g X-Google-Smtp-Source: AH8x226IU9pzRiw3jkmxxyr7mY0SJgePKt71OypUGzXcWKRmwEVx5oZllWzDaUI/D2z7LFrJfmxqVg== X-Received: by 10.223.197.139 with SMTP id m11mr14981746wrg.0.1519060313974; Mon, 19 Feb 2018 09:11:53 -0800 (PST) Received: from pidgey (host75-122-dynamic.46-79-r.retail.telecomitalia.it. [79.46.122.75]) by smtp.gmail.com with ESMTPSA id s2sm10612624wmf.0.2018.02.19.09.11.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Feb 2018 09:11:53 -0800 (PST) User-agent: mu4e 1.0; emacs 25.3.1 From: Carlo Zancanaro Date: Tue, 20 Feb 2018 04:11:45 +1100 Message-ID: <87sh9wnbu6.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.5 (---) 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.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hey, I use Shepherd to manage my user session, and if I log out then Shepherd leaves all my services running. This patch handles SIGTERM and SIGHUP to prevent that. I hope the guix-patches mailing list was the right place to send it. From what I understand Shepherd development is done through the guix lists, so it seemed to make the most sense to me. [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (carlozancanaro[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; format=flowed Hey, I use Shepherd to manage my user session, and if I log out then Shepherd leaves all my services running. This patch handles SIGTERM and SIGHUP to prevent that. I hope the guix-patches mailing list was the right place to send it. From what I understand Shepherd development is done through the guix lists, so it seemed to make the most sense to me. It's also worth noting that I had to run `gettextize` to get Shepherd to build on current master, but I haven't included those changes in this commit (because I don't know what should be committed and what shouldn't). Carlo --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-Terminate-all-services-upon-SIGTERM-or-SIGHUP.patch Content-Transfer-Encoding: quoted-printable From=20aabb9c6b1b52189d20339531de0b8b96bcace69f Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 20 Feb 2018 02:52:47 +1100 Subject: [PATCH] Terminate all services upon SIGTERM or SIGHUP * modules/shepherd.scm (main): Add SIGTERM and SIGHUP handlers which stop root-service. * tests/sigterm.sh, tests/sighup.sh: New files. * Makefile.am (TESTS): Add tests/sigterm.sh and tests/sighup.sh. =2D-- Makefile.am | 5 ++++- modules/shepherd.scm | 11 ++++++++++ tests/sighup.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++ tests/sigterm.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 tests/sighup.sh create mode 100644 tests/sigterm.sh diff --git a/Makefile.am b/Makefile.am index a30b11d..021857d 100644 =2D-- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ # Makefile.am -- How to build and install the Shepherd. # Copyright =C2=A9 2002, 2003 Wolfgang J=C3=A4hrling # Copyright =C2=A9 2013, 2014, 2015, 2016, 2018 Ludovic Court=C3=A8s +# Copyright =C2=A9 2018 Carlo Zancanaro # # This file is part of the GNU Shepherd. # @@ -188,7 +189,9 @@ TESTS =3D \ tests/no-home.sh \ tests/pid-file.sh \ tests/status-sexp.sh \ =2D tests/sigint.sh + tests/sigint.sh \ + tests/sigterm.sh \ + tests/sighup.sh =20 TEST_EXTENSIONS =3D .sh EXTRA_DIST +=3D $(TESTS) diff --git a/modules/shepherd.scm b/modules/shepherd.scm index 5334657..650ba63 100644 =2D-- a/modules/shepherd.scm +++ b/modules/shepherd.scm @@ -1,6 +1,7 @@ ;; shepherd.scm -- The daemon shepherd. ;; Copyright (C) 2013, 2014, 2016, 2018 Ludovic Court=C3=A8s ;; Copyright (C) 2002, 2003 Wolfgang J=C3=A4hrling +;; Copyright (C) 2018 Carlo Zancanaro ;; ;; This file is part of the GNU Shepherd. ;; @@ -182,6 +183,16 @@ (lambda _ (stop root-service))) =20 + ;; Stop everything when we get SIGTERM. + (sigaction SIGTERM + (lambda _ + (stop root-service))) + + ;; Stop everything when we get SIGHUP. + (sigaction SIGHUP + (lambda _ + (stop root-service))) + ;; Ignore SIGPIPE so that we don't die if a client closes the connecti= on ;; prematurely. (sigaction SIGPIPE SIG_IGN) diff --git a/tests/sighup.sh b/tests/sighup.sh new file mode 100644 index 0000000..e9ca84b =2D-- /dev/null +++ b/tests/sighup.sh @@ -0,0 +1,58 @@ +# GNU Shepherd --- Make sure SIGHUP is correctly handled. +# Copyright =C2=A9 2014, 2016 Ludovic Court=C3=A8s +# Copyright =C2=A9 2018 Carlo Zancanaro +# +# This file is part of the GNU Shepherd. +# +# The GNU Shepherd is free software; you can redistribute it and/or modify= it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# The GNU Shepherd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the GNU Shepherd. If not, see . + +shepherd --version +herd --version + +socket=3D"t-socket-$$" +conf=3D"t-conf-$$" +log=3D"t-log-$$" +stamp=3D"t-stamp-$$" +pid=3D"t-pid-$$" + +herd=3D"herd -s $socket" + +trap "rm -f $socket $conf $stamp $log; + test -f $pid && kill \`cat $pid\` || true; rm -f $pid" EXIT + +cat > "$conf"< + #:provides '(test) + #:start (const #t) + #:stop (lambda _ + (call-with-output-file "$stamp" + (lambda (port) + (display "stopped" port)))) + #:respawn? #f)) + (start 'test) +EOF + +rm -f "$pid" "$stamp" +shepherd -I -s "$socket" -c "$conf" --pid=3D"$pid" --log=3D"$log" & + +while [ ! -f "$pid" ] ; do sleep 0.5 ; done + +# Send SIGTERM to shepherd. +kill -HUP "`cat "$pid"`" +while kill -0 "`cat "$pid"`" ; do sleep 0.5 ; done + +# Make sure the service's 'stop' method was called. +test -f "$stamp" diff --git a/tests/sigterm.sh b/tests/sigterm.sh new file mode 100644 index 0000000..f6b66be =2D-- /dev/null +++ b/tests/sigterm.sh @@ -0,0 +1,58 @@ +# GNU Shepherd --- Make sure SIGTERM is correctly handled. +# Copyright =C2=A9 2014, 2016 Ludovic Court=C3=A8s +# Copyright =C2=A9 2018 Carlo Zancanaro +# +# This file is part of the GNU Shepherd. +# +# The GNU Shepherd is free software; you can redistribute it and/or modify= it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# The GNU Shepherd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the GNU Shepherd. If not, see . + +shepherd --version +herd --version + +socket=3D"t-socket-$$" +conf=3D"t-conf-$$" +log=3D"t-log-$$" +stamp=3D"t-stamp-$$" +pid=3D"t-pid-$$" + +herd=3D"herd -s $socket" + +trap "rm -f $socket $conf $stamp $log; + test -f $pid && kill \`cat $pid\` || true; rm -f $pid" EXIT + +cat > "$conf"< + #:provides '(test) + #:start (const #t) + #:stop (lambda _ + (call-with-output-file "$stamp" + (lambda (port) + (display "stopped" port)))) + #:respawn? #f)) + (start 'test) +EOF + +rm -f "$pid" "$stamp" +shepherd -I -s "$socket" -c "$conf" --pid=3D"$pid" --log=3D"$log" & + +while [ ! -f "$pid" ] ; do sleep 0.5 ; done + +# Send SIGTERM to shepherd. +kill -TERM "`cat "$pid"`" +while kill -0 "`cat "$pid"`" ; do sleep 0.5 ; done + +# Make sure the service's 'stop' method was called. +test -f "$stamp" =2D-=20 2.16.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlqLBVEACgkQqdyPv9aw IbxxpA/+O5zb2L/rpSnrGK7IMNAYeo2cOoA/TjKDu574BUfxqlpIkuSjRwvPFmVE 1pQNtpeZx0uWAEbFYtjtI8xsQlilQasK4L6AUYGpEQzGZetLPQzTyQaqH6rlzASH yr9Fjv6/qpbyTGGkhTfGMz+witLCefjg+L30m0jViIXxjBERIFW6OjEjgofY35OL wJBpB8NXcVbDem/h9dpdMzVTse5WSvmDHNQGTYwforYO45llmiLb8uItll6Ma8E6 oAG+GYDJPbDyXRMSMWLuQ1TPlQ42/s/SV6ZKjzax6xQ3eUIrUi53hZFex4VqlXqj EAdu8sNPb6BBVlew4XGrYFcmtwvj3s7y1nCTN2IuNFXb87PKjoOdnJfDdlyQR4+n EVul+qowBFqA5+AyVcCh/BFUDcrVvVTZrZUJBEBQjSgglNlQC8Wun39ulhIeNKb5 q8qfFedmT5H5emlij6ruSaFSU009Q3FSCDH4fg5eezjcncXDXIoZ/XLR5gtdEewa s9zHnqamTAIAvtVtcEmqjtg7iru3Qovknf0+VXrAoqE1Bn9Uv01HEaQv0uvGks4P 2aW1InSSu7qd1N60+udQdWcxlYzTpqJsn0dIPW0dENR2z3JnH5bIMXF8j270NGpe Zvy0ndXu0W3I/jRW+TAh0u3oDwOB+vbnsEylh9uEwC8dp3VUY9I= =LnSF -----END PGP SIGNATURE----- --==-=-=-- From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Feb 2018 09:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Carlo Zancanaro Cc: 30532@debbugs.gnu.org Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.15197247668175 (code B ref 30532); Tue, 27 Feb 2018 09:47:01 +0000 Received: (at 30532) by debbugs.gnu.org; 27 Feb 2018 09:46:06 +0000 Received: from localhost ([127.0.0.1]:34334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqbpj-00024G-Bj for submit@debbugs.gnu.org; Tue, 27 Feb 2018 04:46:06 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:50870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqbph-00021R-40 for 30532@debbugs.gnu.org; Tue, 27 Feb 2018 04:46:01 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 7EFB411FD3; Tue, 27 Feb 2018 10:46:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p8QUyxsmfHKc; Tue, 27 Feb 2018 10:45:58 +0100 (CET) Received: from ribbon (unknown [193.50.110.216]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 97AB51069E; Tue, 27 Feb 2018 10:45:58 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87sh9wnbu6.fsf@zancanaro.id.au> Date: Tue, 27 Feb 2018 10:45:58 +0100 In-Reply-To: <87sh9wnbu6.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Tue, 20 Feb 2018 04:11:45 +1100") Message-ID: <87lgfe4vft.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) 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.0 (+) Hi Carlo, Carlo Zancanaro skribis: > I use Shepherd to manage my user session, and if I log out then > Shepherd leaves all my services running. This patch handles SIGTERM > and SIGHUP to prevent that. Good catch! > I hope the guix-patches mailing list was the right place to send > it. From what I understand Shepherd development is done through the > guix lists, so it seemed to make the most sense to me. Yes, that=E2=80=99s perfect. > It's also worth noting that I had to run `gettextize` to get Shepherd > to build on current master, but I haven't included those changes in > this commit (because I don't know what should be committed and what > shouldn't). Right, I=E2=80=99m not sure what=E2=80=99s wrong with that. I=E2=80=99ve c= ommitted the same files under po/ as I did for Guix: --8<---------------cut here---------------start------------->8--- $ git ls-files po/ po/Makevars po/POTFILES.in --8<---------------cut here---------------end--------------->8--- > From aabb9c6b1b52189d20339531de0b8b96bcace69f Mon Sep 17 00:00:00 2001 > From: Carlo Zancanaro > Date: Tue, 20 Feb 2018 02:52:47 +1100 > Subject: [PATCH] Terminate all services upon SIGTERM or SIGHUP > > * modules/shepherd.scm (main): Add SIGTERM and SIGHUP handlers which stop > root-service. > * tests/sigterm.sh, tests/sighup.sh: New files. > * Makefile.am (TESTS): Add tests/sigterm.sh and tests/sighup.sh. Excellent! I have one request: since the three tests differ only in the signal name, could you make it a single test file and have a loop like: for signal in SIGTERM SIGHUP SIGINT TIA, Ludo=E2=80=99. From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Feb 2018 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Carlo Zancanaro , 30532@debbugs.gnu.org Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.15197521696684 (code B ref 30532); Tue, 27 Feb 2018 17:23:01 +0000 Received: (at 30532) by debbugs.gnu.org; 27 Feb 2018 17:22:49 +0000 Received: from localhost ([127.0.0.1]:35871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqixk-0001jj-3M for submit@debbugs.gnu.org; Tue, 27 Feb 2018 12:22:49 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:47687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqixh-0001jc-Gs for 30532@debbugs.gnu.org; Tue, 27 Feb 2018 12:22:46 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0BA032205B; Tue, 27 Feb 2018 12:22:45 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Tue, 27 Feb 2018 12:22:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=l70dHyZIb5JoC9a66RHtsS6KSTzpGRXazKumnhUPGms=; b=szfJu kQ1k4f2EbSJRylSEl8/qZjspVv14nUMREtvCt3nityN/q9zVyRu2e1TBDUTPzjc3 Lf3YCtRFteLgNNupwGvJPBICWP3EkWZqcmLKzpYfLoKRFfEyQ6ZW/YRQSx7TY10Q tJGrwdPykcqbYki3tVuH5Beq55/IbncJVnfTsQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=l70dHyZIb5JoC9a66RHtsS6KSTzpG RXazKumnhUPGms=; b=idLlBCmEY2POsfO5Zt7hJM8W6S67A2iQ2aXvYtjP+Jq9W 3kKd1Tr9hMn3NBAwzhNFRuYq8eYxPDUGQ+lVw9lq3ug8fe16Lf8TXzTOoZiZQnhS vPpEFrlQP7Cnd7fr9/dXpd096lHrh68ThaduQRhMzdutR8qBhKCw7/tP75yugX7D V8426woLhNQzQZPpLkBjFie4I8QrcxbCDwnXUw//YN0wvyGasqv37vBZ9wRf1qcL 08i2SP23H4p5rAlmnEbGntnOxIt/rv29RrT0hDQzX2Yq7dYDPj2pQO1yeHncbCwk ffksH1Acl7toBmSXZJ6qd2s2LyIM18vHN3aisjAKQ== X-ME-Sender: Received: from localhost (c-76-124-202-137.hsd1.pa.comcast.net [76.124.202.137]) by mail.messagingengine.com (Postfix) with ESMTPA id B6E5A7E141; Tue, 27 Feb 2018 12:22:44 -0500 (EST) Date: Tue, 27 Feb 2018 12:22:43 -0500 From: Leo Famulari Message-ID: <20180227172243.GA19017@jasmine.lan> References: <87sh9wnbu6.fsf@zancanaro.id.au> <87lgfe4vft.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <87lgfe4vft.fsf@gnu.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-Spam-Score: -0.7 (/) 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: -0.7 (/) --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 27, 2018 at 10:45:58AM +0100, Ludovic Court=E8s wrote: > Carlo Zancanaro skribis: >=20 > > I use Shepherd to manage my user session, and if I log out then > > Shepherd leaves all my services running. This patch handles SIGTERM > > and SIGHUP to prevent that. >=20 > Good catch! "This update broke my workflow" Joking aside, I think this change is correct, but it would be great to be able to have long-running unprivileged processes, as on systemd. There, the administrator can use `loginctl enable-linger $USER`. We'd want to do it in the system configuration. From loginctl(1): ------ Enable/disable user lingering for one or more users. If enabled for a specific user, a user manager is spawned for the user at boot and kept around after logouts. This allows users who are not logged in to run long-running services. Takes one or more user names or numeric UIDs as argument. If no argument is specified, enables/disables lingering for the user of the session of the caller. ------ --4Ckj6UjgE2iN1+kY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlqVk94ACgkQJkb6MLrK fwgPzg/8Dnnizd1nnhw/v5ok6A70JMYE2zCfuKesIkYGO6q3D66Tf+jzY1fEmSBF sxFiDxBL6RX6Nr8Knq2O8y6sRh0heGuHqGCTJi+QsqbWMSGZn4kromLdaCq578co +yv5E5c2AuudrWJilu1dKZRzSP0nnZGZjjCIK6BCGcLowl0c41vx3mXT4txIHIrg IOwI29aWFnHl2+mZ3Mwnylyoc1/CbHbteEoHt0/gMdxi2XrX3z10yhgX3sfODPMG f2zEQpkFFqcDxaVBaYXLbNTxexY2tSGm9AWj35qzgsz/baDvcCPuL9iHWUzPRz+7 ZdTTCR1JRXW563iFrgLbqOv3d+cwBk5QrDT6u26hj2ui7V/hni5qVNyGG/TmDqfM 8ySKmWxecXkrhMzGo72/6edBxprdEUSf5y/mh+anp051kenwn5PbXQQEzugyJvMp ubTf27LsuYV/wgkkdbQTliXcIjwklKAEBBokh+S8x9nxxaJKIdrC4cfWWPMLR/Nz HHj20qqNcCv58dWsjb070MbFsSzPHSTCgUp9/fIh2zfZ5M3UreZ0/9pn6A/lyQp/ aQS4YyvqCfy/C9efir9EV3B3Wiu/aLZq/e/jhW4nycZsWb0LjUEuSeUVHEmerS41 /j5OJcx/PECVIIiXBXZDJpsCjk5SFwQVfvfPMsl5HXdxjN0yms8= =76Wm -----END PGP SIGNATURE----- --4Ckj6UjgE2iN1+kY-- From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Feb 2018 21:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Leo Famulari Cc: Carlo Zancanaro , 30532@debbugs.gnu.org Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.15197654401641 (code B ref 30532); Tue, 27 Feb 2018 21:04:01 +0000 Received: (at 30532) by debbugs.gnu.org; 27 Feb 2018 21:04:00 +0000 Received: from localhost ([127.0.0.1]:35996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmPo-0000QO-2z for submit@debbugs.gnu.org; Tue, 27 Feb 2018 16:04:00 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:54936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmPl-0000QG-MC for 30532@debbugs.gnu.org; Tue, 27 Feb 2018 16:03:58 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 20CB911652; Tue, 27 Feb 2018 22:03:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RIml3WSAKhWL; Tue, 27 Feb 2018 22:03:55 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id E8933109E7; Tue, 27 Feb 2018 22:03:54 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87sh9wnbu6.fsf@zancanaro.id.au> <87lgfe4vft.fsf@gnu.org> <20180227172243.GA19017@jasmine.lan> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?UTF-8?Q?Vent=C3=B4se?= an 226 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, 27 Feb 2018 22:03:54 +0100 In-Reply-To: <20180227172243.GA19017@jasmine.lan> (Leo Famulari's message of "Tue, 27 Feb 2018 12:22:43 -0500") Message-ID: <877eqyxhz9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) 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.0 (+) Leo Famulari skribis: > On Tue, Feb 27, 2018 at 10:45:58AM +0100, Ludovic Court=C3=A8s wrote: >> Carlo Zancanaro skribis: >>=20 >> > I use Shepherd to manage my user session, and if I log out then >> > Shepherd leaves all my services running. This patch handles SIGTERM >> > and SIGHUP to prevent that. >>=20 >> Good catch! > > "This update broke my workflow" > > Joking aside, I think this change is correct, but it would be great to > be able to have long-running unprivileged processes, as on systemd. > There, the administrator can use `loginctl enable-linger $USER`. We'd > want to do it in the system configuration. From loginctl(1): > > ------ > Enable/disable user lingering for one or more users. If enabled for a > specific user, a user manager is spawned for the user at boot and kept > around after logouts. This allows users who are not logged in to run > long-running services. Takes one or more user names or numeric UIDs as > argument. If no argument is specified, enables/disables lingering for > the user of the session of the caller. > ------ Indeed, that sounds useful. I suppose on GuixSD PID=C2=A01 could start subprocesses (with an initially empty config file?) for selected users at boot time. Would that make sense? Ludo=E2=80=99. From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Feb 2018 21:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Leo Famulari Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 30532@debbugs.gnu.org Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.15197663892961 (code B ref 30532); Tue, 27 Feb 2018 21:20:02 +0000 Received: (at 30532) by debbugs.gnu.org; 27 Feb 2018 21:19:49 +0000 Received: from localhost ([127.0.0.1]:36006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmf6-0000lg-Vm for submit@debbugs.gnu.org; Tue, 27 Feb 2018 16:19:49 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:33153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmf5-0000lP-5B for 30532@debbugs.gnu.org; Tue, 27 Feb 2018 16:19:47 -0500 Received: by mail-wm0-f50.google.com with SMTP id s206so23457831wme.0 for <30532@debbugs.gnu.org>; Tue, 27 Feb 2018 13:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=wEN5RbxcqXxcawkLXTDqbk+sli3hEe4GBjU5gotUj6A=; b=OiD8Kt6nVC6mAccm62H4AgxZPB3NVvAYm24yBkXjR73SQ7uiHCxVPS8kWLHz273OR3 KA9t3cTW9Rna2VpUiPiLDkm8KBOCUc+KhQetXMN9/y03rrbXa/RfwU7CmlNvFxNf8Z86 5BT8xRmFavPciWgI7vXmCsAoiia1eXcDpskKuY3EXrtwKDB+wXSkh5pwxpKxxGmdL/ET 2QKTMX/P1DU0Ro0pYsp4hrIDO1Te6vOOJ4AmFK291GLFVlqEBGuwvqXEY74DSvOQnTl/ vmL8qczpUS2Q5eeaklvtn9Z6CBybb9BAjNUreEW2yXul+tbujf7MVdR60yU4F3gWoIi1 /RfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=wEN5RbxcqXxcawkLXTDqbk+sli3hEe4GBjU5gotUj6A=; b=sf4bYV6ItrpHIa4v1jho57DNAuNJBkspi8SjmN4GEaPYk7dUBMqUgRKd5Ijzz1SQkQ ECKPFcvMTuc0uvDMDB3tDomZdS5eAHrKJEtOTteELd688/JVhUzPqNxw13k5ctrFOXAu AXbQN5LMqtvsEFpq4sfUSAk3a1UwyqmfryU9A0JfKsERDVGlBoSuPpulg7Rzd5JYoiSc 0iM1gmE/m675Czy5YKtRnIUZkYWV9/as2jQWjl2SR3LPMvXeLuu8xGzXo4dIq/GO9yCC fpya86jpEfclN0/OnP/oTBJpjkeNJg2zaZj5xzgZukMYZF2ST6OQZ5kIkgE7yyuz0RZE DMcQ== X-Gm-Message-State: APf1xPA5Fo2XhDuN1NJWichiPl+VAZ6mplPCmL1k3W1kiRn6GGoiy+I+ QZqO5JfIyRklg/kOS3hnOnhRe1sF X-Google-Smtp-Source: AG47ELuecJkhv18OgD/JwFOOJup/rJPIvHwEsLZX6PcVxWfLzUXL0jM3sJXBrJHhxrXxirBvVjtRNA== X-Received: by 10.28.114.8 with SMTP id n8mr11678772wmc.30.1519766381018; Tue, 27 Feb 2018 13:19:41 -0800 (PST) Received: from pidgey ([2a00:23c0:4e80:d501:8f8:e119:5f6d:87e3]) by smtp.gmail.com with ESMTPSA id g127sm478115wmf.46.2018.02.27.13.19.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 13:19:40 -0800 (PST) References: <87sh9wnbu6.fsf@zancanaro.id.au> <87lgfe4vft.fsf@gnu.org> <20180227172243.GA19017@jasmine.lan> User-agent: mu4e 1.0; emacs 25.3.1 From: Carlo Zancanaro In-reply-to: <20180227172243.GA19017@jasmine.lan> Date: Wed, 28 Feb 2018 08:19:15 +1100 Message-ID: <87bmga9lm4.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.5 (/) 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: 0.5 (/) --=-=-= Content-Type: text/plain; format=flowed On Tue, Feb 27 2018, Leo Famulari wrote: > "This update broke my workflow" How seriously should I take this? I understand that it's a joke, but are you currently relying on this behaviour of shepherd? I could add an action to the root service to tell shepherd to leave processes behind when it is killed, if we wanted to expose that behaviour. Carlo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlqVy1MACgkQqdyPv9aw Ibyb1Q//UuxKXFmgDb3d3rCQBxJkZ+8gzAK7/YkxVcAeZV3s/t+n56rKqvo7qTkt oQFJ24qe0eekVZ8/c0925bb0dnl04GiETVGo8kLyXzEh8Pn5iCPrNmpDYXVSgPtA 5oVhBXs8IZLxksRwej2lOye9jARZJeSrnbnm94IMkl4H2s0yLxBsrI5AiYc8Mt5g +p1epIQMhgH5/LSdCY6kCFcJObazjTiZti+nrfap63C0gFOVykE+gRMMajhKgppY OCTVke7PaF6FI1aYTrScb53hxlpgL1Xn3VPDlnPknz8HCEmUzl2D8r9XS2C72Mfp Way9iNRO4TER7O+V6VAkbkmsPoypSk/kk4PMjGGDntNdH/wKNDydRYx5qkomaV0B aFrnqk6fceQAq8TXd3pllguhg6j/odBCcDUXVo/gb/5spKsXF25A0g81Z3a/y61i mZgG/u67W1nruc/9ijnaEm0OOBo2HqxXAcDLSRbwJyA/sPoqTI6KHoZFKyHdoaDO VtNecTkKxCZHRCt+ffWa09tiyk2lCA49CMo9Mmom4nJ8hj5dTQkSxMewnSbecO1p qg01Y/OMuID7rT8r+RD1rFM6KMTVd7TrXVXGJXo7nLwk4zyl4sPOHgh76QsBsi+D +M6ghyd/H0CHx6vG1VKSEzVA/fRnqZ4jR430ZYUWP7s3L2nlk0s= =ZRdp -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Feb 2018 21:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30532@debbugs.gnu.org Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.15197670224034 (code B ref 30532); Tue, 27 Feb 2018 21:31:01 +0000 Received: (at 30532) by debbugs.gnu.org; 27 Feb 2018 21:30:22 +0000 Received: from localhost ([127.0.0.1]:36032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmpE-00012u-54 for submit@debbugs.gnu.org; Tue, 27 Feb 2018 16:30:22 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:40797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmp5-00011j-PS for 30532@debbugs.gnu.org; Tue, 27 Feb 2018 16:30:14 -0500 Received: by mail-wm0-f50.google.com with SMTP id t6so1245708wmt.5 for <30532@debbugs.gnu.org>; Tue, 27 Feb 2018 13:30:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=GTg3E9TxaZ/wavv6jjD6gf2s1zpGOIRQyrBj4xRMRzU=; b=FKfVKZai5ZT1dMM1BVKJLt0uciaI/YpTB3ueLnNyEdR1yq2EdWliUXmue7VkoFBC5H /781IIg4S8jMfRczgSixPqXwlDPjNBRvQE2vuxl59mAfqGlxzOrfnJy4rwYD6HYvG3SE v5+6OyupKsVTff1BgpIamKaIsG3zWu28Py/7Mp+U3egLPSCnA10IlRY6azZIDahyifXn tCvULAPyRkPSwRKYlioRH7f8Nx+FOuAkdqAjXZ4s3MSSI7n9xqSr84pzjYWd/FxGTjLK 1XpiwJNsNPgZmEb5WABrwYR7r9Fkx+YIUIRL90vl4K7Krzchvc6v7HRP7rP/sUjp8a16 GOkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=GTg3E9TxaZ/wavv6jjD6gf2s1zpGOIRQyrBj4xRMRzU=; b=KlQiBVk5QNnubuC//EkTTjzHMjr/JKKgZz1LEJYnW9x//UppZ04IY4v8oxOD0n2y7x 87uSZKOAkqICqy/OtnPYcyqu/O8HrEadxyKQIviIY8tLvt7/olTzZsdTNWep0fEFPRzK H3S+9iFEgu+4c6N2N+QXKrEva7q/XdCnsS137sY2keL8KuCcGxKOYXby1bPbz6H/DyiZ ZOGysJCfp5iSZsfCxmUX8rP0ffoa+J9hevYvH/04IUuWVPKbsv9u1UPhaVNX+LrNVhvQ jWIxPxraNVr1Gg1kLPX//mrNpwlumIS6CulcQxnG0m/f+bcd9Bri0yy5Jwue6lHYwG6u 21UQ== X-Gm-Message-State: APf1xPD//CkUX0KRzvOscG2sqbjFjgLceztsVAgutMWu1GpxqvmNx36E PtUvvBmAlrq4l0b6uJWO73KGlZSk X-Google-Smtp-Source: AG47ELu9RJ6KF0q10V1ecL+Qn1DUKpoF56qzR3JWEzmgEKDu7vHGH4re4GdOyyygamhLxku7kkOTRQ== X-Received: by 10.28.216.82 with SMTP id p79mr13565138wmg.8.1519767001791; Tue, 27 Feb 2018 13:30:01 -0800 (PST) Received: from pidgey ([2a00:23c0:4e80:d501:8f8:e119:5f6d:87e3]) by smtp.gmail.com with ESMTPSA id u79sm555055wma.10.2018.02.27.13.29.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 13:30:01 -0800 (PST) References: <87sh9wnbu6.fsf@zancanaro.id.au> <87lgfe4vft.fsf@gnu.org> User-agent: mu4e 1.0; emacs 25.3.1 From: Carlo Zancanaro In-reply-to: <87lgfe4vft.fsf@gnu.org> Date: Wed, 28 Feb 2018 08:29:50 +1100 Message-ID: <87a7vu9l4h.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.5 (/) 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: 0.5 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hey Ludo, On Tue, Feb 27 2018, Ludovic Court=C3=A8s wrote: >> It's also worth noting that I had to run `gettextize` to get=20 >> Shepherd >> to build on current master, but I haven't included those=20 >> changes in >> this commit (because I don't know what should be committed and=20 >> what >> shouldn't). > > Right, I=E2=80=99m not sure what=E2=80=99s wrong with that. I=E2=80=99ve= committed the=20 > same > files under po/ as I did for Guix: > > --8<---------------cut=20 > here---------------start------------->8--- > $ git ls-files po/ > po/Makevars > po/POTFILES.in > --8<---------------cut=20 > here---------------end--------------->8--- If you clone shepherd from the repository, can you build it?=20 Comparing the guix repository to the shepherd one I can't easily=20 work out what needs to be done for this, but hopefully you can at=20 least reproduce my problem. > I have one request: since the three tests differ only in the=20 > signal > name, could you make it a single test file and have a loop like: > > for signal in SIGTERM SIGHUP SIGINT Updated patch is attached. Carlo --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-Terminate-all-services-upon-SIGTERM-or-SIGHUP.patch Content-Transfer-Encoding: quoted-printable From=20717456edd92ba753daf5dd40e2f8d51eab3e7a73 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 20 Feb 2018 02:52:47 +1100 Subject: [PATCH] Terminate all services upon SIGTERM or SIGHUP * modules/shepherd.scm (main): Add SIGTERM and SIGHUP handlers which stop root-service. * tests/sigint.sh: Rename to... * tests/signals.sh: ... this, and add tests for SIGTERM and SIGUP. =2D-- Makefile.am | 3 ++- modules/shepherd.scm | 11 +++++++++++ tests/{sigint.sh =3D> signals.sh} | 23 ++++++++++++++--------- 3 files changed, 27 insertions(+), 10 deletions(-) rename tests/{sigint.sh =3D> signals.sh} (72%) diff --git a/Makefile.am b/Makefile.am index a30b11d..1c394e1 100644 =2D-- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ # Makefile.am -- How to build and install the Shepherd. # Copyright =C2=A9 2002, 2003 Wolfgang J=C3=A4hrling # Copyright =C2=A9 2013, 2014, 2015, 2016, 2018 Ludovic Court=C3=A8s +# Copyright =C2=A9 2018 Carlo Zancanaro # # This file is part of the GNU Shepherd. # @@ -188,7 +189,7 @@ TESTS =3D \ tests/no-home.sh \ tests/pid-file.sh \ tests/status-sexp.sh \ =2D tests/sigint.sh + tests/signals.sh =20 TEST_EXTENSIONS =3D .sh EXTRA_DIST +=3D $(TESTS) diff --git a/modules/shepherd.scm b/modules/shepherd.scm index 5334657..650ba63 100644 =2D-- a/modules/shepherd.scm +++ b/modules/shepherd.scm @@ -1,6 +1,7 @@ ;; shepherd.scm -- The daemon shepherd. ;; Copyright (C) 2013, 2014, 2016, 2018 Ludovic Court=C3=A8s ;; Copyright (C) 2002, 2003 Wolfgang J=C3=A4hrling +;; Copyright (C) 2018 Carlo Zancanaro ;; ;; This file is part of the GNU Shepherd. ;; @@ -182,6 +183,16 @@ (lambda _ (stop root-service))) =20 + ;; Stop everything when we get SIGTERM. + (sigaction SIGTERM + (lambda _ + (stop root-service))) + + ;; Stop everything when we get SIGHUP. + (sigaction SIGHUP + (lambda _ + (stop root-service))) + ;; Ignore SIGPIPE so that we don't die if a client closes the connecti= on ;; prematurely. (sigaction SIGPIPE SIG_IGN) diff --git a/tests/sigint.sh b/tests/signals.sh similarity index 72% rename from tests/sigint.sh rename to tests/signals.sh index 7354848..acb254a 100644 =2D-- a/tests/sigint.sh +++ b/tests/signals.sh @@ -1,5 +1,6 @@ =2D# GNU Shepherd --- Make sure SIGINT is correctly handled. +# GNU Shepherd --- Make sure SIGINT, SIGTERM, and SIGHUP are correctly han= dled. # Copyright =C2=A9 2014, 2016 Ludovic Court=C3=A8s +# Copyright =C2=A9 2018 Carlo Zancanaro # # This file is part of the GNU Shepherd. # @@ -44,14 +45,18 @@ cat > "$conf"< Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Feb 2018 21:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Carlo Zancanaro Cc: 30532@debbugs.gnu.org, Leo Famulari Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.15197670234048 (code B ref 30532); Tue, 27 Feb 2018 21:31:02 +0000 Received: (at 30532) by debbugs.gnu.org; 27 Feb 2018 21:30:23 +0000 Received: from localhost ([127.0.0.1]:36035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmpL-00013E-9w for submit@debbugs.gnu.org; Tue, 27 Feb 2018 16:30:23 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmpJ-00012z-Kp for 30532@debbugs.gnu.org; Tue, 27 Feb 2018 16:30:22 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B6F7A11FE5; Tue, 27 Feb 2018 22:30:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1pS2aWBzsNgV; Tue, 27 Feb 2018 22:30:20 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9FAFE11652; Tue, 27 Feb 2018 22:30:19 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87sh9wnbu6.fsf@zancanaro.id.au> <87lgfe4vft.fsf@gnu.org> <20180227172243.GA19017@jasmine.lan> <87bmga9lm4.fsf@zancanaro.id.au> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?UTF-8?Q?Vent=C3=B4se?= an 226 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, 27 Feb 2018 22:30:18 +0100 In-Reply-To: <87bmga9lm4.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Wed, 28 Feb 2018 08:19:15 +1100") Message-ID: <87efl6w26t.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) 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.0 (+) Carlo Zancanaro skribis: > On Tue, Feb 27 2018, Leo Famulari wrote: >> "This update broke my workflow" > > How seriously should I take this? I understand that it's a joke, but > are you currently relying on this behaviour of shepherd? I could add > an action to the root service to tell shepherd to leave processes > behind when it is killed, if we wanted to expose that behaviour. Maybe with an option: --signal-handling-style=3Dleo's? :-) Ludo=E2=80=99. From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 01 Mar 2018 09:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Carlo Zancanaro Cc: 30532@debbugs.gnu.org Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.151989815428361 (code B ref 30532); Thu, 01 Mar 2018 09:56:01 +0000 Received: (at 30532) by debbugs.gnu.org; 1 Mar 2018 09:55:54 +0000 Received: from localhost ([127.0.0.1]:38227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erKwL-0007NN-Ql for submit@debbugs.gnu.org; Thu, 01 Mar 2018 04:55:53 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:36580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erKwK-0007NF-5T for 30532@debbugs.gnu.org; Thu, 01 Mar 2018 04:55:53 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id F201C1023B; Thu, 1 Mar 2018 10:55:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VNG06JuFHGpj; Thu, 1 Mar 2018 10:55:49 +0100 (CET) Received: from ribbon (unknown [193.50.110.134]) by hera.aquilenet.fr (Postfix) with ESMTPSA id B3113E93B; Thu, 1 Mar 2018 10:55:49 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87sh9wnbu6.fsf@zancanaro.id.au> <87lgfe4vft.fsf@gnu.org> <87a7vu9l4h.fsf@zancanaro.id.au> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 =?UTF-8?Q?Vent=C3=B4se?= an 226 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, 01 Mar 2018 10:55:49 +0100 In-Reply-To: <87a7vu9l4h.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Wed, 28 Feb 2018 08:29:50 +1100") Message-ID: <878tbc86hm.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) 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.0 (+) Carlo Zancanaro skribis: > From 717456edd92ba753daf5dd40e2f8d51eab3e7a73 Mon Sep 17 00:00:00 2001 > From: Carlo Zancanaro > Date: Tue, 20 Feb 2018 02:52:47 +1100 > Subject: [PATCH] Terminate all services upon SIGTERM or SIGHUP > > * modules/shepherd.scm (main): Add SIGTERM and SIGHUP handlers which stop > root-service. > * tests/sigint.sh: Rename to... > * tests/signals.sh: ... this, and add tests for SIGTERM and SIGUP. Perfect. Applied, thanks! Ludo=E2=80=99. From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Mar 2018 00:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Carlo Zancanaro Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 30532@debbugs.gnu.org Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.151995061623364 (code B ref 30532); Fri, 02 Mar 2018 00:31:02 +0000 Received: (at 30532) by debbugs.gnu.org; 2 Mar 2018 00:30:16 +0000 Received: from localhost ([127.0.0.1]:39878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erYaU-00064k-L5 for submit@debbugs.gnu.org; Thu, 01 Mar 2018 19:30:16 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:47945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erYaS-00064a-1E for 30532@debbugs.gnu.org; Thu, 01 Mar 2018 19:30:12 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8392120DE4; Thu, 1 Mar 2018 19:30:11 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 01 Mar 2018 19:30:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=RiEpvp63R1oqCcx9XrlHvjZIttekZsWrlwvTKrKrpRI=; b=wrQDW Qtmg0H4PEYa+0XQtKd2Tq+073WwrmGCoWBgfvHBwGcWGqDzhojs0NFk4XrfZIYXw 3XJR0AgpiNCk4Q6v3+d5c3/cczpYfh8DYJH9KDtGAAnvpBKbqZr5NhNxDSdj36im A0rGYRDZYMabBMGCnHcFBPdwNv+OLy6b8y34Ck= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=RiEpvp63R1oqCcx9XrlHvjZIttekZ sWrlwvTKrKrpRI=; b=AZ8+epg8R4XOPV3ViTBJWOmFQtoF/8uLSGAsvkGiuFDyp gk5z7dl//BKAdxVwHebMvFYesb26cFYr4keehR+HemeG4Z1Mwu9mfqjYRRJ7DJh5 TCy3giMCxbMNYatCEO6vzgTB6ASlwH6nJeKPZhvfCFp0EtX8o/ABWnokTBWv3t6u EX5LHOWfFA3ggi5qnPE6LehHQWYyamRoMLToeMjxaYC2yqsOQIc8MYdwbfSdnqyC kirr8jgKmrVHAGfGzEAzPeH4dnLgh2IJ0pX5WQP8mOMKRR/IUd3b+KJ1nahHSLjM Ke+rs2p+Sgpre1AfZuYpKwt2NflxaXLNMXz0Bjo8Q== X-ME-Sender: Received: from localhost (c-76-124-202-137.hsd1.pa.comcast.net [76.124.202.137]) by mail.messagingengine.com (Postfix) with ESMTPA id 3869D7E4AA; Thu, 1 Mar 2018 19:30:11 -0500 (EST) Date: Thu, 1 Mar 2018 19:30:09 -0500 From: Leo Famulari Message-ID: <20180302003009.GA8305@jasmine.lan> References: <87sh9wnbu6.fsf@zancanaro.id.au> <87lgfe4vft.fsf@gnu.org> <20180227172243.GA19017@jasmine.lan> <87bmga9lm4.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: <87bmga9lm4.fsf@zancanaro.id.au> User-Agent: Mutt/1.9.3 (2018-01-21) X-Spam-Score: -0.7 (/) 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: -0.7 (/) --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 28, 2018 at 08:19:15AM +1100, Carlo Zancanaro wrote: > On Tue, Feb 27 2018, Leo Famulari wrote: > > "This update broke my workflow" >=20 > How seriously should I take this? I understand that it's a joke, but are = you > currently relying on this behaviour of shepherd? I could add an action to > the root service to tell shepherd to leave processes behind when it is > killed, if we wanted to expose that behaviour. I am using it, but it's not critical. I can stay logged in with tmux or something after this change. I'd rather we address this use case as described previously, with something like 'enable-linger'. --gBBFr7Ir9EOA20Yy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlqYmw0ACgkQJkb6MLrK fwh9FxAAyDFhfmmNJmruBXG94bUN7IKW3BGX1JaoDnsZmEbNuI3XasGdZZi3XK5x Gcq/+gvhrtxEEwIjtMva4igz85ubsdP7VtW04TOeOGwsQL0YgkB5RpCG1EH3sKcG 1cE+sZDYG5E6pa+3RlBz2uVjnjewwmA/AwVLi5nm64lM9Spo4oBK/2ZGpyu2QcHt uxvRakxinF88/Lbx1Pun8nZp/kEeFqzTTbQkY++6MPTRV4GoBN8IBRg4eqWmO2a+ 7ulxePiL8cR5sAzJMm+NGqZfKHI3gH9/gqEN/e5BLoC+asZHDdJlmx7jGKQhIwX8 lAUZJtfI3xah4k99J0e085s3xDC5+xQTbTBGmoGHOqE/Ly85equiJIZu8SoX4Q86 +JCRPuK7p8PKDmnImQbYUh6zn81n+1ywp3rpTvXKyzlw7DXiJV13UzSZH62X147x ukEynuex2omq93jRhdS+b7IUCL+vSKE/AlJ33wrBNgFaks3E6W5soPs+gTKSNQdm eLfHR0/+qz+/UFym/tCvoyojDu29mtDq4yIN3jBHBcVtCY5KSCdKJsfxnIoCm/he v69S3ab2gB8aUdXqa9NQ0J9uASUnujDBbVi+gYUiPr3TkYd6VGzxq3EPbkJL9mbW IYwqISV4ImeSOCMchVW1cuipbuwycHuYSk/bnbRDYmrFmljLhGo= =3y7h -----END PGP SIGNATURE----- --gBBFr7Ir9EOA20Yy-- From unknown Sat Jun 21 10:32:56 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30532] [PATCH] Shepherd: Terminate all services upon SIGTERM or SIGHUP Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Mar 2018 07:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Leo Famulari Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 30532@debbugs.gnu.org Received: via spool by 30532-submit@debbugs.gnu.org id=B30532.151997554617661 (code B ref 30532); Fri, 02 Mar 2018 07:26:02 +0000 Received: (at 30532) by debbugs.gnu.org; 2 Mar 2018 07:25:46 +0000 Received: from localhost ([127.0.0.1]:40036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erf4c-0004an-4m for submit@debbugs.gnu.org; Fri, 02 Mar 2018 02:25:46 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:41592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erf4a-0004aa-EL for 30532@debbugs.gnu.org; Fri, 02 Mar 2018 02:25:44 -0500 Received: by mail-pf0-f170.google.com with SMTP id f80so3632429pfa.8 for <30532@debbugs.gnu.org>; Thu, 01 Mar 2018 23:25:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=PKdYh0JNG/Z8dFpTd9BR7vUqWdOyjhLmcvTtMWmHSF0=; b=XpXlAypmqO62yWc43QU9ktASRLmF9+EmbOgduvglcMJeTmQwxgpgIz2nPT1J8T/ght 6A0p+5Pc3kKJ/HdIVpNkAZoVdrm6/Dd4QWKzdYk7r+z7+Z1icXn/QUBv+7jBGBqElRrE lFmvUB4QOotKbCzAdgjHVYBeZthFij5BAy0uA55DshlUmCw5YSif3QXkQ2wjqfT73h0d 5Jn7lEDDb2X1UKnLXMUBLwCTN0pnMo8T6rCdZOpVz+t3yBRRULjZgMGGIh32zbfu8KA5 c0Cxjn+y07ZsOrR/I7FLaky/UqOMe11Rcytmpl7hYjoMPNdkRfH3UGXEVpdN3jlSrje6 k8UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=PKdYh0JNG/Z8dFpTd9BR7vUqWdOyjhLmcvTtMWmHSF0=; b=mzpR3rw74LWuxUvVBeag8vJ/Xwrt4bu7o50g1CDUhPuYNTRMuukfFIvwo0MWbxRPvv 8sUJDNLLb1k7qY3uwS5T1QCZ7VXgDwVxKaBU4op+1/r6Ho++ljpe4+OxmSc98grfzdUs AxaMgo6XIxBHSfdZG8dbTJYj5pP0GeiCk1b/iG9Ub3M31q2A3uo7ZDq1yXXELW3yhv+o Cj42z8zsfkQuYmX+TsZZN1GuJApPzsuVUVPyGu+ypJhimGj86RiQblp0KhhvCgWNrYuk kmSe/lyQRuOz0Af+toi9nGNFvPD/rBqYcXez0Z77UN4zC5HnlE902WgV0qfcU04BKs0d 9t1A== X-Gm-Message-State: APf1xPAf7Tz6fc7IjqzOIYpKHnKEuc9cSj5CiEQsd+EHXJRVYTciHhLN ibhwqXrIeJnRrVeWENdVRVjpt7Iw X-Google-Smtp-Source: AG47ELv616z7F0OfW4jjrc7EfsUn6Xewu9P+yjJMhApx/kEMbaKy3uqM9gUJAPo56yN1Ju9BQmDH5w== X-Received: by 10.101.77.69 with SMTP id j5mr3825347pgt.352.1519975537721; Thu, 01 Mar 2018 23:25:37 -0800 (PST) Received: from pidgey (110-174-2-124.tpgi.com.au. [110.174.2.124]) by smtp.gmail.com with ESMTPSA id j14sm10020221pfn.113.2018.03.01.23.25.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Mar 2018 23:25:36 -0800 (PST) References: <87sh9wnbu6.fsf@zancanaro.id.au> <87lgfe4vft.fsf@gnu.org> <20180227172243.GA19017@jasmine.lan> <87bmga9lm4.fsf@zancanaro.id.au> <20180302003009.GA8305@jasmine.lan> User-agent: mu4e 1.0; emacs 25.3.1 From: Carlo Zancanaro In-reply-to: <20180302003009.GA8305@jasmine.lan> Date: Fri, 02 Mar 2018 18:25:26 +1100 Message-ID: <874llzgcrd.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.5 (/) 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: 0.5 (/) --=-=-= Content-Type: text/plain; format=flowed Hey Leo, On Fri, Mar 02 2018, Leo Famulari wrote: > I'd rather we address this use case as described previously, > with something like 'enable-linger'. I've not used the enable-linger functionality of systemd, but after doing some reading, maybe it could work like this? At boot-time we could start an instance of shepherd for each permitted user (maybe with a `lingering-user-service-type` which adds a shepherd service?). It loads ~/.config/shepherd/init.scm, and starts any services which are enabled. It also adds a pseudo-service "login", which allows a user to specify a dependency on there being a current user session (so shepherd can be told to start processes on login, and to terminate them on logout). For users who don't have a `lingering-user-service-type` running, pid 1 will listen until they log-in and will start a shepherd instance for them on login, loading ~/.config/shepherd/init.scm. When they logout pid 1 will terminate their user shepherd instance (along with any services it started). This will require a few more changes to shepherd before it can work, but does that sound like the sort of behaviour you want? Could you open a new bug about it? Carlo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlqY/GYACgkQqdyPv9aw IbxNEA//fczfJKjPS/09pSfwOrURaywa2WZQ0B3mM8jHmE7140f45/fupBAc65ye YqncqtPHxsiR4JVUSDB8NrFYGHEkIkQkhNQC0wOJqr4XMJc6KbgEMSvj5FC7NwkH ARCi/vGt9CR4IctKuGAJaxJD3BemPDVfWgxQUmyUHi9qzNLjl+b56Sk+yFKR2e+x TH/GS3A5IOTjKJpo4B8LCxllMHB5BYZ9rPA0/dbMCQQwEggNnt4+ln91jBR21yB8 Ugfax39lYh6cg7cQT16rmp74EhFJD5ArhN4MMOgbL48QoibMrwpR+bLHvczN773A ox2P31g4TdofH/bn1aslCKokiGERFGnSvtCwbfK96Zp6ttjxOIyDzBrwrFV2ugsV x0gxB15FBDNxaxsq9srjLwfScgfC1YJrBY/5W5+I8yZqztH1ymUndVrKWwm8c1LQ /qC5bG6U/AnWxdsBwY43a1dzaSt7xTt6GzJbeM2EyICRahNAXZC00b5flYBlRNuk 1A19T2fszDcfdbxQXcFQN/0iiiyKS4yIY/HWB9JGNzCcq+9LOMf1Nbz0ERoFQx1u Ak/XUOQk2i5eWCQQ+/1ydQ4ehSPuMddTMI159GE5ICdqxzsZNSqqjbcb4gm+FFXY wdJaFU/mu+PRZdfru/8jGKe0QAeqfKoZ5AIYj1qlOteR9hX2NtI= =eioX -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 02 07:57:33 2018 Received: (at control) by debbugs.gnu.org; 2 Mar 2018 12:57:33 +0000 Received: from localhost ([127.0.0.1]:40198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erkFh-000625-5e for submit@debbugs.gnu.org; Fri, 02 Mar 2018 07:57:33 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:45438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erkFe-00061x-Vu for control@debbugs.gnu.org; Fri, 02 Mar 2018 07:57:31 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 74335114CB for ; Fri, 2 Mar 2018 13:57:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DO1HwlP-BU2c for ; Fri, 2 Mar 2018 13:57:30 +0100 (CET) Received: from ribbon (unknown [193.50.110.134]) by hera.aquilenet.fr (Postfix) with ESMTPSA id EBCB8DAF5 for ; Fri, 2 Mar 2018 13:57:29 +0100 (CET) Date: Fri, 02 Mar 2018 13:57:29 +0100 Message-Id: <87fu5ihbye.fsf@gnu.org> To: control@debbugs.gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: control message for bug #30532 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: control 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.0 (+) tags 30532 fixed close 30532