| Summary: | Executing within home directory of the given user | ||
|---|---|---|---|
| Product: | systemd | Reporter: | Dan T <rozelak> |
| Component: | general | Assignee: | systemd-bugs |
| Status: | RESOLVED FIXED | QA Contact: | systemd-bugs |
| Severity: | enhancement | ||
| Priority: | medium | CC: | j.witteveen, rektide, rozelak |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
|
Description
Dan T
2012-09-20 20:48:39 UTC
This is now supported with WorkingDirectory=%h The resolution (WorkingDirectory=%h) is no longer supported. Would it be possible to set the working directory to the user's home directory by default (in the absence of WorkingDirectory=) after forking? (In reply to comment #2) > The resolution (WorkingDirectory=%h) is no longer supported. Can you link to when (commit or mailing list message) this changed? (In reply to comment #3) > Can you link to when (commit or mailing list message) this changed? http://cgit.freedesktop.org/systemd/systemd/commit/?id=2cfbd749af308bdbe56edcfed7f3eea0fc2b93d2 from NEWS: CHANGES WITH 209: * %h, %s, %U specifier support is not available anymore when used in unit files for PID 1. This is because NSS calls are not safe from PID 1. They stay available for --user instances of systemd, and as special case for the root user. One possible fix would be to change src/core/unit.c:unit_patch_contexts, replacing
if (u->manager->running_as == SYSTEMD_USER && !ec->working_directory) {
with something along the lines of
if (/* uid of process-to-run != 0 */ && !ec->working_directory) {
and also modify src/shared/util.c:get_home_dir, where we add the uid as a parameter.
Would this be acceptable? If so, I will try to come up with a patch.
This is now available again with the WorkingDirectory=~ syntax. |
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.