[systemd-devel] OpenFile directive still gives logging errors when opening a file while using the option graceful
Adam Nilsson
johan.adam.nilsson at gmail.com
Mon Jun 24 09:00:30 UTC 2024
Thank you for anser, I have created an issue (33458
<https://github.com/systemd/systemd/issues/33458>).
Can't promise anything but can try looking into it.
Adam Nilsson
Den fre 21 juni 2024 kl 16:03 skrev Lennart Poettering <
lennart at poettering.net>:
> On Mi, 19.06.24 13:19, Adam Nilsson (johan.adam.nilsson at gmail.com) wrote:
>
> > Hi, so I am developing a service that may need to open a file under
> > the /dev directory that may or may not exist. As I do not want the
> > service to be root but the file has root permissions. I am trying to
> > use the OpenFile directive using the graceful option in the service
> > file. If the file is missing I get the following error:
> > <my service>.service: Could not open "/dev/<some file>": No such file
> > or directory
> > The service is still starting so that is not the issue my question is
> > should there still be an error in the log complaining that it where
> > unable to open file? Reading the documentation for OpenFile is says
> > that 'if "graceful" is specified, errors during file/socket opening
> > are ignored' so I interpreted that as any error opening the file
> > should be silenced but I do understand that it could be interpreted as
> > the service will still start if errors were found opening the file.
>
> Yes, this is a bug I guess. Can you please file an issue on github, so
> that we keep track of this, and don't forget to fix this?
>
> Even better: send a PR that fixes this.
>
> Lennart
>
> --
> Lennart Poettering, Berlin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20240624/a8139963/attachment.htm>
More information about the systemd-devel
mailing list