GNU bug report logs -
#55080
[PATCH shepherd] service: Gracefully handle non-existing log directories.
Previous Next
Full log
View this message in rfc822 format
Am Samstag, dem 30.04.2022 um 16:15 +0200 schrieb Ludovic Courtès:
>
> > +(define (service-file-logger file input)
> > + "Return a thunk meant to run as a fiber that reads from INPUT
> > and logs it to
> > +FILE."
> > + (catch 'system-error
> > + (lambda ()
> > + (%service-file-logger file input))
> > + (lambda args
> > + (if (= ENOENT (system-error-errno args))
> > + (begin
> > + (mkdir-p (dirname file))
> > + (%service-file-logger file input))
> > + (apply throw args)))))
>
> I wonder to what extent automatically creating log directories is a
> good idea. A potential drawback is if shepherd creates them with
> unexpected ownership or permissions.
As far as I know, those logs should be managed by shepherd, no? It
just redirects stdout/stderr there, or is there something special going
on?
> Did you encounter this issue while working on services?
>
> Am I right that the Shepherd 0.8 had the same problem?
It might be, I don't know. I've encountered this for non-existing log
directory, so a reproducer would be setting #:log-file to $test-tmp-
directory/does-not-exist/log and check for each service.
Cheers
This bug report was last modified 2 years and 266 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.