From unknown Sat Aug 16 16:56:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32665: Shepherd is stuck waiting for /var/run/nginx/pid Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 08 Sep 2018 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32665 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 32665@debbugs.gnu.org Cc: Ricardo Wurmus , clement@lassieur.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.153642595530259 (code B ref -1); Sat, 08 Sep 2018 17:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Sep 2018 16:59:15 +0000 Received: from localhost ([127.0.0.1]:50550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fygZn-0007rz-01 for submit@debbugs.gnu.org; Sat, 08 Sep 2018 12:59:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fygZl-0007rm-Kn for submit@debbugs.gnu.org; Sat, 08 Sep 2018 12:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fygZe-0007Jh-FO for submit@debbugs.gnu.org; Sat, 08 Sep 2018 12:59:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fygZe-0007IM-47 for submit@debbugs.gnu.org; Sat, 08 Sep 2018 12:59:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fygZb-0007Vv-Ve for bug-guix@gnu.org; Sat, 08 Sep 2018 12:59:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fygUD-0003Il-Vc for bug-guix@gnu.org; Sat, 08 Sep 2018 12:53:30 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fygTz-0002sn-6n; Sat, 08 Sep 2018 12:53:15 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=33172 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fygTy-0007gd-VA; Sat, 08 Sep 2018 12:53:15 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 Fructidor 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: Sat, 08 Sep 2018 18:53:13 +0200 Message-ID: <87zhwsdj7q.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.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: -6.0 (------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Cl=C3=A9ment, Commit 9fc2922794ffaae48e0a7c536e530ea2e0d46cf3 adds a loop to the nginx service that checks for /var/run/nginx/pid. Unfortunately, on berlin that loop never ends because the file is not created (on berlin we use a =E2=80=9Chand-written=E2=80=9D nginx config file that lacks a =E2=80=9Cpid= =E2=80=9D directive; see guix-maintenance.git.) I think there are two things to address: 1. Don=E2=80=99t look for a PID file when passed a hand-written config fi= le; 2. Make sure the loop always terminates, similar to what =E2=80=98make-forkexec-constructor=E2=80=99 does. The patch below fixes that. The second patch fixes the =E2=80=98stop=E2=80= =99 procedure. Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-services-nginx-Don-t-read-PID-file-when-passed-a-cus.patch >From c9daf228a69c24cff6ba5508a3b67ebe3c702a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 8 Sep 2018 18:48:48 +0200 Subject: [PATCH 1/2] services: nginx: Don't read PID file when passed a custom config file. Fixes . * gnu/services/web.scm (nginx-shepherd-service): Check whether FILE is true and don't read the PID file if it is; use 'read-pid-file' instead of a potentially endless loop. --- gnu/services/web.scm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 3778efd04..1c993b29f 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -610,14 +610,12 @@ of index files." (match '#$args (("-s" . _) #t) (_ - (let loop ((duration 0)) - ;; https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864/comments/7 - (sleep duration) - (if (file-exists? #$pid-file) - (let ((pid (call-with-input-file #$pid-file read))) - ;; it could be # - (if (integer? pid) pid (loop 1))) - (loop 1))))))))) + ;; When FILE is true, we cannot be sure that PID-FILE will + ;; be created, so assume it won't show up. When FILE is + ;; false, read PID-FILE. + #$(if file + #~#t + #~(read-pid-file #$pid-file)))))))) ;; TODO: Add 'reload' action. (list (shepherd-service -- 2.18.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-services-nginx-stop-returns-f.patch >From 211a820dbd37926f07f9245ab42cbaf6fb0264bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 8 Sep 2018 18:50:55 +0200 Subject: [PATCH 2/2] services: nginx: 'stop' returns #f. Previously we'd return #t, which the Shepherd would consider a failure to stop the service. * gnu/services/web.scm (nginx-shepherd-service): In 'nginx-action', return #f when stopping the service. --- gnu/services/web.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 1c993b29f..df82a6de6 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -608,7 +608,7 @@ of index files." (default-nginx-config config)) #$@args) (match '#$args - (("-s" . _) #t) + (("-s" . _) #f) (_ ;; When FILE is true, we cannot be sure that PID-FILE will ;; be created, so assume it won't show up. When FILE is -- 2.18.0 --=-=-=-- From unknown Sat Aug 16 16:56:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32665: Shepherd is stuck waiting for /var/run/nginx/pid Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 08 Sep 2018 17:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32665 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: rekado@elephly.net, 32665@debbugs.gnu.org X-Debbugs-Original-Cc: Ricardo Wurmus , bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.153642715932224 (code B ref -1); Sat, 08 Sep 2018 17:20:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Sep 2018 17:19:19 +0000 Received: from localhost ([127.0.0.1]:50565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fygtD-0008Ng-GE for submit@debbugs.gnu.org; Sat, 08 Sep 2018 13:19:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fygtA-0008NS-0g for submit@debbugs.gnu.org; Sat, 08 Sep 2018 13:19:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fygt2-000751-Ra for submit@debbugs.gnu.org; Sat, 08 Sep 2018 13:19:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fygt2-00074B-MU for submit@debbugs.gnu.org; Sat, 08 Sep 2018 13:19:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fygsz-00062T-6n for bug-guix@gnu.org; Sat, 08 Sep 2018 13:19:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fygqm-0007ON-Rt for bug-guix@gnu.org; Sat, 08 Sep 2018 13:16:49 -0400 Received: from mail.lassieur.org ([83.152.10.219]:46404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fygqj-0007KR-2H; Sat, 08 Sep 2018 13:16:45 -0400 Received: from rodion (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 1cffa872 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Sat, 8 Sep 2018 17:12:43 +0000 (UTC) References: <87zhwsdj7q.fsf@gnu.org> User-agent: mu4e 1.0; emacs 26.1 From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <87zhwsdj7q.fsf@gnu.org> Date: Sat, 08 Sep 2018 19:16:41 +0200 Message-ID: <8736ujq58m.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) 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: -5.1 (-----) Oh! Sorry for the mess. The patches both look good to me, thank you! Cl=C3=A9ment Ludovic Court=C3=A8s writes: > Hello Cl=C3=A9ment, > > Commit 9fc2922794ffaae48e0a7c536e530ea2e0d46cf3 adds a loop to the nginx > service that checks for /var/run/nginx/pid. Unfortunately, on berlin > that loop never ends because the file is not created (on berlin we use a > =E2=80=9Chand-written=E2=80=9D nginx config file that lacks a =E2=80=9Cpi= d=E2=80=9D directive; see > guix-maintenance.git.) > > I think there are two things to address: > > 1. Don=E2=80=99t look for a PID file when passed a hand-written config = file; > > 2. Make sure the loop always terminates, similar to what > =E2=80=98make-forkexec-constructor=E2=80=99 does. > > The patch below fixes that. The second patch fixes the =E2=80=98stop=E2= =80=99 > procedure. > > Thoughts? > > Ludo=E2=80=99. > > From c9daf228a69c24cff6ba5508a3b67ebe3c702a2b Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Ludovic=3D20Court=3DC3=3DA8s?=3D > Date: Sat, 8 Sep 2018 18:48:48 +0200 > Subject: [PATCH 1/2] services: nginx: Don't read PID file when passed a c= ustom > config file. > > Fixes . > > * gnu/services/web.scm (nginx-shepherd-service): Check whether FILE is > true and don't read the PID file if it is; use 'read-pid-file' instead > of a potentially endless loop. > --- > gnu/services/web.scm | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/gnu/services/web.scm b/gnu/services/web.scm > index 3778efd04..1c993b29f 100644 > --- a/gnu/services/web.scm > +++ b/gnu/services/web.scm > @@ -610,14 +610,12 @@ of index files." > (match '#$args > (("-s" . _) #t) > (_ > - (let loop ((duration 0)) > - ;; https://bugs.launchpad.net/ubuntu/+source/nginx= /+bug/1581864/comments/7 > - (sleep duration) > - (if (file-exists? #$pid-file) > - (let ((pid (call-with-input-file #$pid-file re= ad))) > - ;; it could be # > - (if (integer? pid) pid (loop 1))) > - (loop 1))))))))) > + ;; When FILE is true, we cannot be sure that PID-FIL= E will > + ;; be created, so assume it won't show up. When FIL= E is > + ;; false, read PID-FILE. > + #$(if file > + #~#t > + #~(read-pid-file #$pid-file)))))))) >=20=20 > ;; TODO: Add 'reload' action. > (list (shepherd-service > --=20 > 2.18.0 > > From 211a820dbd37926f07f9245ab42cbaf6fb0264bb Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Ludovic=3D20Court=3DC3=3DA8s?=3D > Date: Sat, 8 Sep 2018 18:50:55 +0200 > Subject: [PATCH 2/2] services: nginx: 'stop' returns #f. > > Previously we'd return #t, which the Shepherd would consider a failure > to stop the service. > > * gnu/services/web.scm (nginx-shepherd-service): In 'nginx-action', > return #f when stopping the service. > --- > gnu/services/web.scm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gnu/services/web.scm b/gnu/services/web.scm > index 1c993b29f..df82a6de6 100644 > --- a/gnu/services/web.scm > +++ b/gnu/services/web.scm > @@ -608,7 +608,7 @@ of index files." > (default-nginx-config config)) > #$@args) > (match '#$args > - (("-s" . _) #t) > + (("-s" . _) #f) > (_ > ;; When FILE is true, we cannot be sure that PID-FIL= E will > ;; be created, so assume it won't show up. When FIL= E is From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 08 16:32:25 2018 Received: (at control) by debbugs.gnu.org; 8 Sep 2018 20:32:25 +0000 Received: from localhost ([127.0.0.1]:50630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fyju4-0004n7-TO for submit@debbugs.gnu.org; Sat, 08 Sep 2018 16:32:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fyju1-0004mu-MY for control@debbugs.gnu.org; Sat, 08 Sep 2018 16:32:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fyjtt-0004WJ-Ho for control@debbugs.gnu.org; Sat, 08 Sep 2018 16:32:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyjtr-0004UJ-9e for control@debbugs.gnu.org; Sat, 08 Sep 2018 16:32:12 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37428 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fyjtq-00040m-Cf for control@debbugs.gnu.org; Sat, 08 Sep 2018 16:32:10 -0400 Date: Sat, 08 Sep 2018 22:32:09 +0200 Message-Id: <87pnxnenna.fsf@gnu.org> To: control@debbugs.gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: control message for bug #32665 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.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: -6.0 (------) severity 32665 important From unknown Sat Aug 16 16:56:44 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#32665: closed (Re: bug#32665: Shepherd is stuck waiting for /var/run/nginx/pid) Message-ID: References: <87lg8bem7a.fsf@gnu.org> <87zhwsdj7q.fsf@gnu.org> X-Gnu-PR-Message: they-closed 32665 X-Gnu-PR-Package: guix Reply-To: 32665@debbugs.gnu.org Date: Sat, 08 Sep 2018 21:04:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1536440642-29246-1" This is a multi-part message in MIME format... ------------=_1536440642-29246-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #32665: Shepherd is stuck waiting for /var/run/nginx/pid which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 32665@debbugs.gnu.org. --=20 32665: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D32665 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1536440642-29246-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 32665-done) by debbugs.gnu.org; 8 Sep 2018 21:03:31 +0000 Received: from localhost ([127.0.0.1]:50649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fykOB-0007b0-8E for submit@debbugs.gnu.org; Sat, 08 Sep 2018 17:03:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fykO9-0007ai-Pk for 32665-done@debbugs.gnu.org; Sat, 08 Sep 2018 17:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fykO3-0003A8-MG for 32665-done@debbugs.gnu.org; Sat, 08 Sep 2018 17:03:24 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fykO3-00039s-HR; Sat, 08 Sep 2018 17:03:23 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38104 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fykO3-00034H-8A; Sat, 08 Sep 2018 17:03:23 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: bug#32665: Shepherd is stuck waiting for /var/run/nginx/pid References: <87zhwsdj7q.fsf@gnu.org> <8736ujq58m.fsf@lassieur.org> Date: Sat, 08 Sep 2018 23:03:21 +0200 In-Reply-To: <8736ujq58m.fsf@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Sat, 08 Sep 2018 19:16:41 +0200") Message-ID: <87lg8bem7a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32665-done Cc: rekado@elephly.net, 32665-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: -6.0 (------) Hello, Cl=C3=A9ment Lassieur skribis: > Oh! Sorry for the mess. The patches both look good to me, thank you! Alright, pushed as 985975ae80fe5a8e58319b3a5aaf14da940c4419. Thanks for the quick reply! Ludo=E2=80=99. ------------=_1536440642-29246-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Sep 2018 16:59:15 +0000 Received: from localhost ([127.0.0.1]:50550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fygZn-0007rz-01 for submit@debbugs.gnu.org; Sat, 08 Sep 2018 12:59:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fygZl-0007rm-Kn for submit@debbugs.gnu.org; Sat, 08 Sep 2018 12:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fygZe-0007Jh-FO for submit@debbugs.gnu.org; Sat, 08 Sep 2018 12:59:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fygZe-0007IM-47 for submit@debbugs.gnu.org; Sat, 08 Sep 2018 12:59:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fygZb-0007Vv-Ve for bug-guix@gnu.org; Sat, 08 Sep 2018 12:59:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fygUD-0003Il-Vc for bug-guix@gnu.org; Sat, 08 Sep 2018 12:53:30 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fygTz-0002sn-6n; Sat, 08 Sep 2018 12:53:15 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=33172 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fygTy-0007gd-VA; Sat, 08 Sep 2018 12:53:15 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: bug-guix@gnu.org Subject: Shepherd is stuck waiting for /var/run/nginx/pid X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 Fructidor 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: Sat, 08 Sep 2018 18:53:13 +0200 Message-ID: <87zhwsdj7q.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Ricardo Wurmus , clement@lassieur.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: -6.0 (------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Cl=C3=A9ment, Commit 9fc2922794ffaae48e0a7c536e530ea2e0d46cf3 adds a loop to the nginx service that checks for /var/run/nginx/pid. Unfortunately, on berlin that loop never ends because the file is not created (on berlin we use a =E2=80=9Chand-written=E2=80=9D nginx config file that lacks a =E2=80=9Cpid= =E2=80=9D directive; see guix-maintenance.git.) I think there are two things to address: 1. Don=E2=80=99t look for a PID file when passed a hand-written config fi= le; 2. Make sure the loop always terminates, similar to what =E2=80=98make-forkexec-constructor=E2=80=99 does. The patch below fixes that. The second patch fixes the =E2=80=98stop=E2=80= =99 procedure. Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-services-nginx-Don-t-read-PID-file-when-passed-a-cus.patch >From c9daf228a69c24cff6ba5508a3b67ebe3c702a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 8 Sep 2018 18:48:48 +0200 Subject: [PATCH 1/2] services: nginx: Don't read PID file when passed a custom config file. Fixes . * gnu/services/web.scm (nginx-shepherd-service): Check whether FILE is true and don't read the PID file if it is; use 'read-pid-file' instead of a potentially endless loop. --- gnu/services/web.scm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 3778efd04..1c993b29f 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -610,14 +610,12 @@ of index files." (match '#$args (("-s" . _) #t) (_ - (let loop ((duration 0)) - ;; https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864/comments/7 - (sleep duration) - (if (file-exists? #$pid-file) - (let ((pid (call-with-input-file #$pid-file read))) - ;; it could be # - (if (integer? pid) pid (loop 1))) - (loop 1))))))))) + ;; When FILE is true, we cannot be sure that PID-FILE will + ;; be created, so assume it won't show up. When FILE is + ;; false, read PID-FILE. + #$(if file + #~#t + #~(read-pid-file #$pid-file)))))))) ;; TODO: Add 'reload' action. (list (shepherd-service -- 2.18.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-services-nginx-stop-returns-f.patch >From 211a820dbd37926f07f9245ab42cbaf6fb0264bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 8 Sep 2018 18:50:55 +0200 Subject: [PATCH 2/2] services: nginx: 'stop' returns #f. Previously we'd return #t, which the Shepherd would consider a failure to stop the service. * gnu/services/web.scm (nginx-shepherd-service): In 'nginx-action', return #f when stopping the service. --- gnu/services/web.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 1c993b29f..df82a6de6 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -608,7 +608,7 @@ of index files." (default-nginx-config config)) #$@args) (match '#$args - (("-s" . _) #t) + (("-s" . _) #f) (_ ;; When FILE is true, we cannot be sure that PID-FILE will ;; be created, so assume it won't show up. When FILE is -- 2.18.0 --=-=-=-- ------------=_1536440642-29246-1--