From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 55080@debbugs.gnu.org
Subject: [bug#55080] [PATCH shepherd] service: Gracefully handle non-existing log directories.
Date: Sat, 30 Apr 2022 16:26:29 +0200 [thread overview]
Message-ID: <f256ec6b0af573bcd118acd6ddeb81e0fba72116.camel@gmail.com> (raw)
In-Reply-To: <8735hu64je.fsf@gnu.org>
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
next prev parent reply other threads:[~2022-04-30 14:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-23 13:11 [bug#55080] [PATCH shepherd] service: Gracefully handle non-existing log directories Liliana Marie Prikler
2022-04-30 14:15 ` Ludovic Courtès
2022-04-30 14:26 ` Liliana Marie Prikler [this message]
2022-05-01 13:32 ` Ludovic Courtès
2022-05-01 13:50 ` Liliana Marie Prikler
2022-08-29 15:18 ` bug#55080: " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f256ec6b0af573bcd118acd6ddeb81e0fba72116.camel@gmail.com \
--to=liliana.prikler@gmail.com \
--cc=55080@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).