[systemd-devel] How to troubleshoot 'step CHDIR spawning' failure.
Tomasz Torcz
tomek at pipebreaker.pl
Wed Apr 13 11:48:08 UTC 2016
On Wed, Apr 13, 2016 at 07:28:34AM -0400, MikeB wrote:
> I'm running systemd 215 on a fairly up-to-date Debian Jessie system.
>
> I have a Type=forking service that fails on its first ExecStartPre command
> which is using /bin/mkdir to create a directory.
>
> The service fails to start with the following.
>
> Apr 13 10:07:42 localhost systemd[1]: Starting OVSDB Server Daemon...
> Apr 13 10:07:42 localhost systemd[4069]: Failed at step CHDIR spawning
> /bin/mkdir: No such file or directory
> Apr 13 10:07:42 localhost systemd[1]: ovsdb-server.service: control process
> exited, code=exited status=200
> Job for ovsdb-server.service failed. See 'systemctl status
> ovsdb-server.service' and 'journalctl -xn' for details.
> Apr 13 10:07:42 localhost systemd[1]: Failed to start OVSDB Server Daemon.
> Apr 13 10:07:42 localhost systemd[1]: Unit ovsdb-server.service entered
> failed state.
> a
>
> 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
--
Tomasz .. oo o. oo o. .o .o o. o. oo o. ..
Torcz .. .o .o .o .o oo oo .o .. .. oo oo
o.o.o. .o .. o. o. o. o. o. o. oo .. .. o.
More information about the systemd-devel
mailing list