michaelroland / wdnas-hwdaemon

Hardware Controller for Western Digital My Cloud NAS Systems
GNU General Public License v3.0
13 stars 10 forks source link

No permission to write to /var/run #2

Closed stefaang closed 6 years ago

stefaang commented 6 years ago

When running as user wdhwd with the systemd, the service fails to start as it can't create /var/run/wdhwd Any idea how to fix this permanently? Maybe a prestart command: mkdir /var/run/wdhwd ; chown wdhwd /var/run/wdhwd

michaelroland commented 6 years ago

That would be an option, but care should be taken to protect the socket created inside the runtime directory (you might want to give other users access to the socket based on group membership).

systemd has an option for creation of runtime directories (RuntimeDirectory) and that's what I've added to the config template now (542c2a3b62fb97f13ed8f8a223fa42eadd9aa143). This would also be interesting for the log directory, however, the systemd that ships with Stretch does not seem to support that yet.