[systemd-devel] User services

Christian Hesse list at eworm.de
Mon Jan 23 00:16:52 PST 2012


Hello everybody,

I think systemd caring about session is a great idea and I added
"kill-session-processes=1" to systemd's configuration in pam files.
However this brings some problems. (Two for me to be precisely.)

First one was tmux. Detaching a tmux session and logging off used to kill the
tmux session as well. I fixed this with a patch by Ben Boeckel, adding pam
support to tmux. The tmux server now starts a pam session, thus systemd does
no longer kill it. If anybody is interested:
http://www.eworm.de/download/linux/tmux-pam.patch
(Though the tmux maintains are not willing to include it as they think it's a
design flaw in systemd to kill processes if a session ends.)

Ok, now my "real" problem. How about services started for a user?
ssh-agent for example suffers the same problem. I used to start one instance
per user, sharing socket information via temporary file. systemd kills
ssh-agent if my first session is closed, leaving all others without
authentication daemon.

Anybody with a solution for that?
I thought about a ssh-agent at .service file that has a service section like
that:

[Service]
Type=forking
User=%i
ExecStart=/usr/bin/ssh-agent > /run/ssh-agent@%i

But I could not find a solution how to start a process for a user. Any
thoughts, solutions, whatelse?
-- 
Best regards,
Chris
                         O< ascii ribbon campaign
                   stop html mail - www.asciiribbon.org


More information about the systemd-devel mailing list