[systemd-devel] How to troubleshoot 'step CHDIR spawning' failure.

MikeB mabnhdev at gmail.com
Wed Apr 13 13:59:47 UTC 2016


>>* I've verified that '/bin/mkdir' does exist and does run fine.  So I assume
*>>* the the 'No such file or directory' refers to the target of the chdir.
*>> >>* My question is how do I troubleshoot from here?  What can I do
to determine
*>>* exactly what file or directory is not being found.  I'd like to understand
*>>* what is wrong and fix it.
*>
>  CHDIR failure points to something related with directory.  Check
> what directives you have in unit file - maybe WorkingDirectory= with
> dir that do not exists? Or RootDirectory= ?
>  Speculating further - maybe you are trying to mkdir directory which
> you also put in RootDirectory= ?  This won't work, because /bin/mkdir is
> run in the same environment that main process; but you can
>  – investigate if PermissionStartOnly= (man systemd.service) will help you
>  – use RuntimeDirectory= (man systemd.service) to automate directory
>    creation
>  - use tmpfiles to precreate all directories

Sorry, I should have included the entire contents of the service file.

Your speculation was right on...  hidden among all the commands the the
[Service] section was a WorkingDirectory= statement that I hadn't noticed.
It was, indeed, pointing to a directory that doesn't exist.

Easy fix.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160413/b67c03e0/attachment.html>


More information about the systemd-devel mailing list