[systemd-devel] User Login and custom .service file

Ran Benita ran234 at gmail.com
Fri Nov 25 14:10:01 PST 2011


On Fri, Nov 25, 2011 at 03:50:06AM +0000, Malte Brandy wrote:
> Lennart Poettering <lennart <at> poettering.net> writes:
> > On Mon, 01.08.11 13:31, George Stefan (stefan.george87 <at> gmail.com) wrote:
> > > Hi,
> > > I have a system configuration that requests the possibility of having
> > > multiple users. Does systemd allow us to have a path (like
> > > /lib/systemd/system) custom to each user? By this i mean something like
> > > "/home/user/systemd" where to have the associate .service/target/etc placed.
> > What you can do already is run a per-user instance of systemd, where the
> > user can add his services. This is not complete yet, but it should
> > already get you quite far.
> 
> Hello, im probably breaking quite a lot of mail list rules be this mail.
> Especially because its quite old... 
> But this is problem driving me crazy for quite a while. But first I must say,
> that I love systemd.
> I use systemd --user and it's awesome. I start my xorg, my syncmail, mpd, etc.
> 
> > To make use of this use "systemd-loginctl
> > enable-linger lennart" (for a user lennart). This will make sure that a
> > systemd instance is automatically started at boot for this
> > user.
> 
> This just wont work for me:
> sudo systemd-loginctl enable-linger maralorn
> Failed to issue method call: Failed to execute program
> /usr/lib/dbus-1.0/dbus-daemon-launch-helper: Success
> 
> > This is implemented via a service user <at> lennart.service which is
> > instantiated for each user and runs a per-user systemd.
> I already tried modifiying this service in some ways but without success.
> I can start it like user <at> maralorn.service, but when I try 
> systemctl --user
> I get: 
> Failed to issue method call: Process /bin/false exited with status 1
> I figure this is a problem with dbus and sessions but I'm not sure.
> 
> As a workaround I start the 
> systemd --user from an already established tty session. 
> > As mentioned, this isn't complete yet, so ymmv.
> I know, but i think my problem is not unsolvable...
> 
> Greetings Malte
> 
> Archlinux Kernel 3.1
> Systemd 37 and some previous.

Hi,
I actually tried to get this to work once (I'm now using pretty much the
same system as you).
The enable-linger part worked for me. It seems all it does is create a
file named after the username under /var/lib/systemd/linger; I did have
to manually create /var/lib/systemd, since it wasn't created otherwise
and the command fails when it's not there (perhaps the code should do a
mkdir -p instead?).
As for the systemctl start user@<username>.service, I figure it's not
supposed to be enabled manually but to start automatically. Alas, it's
not implemented yet (i.e user_start_service() at logind-user.c is just a
stub).
When I try systemctl start user@<username>.service, as you tried, it
does start a user instance which works properly, so I can't say what's
going wrong for you there. Is there anything written to the logs?


More information about the systemd-devel mailing list