unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36282: shepherd appears to delete log-file instead of appending
@ 2019-06-18 15:49 Robert Vollmert
  2019-06-21 15:13 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Vollmert @ 2019-06-18 15:49 UTC (permalink / raw)
  To: 36282

This is from reading the shepherd code, not verified by test currently.
Apologies if I’m 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
[…]
   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 (= ENOENT (system-error-errno args))
   931                      (apply throw args))))))
   932  
   933            (clean-up pid-file)
   934            (clean-up log-file)
   935  
   936            (let ((pid (fork+exec-command command

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#36282: shepherd appears to delete log-file instead of appending
  2019-06-18 15:49 bug#36282: shepherd appears to delete log-file instead of appending Robert Vollmert
@ 2019-06-21 15:13 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2019-06-21 15:13 UTC (permalink / raw)
  To: Robert Vollmert; +Cc: 36282-done

Hi,

Robert Vollmert <rob@vllmrt.net> skribis:

> This is from reading the shepherd code, not verified by test currently.
> Apologies if I’m 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
> […]
>    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 (= ENOENT (system-error-errno args))
>    931                      (apply throw args))))))
>    932  
>    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…

I removed this ‘clean-up’ call in Shepherd commit
6892f638c78a14fedd075f664432757bc015c140.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-21 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 15:49 bug#36282: shepherd appears to delete log-file instead of appending Robert Vollmert
2019-06-21 15:13 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).