[systemd-devel] User services

Gustavo Sverzut Barbieri barbieri at profusion.mobi
Mon Jan 23 06:22:46 PST 2012


On Mon, Jan 23, 2012 at 11:51 AM, Mike Kazantsev <mk.fraggod at gmail.com> wrote:
> On Mon, 23 Jan 2012 09:16:52 +0100
> Christian Hesse <list at eworm.de> wrote:
>
>> 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?
>
> No solutions from me, sorry, but I think I can outline one more problem
> - "mount" command and fuse filesystems.
>
> If you do "mount /somewhere/something" as user (think remount from an
> ssh session on a server), fuse-created process (sshfs, unionfs, ...)
> will be spawned in user's session regardless of whether .mount unit
> exists for that particular mountpoint.
> When user exits, process will be killed, and any operation on the
> mountpoint will produce something like ESHUTDOWN, without really
> unmounting anything either.

Guys, you're misunderstanding that setting usage and the purpose.

People who will set kill-session-processes=1 are sysadmins that really
do not want user processes to stay after they went out. Imagine an
university campus, you do not want one student to leave background
tasks after he logged out, they could interfere with the next student.

For common desktops/laptops there should be no need for this setting,
that's why it's off by default.

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbieri at gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202


More information about the systemd-devel mailing list