[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
Wed Jun 19 11:19:48 UTC 2024


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.


More information about the systemd-devel mailing list