[systemd-devel] [PATCH] unit: add specifiers for user name and home directory
Ran Benita
ran234 at gmail.com
Fri Dec 16 13:11:06 PST 2011
On Fri, Dec 16, 2011 at 05:10:45PM +0100, Lennart Poettering wrote:
> On Fri, 16.12.11 12:41, Ran Benita (ran234 at gmail.com) wrote:
>
> >
> > On Thu, Dec 15, 2011 at 04:01:05PM +0100, Lennart Poettering wrote:
> > > On Fri, 09.12.11 03:00, Ran Benita (ran234 at gmail.com) wrote:
> > >
> > > > + _username = username;
> > > > + r = get_user_creds(&_username, &uid, &gid, &home);
> > > > + free(username);
> > > > + if (r)
> > > > + return NULL;
> > > > +
> > > > + /* specifier == '~' */
> > >
> > > Do we really want '~' here, and not 'h'? Sounds a bit weird to me to
> > > chain up weird characters like % and ~ in a sequence. %h might be less
> > > of a surprise to the user?
> > >
> > > And please pass uid and gid as NULL, get_user_creds() can deal with
> > > that.
> > >
> > > > + return strdup(home);
> > >
> > > Otherwise looks fine. Thanks!
> >
> > May I also ask why specifier expansion is not allowed in Exec= lines? I
> > think it's useful, and it works fine when I patch it. Is it problematic
> > in any way?
>
> Hmm, it is allowed. In getty at .service for example, we have this:
>
> ExecStart=-/sbin/agetty %I 38400
>
> and it works fine?
Hmm, yes that works. I see service_spawn() expands the command
arguments, but not the path, which is what I tried. I previously
looked at config_parse_exec() in load-fragment.c.
So my question becomes, why not expand the path? (It seems intentional).
Ran
More information about the systemd-devel
mailing list