[systemd-devel] systemd user sessions?

Michael Chapman mike at very.puzzling.org
Thu Feb 25 08:56:51 UTC 2016


On Wed, 24 Feb 2016, Jon Stanley wrote:
> I'd like a systemd unit (and only that unit) to be controlled by a
> specific user. The unit runs as this user, so I thought about user
> instances of systemd. This service should be started when the system
> starts, so you'd have to enable linger in systemd-logind for that to
> work.
>
> The question is how to make the systemd user *service* start at boot?

loginctl enable-linger $username

A user with lingering enabled will have their user instance started at 
boot and stopped at shutdown. The above command will immediately start the 
user instance if it is not already running (i.e. if the user does not 
currently have any sessions).

- Michael


More information about the systemd-devel mailing list