[systemd-devel] OpenFile directive still gives logging errors when opening a file while using the option graceful
Lennart Poettering
lennart at poettering.net
Fri Jun 21 14:03:07 UTC 2024
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
More information about the systemd-devel
mailing list