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

Lennart Poettering lennart at poettering.net
Mon Aug 1 14:36:23 PDT 2011


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.
> Regards.

Allowing unprivileged users to install unit files in the search path of
the main systemd instance is quite dangerous since there is only one
namespace and users hence could do stuff with it, that they shouldn't.

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. 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. ~/.config/systemd/user/ is where you can then place unit files
private to the user.

This is implemented via a service user at lennart.service which is
instantiated for each user and runs a per-user systemd.

As mentioned, this isn't complete yet, so ymmv.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list