[systemd-devel] [PATCH] Set WorkinDirectory to $HOME for user session units.

Kok, Auke-jan H auke-jan.h.kok at intel.com
Tue Jul 17 00:20:08 PDT 2012


On Mon, Jul 16, 2012 at 3:48 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Sat, 14.07.12 00:23, Auke Kok (auke-jan.h.kok at intel.com) wrote:
>
>> Change the default WorkingDirectory to $HOME in case running as
>> USER_MANAGER. We assume that HOME is set by default for all
>> user managers, so looking up pw_dir doesn't make much sense.
>>
>> Mount, socket and service units are affected, as these all
>> can execute programs and thus the working directory may
>> affect how these programs function.
>
> I don't think segfaulting when HOME isn't set is really an option. I
> have now applied a different patch that moves this to service_load() (so
> that we can properly handle OOM), and uses the new get_home_dir() call I
> added.
>
> Please test!

Tested this both for units inside the user session, and for system
units where User=<set>, and all working according to expectations.

Thanks,

Auke


More information about the systemd-devel mailing list