Bug 89864 - MSG: Error message when working directory does not exist can be misleading
Summary: MSG: Error message when working directory does not exist can be misleading
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 20:11 UTC by Randy Barlow
Modified: 2017-10-27 18:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Randy Barlow 2015-04-01 20:11:20 UTC
If the WorkingDirectory directive in a unit is configured for a directory that does not exist, the error message that is printed is a little confusing to read.

For example, we have a systemd service template[0] that sets the working directory to /var/run/pulp/. If that folder does not exist when the unit is started, this is the error message that is printed:

Failed at step CHDIR spawning /usr/bin/celery: No such file or directory

I say "can be" misleading, because I see that technically it is saying that CHDIR failed *when* spawning /usr/bin/celery (which is correct). Unfortunately, it might read to some people[1] that /usr/bin/celery didn't exist, which can be confusing. I think it might be helpful if it instead told me that it could not find /var/run/pulp. Maybe something like this would be nice:

While spawning /usr/bin/celery, failed to chdir /var/run/pulp: No such file or directory

Thanks, and let me know if I can provide any more information!

[0] https://github.com/pulp/pulp/blob/e6ea3131796df60de3f7e3b98acc2ef108f517f7/server/pulp/server/async/manage_workers.py#L27-L38
[1] Like me ☺
Comment 1 Lennart Poettering 2017-10-27 18:10:20 UTC
The message systemd 235 logs is this:

"foobar.service: Changing to the requested working directory failed: No such file or directory"

I think that should be clear and resolve the issue. Closing.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.