Thank you for anser, I have created an issue (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@xxxxxxxxxxxxxx>:
On Mi, 19.06.24 13:19, Adam Nilsson (johan.adam.nilsson@xxxxxxxxx) 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