[systemd-devel] $PWD=/ in systemd --user

Lennart Poettering lennart at poettering.net
Mon Jul 9 07:44:53 PDT 2012


On Tue, 03.07.12 14:26, Kok, Auke-jan H (auke-jan.h.kok at intel.com) wrote:

> 
> On Tue, Jul 3, 2012 at 11:10 AM, Léo Gillot-Lamure
> <leo.gillot at navaati.net> wrote:
> > I'm running a user session using systemd --user and my PWD in the
> > session (visible, for example, when launching a xterm) is / instead of
> > $HOME as one would expect. That's a bit annoying.
> > I tried to wrap systemd --user in a script doing "cd $HOME" before
> > exec'ing it, but it doesn't change anything.
> >
> > Have you guys using the user session noticed the same thing ?
> 
> yes.
> 
> Basically systemd --user doesn't do the "sane default" stuff that you
> would expect. I've been thinking of a way to solve the issue, but it's
> not clear to me what the right solution is:
> 
> - write a wrapper that wraps around systemd --user. This could handle
> login management as well and talk to logind.
> 
> - write or use pam modules to do these bits for us, and just let
> /etc/pam.d/login(?) catch it.

I'd be happy to take a patch that makes WorkingDirectory= default to
getenv("HOME") for all services, if we are running as user instance!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list