4 ms·
How does systemd handle situations where you need to check for the existence of directories and check their permissions, etc, before starting the service? You'd
by feld 12y ago
How does systemd handle situations where you need to check for the existence of directories and check their permissions, etc, before starting the service? You'd have to script it... and it would end up looking like a sysvinit script anyway.
- xobs 12y agoYou can add ConditionPathExists= or ConditionPathIsDirectory= to a Unit to check if one or more directories exist. You can also substitute the userid into commands with %U, so you could have it always chown before running the command, as you can have multiple ExecStart= directives. http://www.freedesktop.org/software/systemd/man/systemd.service.html http://www.freedesktop.org/software/systemd/man/systemd.serv... and http://www.freedesktop.org/software/systemd/man/systemd.unit.html http://www.freedesktop.org/software/systemd/man/systemd.unit...