Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You 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.serv... and http://www.freedesktop.org/software/systemd/man/systemd.unit...



That sounds a bit like reinventing the wheel. Can you use the result of external scripts to conditionally launch processes?


`ExecStartPre=` will do that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: