From: "Ludovic Courtès" <ludo@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 55080@debbugs.gnu.org
Subject: [bug#55080] [PATCH shepherd] service: Gracefully handle non-existing log directories.
Date: Sat, 30 Apr 2022 16:15:33 +0200 [thread overview]
Message-ID: <8735hu64je.fsf@gnu.org> (raw)
In-Reply-To: <2e5292c2d45e525aa1b8e4c495704104d4121291.camel@gmail.com> (Liliana Marie Prikler's message of "Sat, 23 Apr 2022 15:11:50 +0200")
Hi,
Liliana Marie Prikler <liliana.prikler@gmail.com> skribis:
> * gnu/packages/services.scm (%service-file-logger): New variable,
> implementing...
> (service-file-logger): ... the old behaviour of this variable. Catch system
> errors from %service-file-logger and handle them.
[...]
> +(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.
Did you encounter this issue while working on services?
Am I right that the Shepherd 0.8 had the same problem?
Thanks,
Ludo’.
next prev parent reply other threads:[~2022-04-30 14:22 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 [this message]
2022-04-30 14:26 ` Liliana Marie Prikler
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735hu64je.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=55080@debbugs.gnu.org \
--cc=liliana.prikler@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.