[systemd-devel] WorkingDirectory for user units

Thomas Meyer thomas at m3y3r.de
Mon Dec 5 09:20:22 PST 2011


Am Samstag, den 03.12.2011, 16:52 +0200 schrieb Ran Benita:
> On Sat, Dec 03, 2011 at 02:32:19PM +0100, Thomas Meyer wrote:
> > 1.) Is there an option to set the WorkingDirectory automatically to the
> > users home? The environment variable "HOME" seems to get set for the
> > process. Or is there an option to set the WorkingDirectory based on the
> > user? default working directory seems to be "/".
> 
> I don't think there's a way to do it. I looked into either
>  - making the home directory the default working directory (for user's
>    systemd)
>  - adding a %~ format specifier
>  - or maybe both?
> A patch shouldn't be too hard, which do you think is best?

I think the home directory of the user should be the default working
directory for user units (convention over configuration). OTOH a %~
(home directory) or %u (already taken? - user name) format specifier
would be more flexible.

regards,
thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20111205/3eb4bbf6/attachment.pgp>


More information about the systemd-devel mailing list