Linux: Start user processes or systemd units at boot time with systemd


systemd based system have the ability to start user processes in background and as daemon even the user isn’t logged on to the system.

Instead of defining a system systemd unit which switches the user at process start time, for example


systemd user units can also be started and stopped by the user itself.

You just have to create a systemd unit.

michael@debdev ~# mkdir -p $HOME/.config/systemd/user
michael@debdev ~# vi $HOME/.config/systemd/user/myprocess.service

Content of myprocess.service is like

Description=My Process



Important is the option!
Enable the unit and start it

michael@debdev ~# systemctl --user enable myprocess.service
michael@debdev ~# systemctl --user start myprocess.service

If you want to start the unit at boot time you have to enable linger for the user.

root@debdev ~# loginctl enable-linger michael

Michael PuTTY Advanced download

Advertisment to support

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.