From unknown Mon Jun 23 04:12:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36282: shepherd appears to delete log-file instead of appending Resent-From: Robert Vollmert Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 18 Jun 2019 15:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36282 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 36282@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156087305114493 (code B ref -1); Tue, 18 Jun 2019 15:51:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Jun 2019 15:50:51 +0000 Received: from localhost ([127.0.0.1]:45420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdGNn-0003lh-7K for submit@debbugs.gnu.org; Tue, 18 Jun 2019 11:50:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:53169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdGNk-0003lZ-D4 for submit@debbugs.gnu.org; Tue, 18 Jun 2019 11:50:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38417) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdGNi-0005Cu-Sr for bug-guix@gnu.org; Tue, 18 Jun 2019 11:50:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdGNc-0005xI-6o for bug-guix@gnu.org; Tue, 18 Jun 2019 11:50:44 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:31240) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdGNZ-0004Qd-M0 for bug-guix@gnu.org; Tue, 18 Jun 2019 11:50:39 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id EE98E4FF64 for ; Tue, 18 Jun 2019 17:49:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id OD1oF3bS6f2V for ; Tue, 18 Jun 2019 17:49:46 +0200 (CEST) From: Robert Vollmert Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Message-Id: <7588E79A-ADB2-446D-8AD3-F6EEFCBE97F5@vllmrt.net> Date: Tue, 18 Jun 2019 17:49:46 +0200 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.241.60.212 X-Spam-Score: -1.6 (-) 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: -2.6 (--) This is from reading the shepherd code, not verified by test currently. Apologies if I=E2=80=99m missing something. The documentation claims that log-file is appended to: When @var{log-file} is true, it names the file to which the service's standard output and standard error are redirected. @var{log-file} is created if it does not exist, otherwise it is appended to. However, in modules/shepherd/service.scm: 889 (define make-forkexec-constructor [=E2=80=A6] 923 (lambda args 924 (define (clean-up file) 925 (when file 926 (catch 'system-error 927 (lambda () 928 (delete-file file)) 929 (lambda args 930 (unless (=3D ENOENT (system-error-errno args)) 931 (apply throw args)))))) 932 =20 933 (clean-up pid-file) 934 (clean-up log-file) 935 =20 936 (let ((pid (fork+exec-command command From unknown Mon Jun 23 04:12:27 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: Robert Vollmert Subject: bug#36282: closed (Re: bug#36282: shepherd appears to delete log-file instead of appending) Message-ID: References: <87k1dfgeez.fsf@gnu.org> <7588E79A-ADB2-446D-8AD3-F6EEFCBE97F5@vllmrt.net> X-Gnu-PR-Message: they-closed 36282 X-Gnu-PR-Package: guix Reply-To: 36282@debbugs.gnu.org Date: Fri, 21 Jun 2019 15:14:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1561130042-2022-1" This is a multi-part message in MIME format... ------------=_1561130042-2022-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #36282: shepherd appears to delete log-file instead of appending 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 36282@debbugs.gnu.org. --=20 36282: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36282 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1561130042-2022-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36282-done) by debbugs.gnu.org; 21 Jun 2019 15:13:35 +0000 Received: from localhost ([127.0.0.1]:50595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1heLEN-0000Vn-6O for submit@debbugs.gnu.org; Fri, 21 Jun 2019 11:13:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1heLEL-0000VZ-N2 for 36282-done@debbugs.gnu.org; Fri, 21 Jun 2019 11:13:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1heLEE-0005XG-3l; Fri, 21 Jun 2019 11:13:27 -0400 Received: from [2001:660:4701:6001:3d6c:d0e8:a2b5:ec10] (port=52724 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1heLE2-0003dH-Fx; Fri, 21 Jun 2019 11:13:18 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Robert Vollmert Subject: Re: bug#36282: shepherd appears to delete log-file instead of appending References: <7588E79A-ADB2-446D-8AD3-F6EEFCBE97F5@vllmrt.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 Messidor an 227 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, 21 Jun 2019 17:13:08 +0200 In-Reply-To: <7588E79A-ADB2-446D-8AD3-F6EEFCBE97F5@vllmrt.net> (Robert Vollmert's message of "Tue, 18 Jun 2019 17:49:46 +0200") Message-ID: <87k1dfgeez.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36282-done Cc: 36282-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, Robert Vollmert skribis: > This is from reading the shepherd code, not verified by test currently. > Apologies if I=E2=80=99m missing something. > > The documentation claims that log-file is appended to: > > When @var{log-file} is true, it names the file to which the service's > standard output and standard error are redirected. @var{log-file} is > created if it does not exist, otherwise it is appended to. > > However, in modules/shepherd/service.scm: > > 889 (define make-forkexec-constructor > [=E2=80=A6] > 923 (lambda args > 924 (define (clean-up file) > 925 (when file > 926 (catch 'system-error > 927 (lambda () > 928 (delete-file file)) > 929 (lambda args > 930 (unless (=3D ENOENT (system-error-errno args)) > 931 (apply throw args)))))) > 932=20=20 > 933 (clean-up pid-file) > 934 (clean-up log-file) Ouch, indeed. Commit 7b4c88bac70f0bad82ef70fd5b682a49bc227478 tried to address that, but I think it pretty much failed at that=E2=80=A6 I removed this =E2=80=98clean-up=E2=80=99 call in Shepherd commit 6892f638c78a14fedd075f664432757bc015c140. Thanks, Ludo=E2=80=99. ------------=_1561130042-2022-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Jun 2019 15:50:51 +0000 Received: from localhost ([127.0.0.1]:45420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdGNn-0003lh-7K for submit@debbugs.gnu.org; Tue, 18 Jun 2019 11:50:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:53169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdGNk-0003lZ-D4 for submit@debbugs.gnu.org; Tue, 18 Jun 2019 11:50:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38417) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdGNi-0005Cu-Sr for bug-guix@gnu.org; Tue, 18 Jun 2019 11:50:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdGNc-0005xI-6o for bug-guix@gnu.org; Tue, 18 Jun 2019 11:50:44 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:31240) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdGNZ-0004Qd-M0 for bug-guix@gnu.org; Tue, 18 Jun 2019 11:50:39 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id EE98E4FF64 for ; Tue, 18 Jun 2019 17:49:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id OD1oF3bS6f2V for ; Tue, 18 Jun 2019 17:49:46 +0200 (CEST) From: Robert Vollmert Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: shepherd appears to delete log-file instead of appending Message-Id: <7588E79A-ADB2-446D-8AD3-F6EEFCBE97F5@vllmrt.net> Date: Tue, 18 Jun 2019 17:49:46 +0200 To: bug-guix@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.241.60.212 X-Spam-Score: -1.6 (-) 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: -2.6 (--) This is from reading the shepherd code, not verified by test currently. Apologies if I=E2=80=99m missing something. The documentation claims that log-file is appended to: When @var{log-file} is true, it names the file to which the service's standard output and standard error are redirected. @var{log-file} is created if it does not exist, otherwise it is appended to. However, in modules/shepherd/service.scm: 889 (define make-forkexec-constructor [=E2=80=A6] 923 (lambda args 924 (define (clean-up file) 925 (when file 926 (catch 'system-error 927 (lambda () 928 (delete-file file)) 929 (lambda args 930 (unless (=3D ENOENT (system-error-errno args)) 931 (apply throw args)))))) 932 =20 933 (clean-up pid-file) 934 (clean-up log-file) 935 =20 936 (let ((pid (fork+exec-command command ------------=_1561130042-2022-1--