Kaizhao Zhang's Notes

A simple knowledge base

systemd-user

Systemd/User

https://wiki.archlinux.org/index.php/Systemd/User

Example

The following is an example of a user version of the mpd service.

~/.config/systemd/user/mpd.service

[Unit]
Description=Music Player Daemon

[Service]
ExecStart=/usr/bin/mpd --no-daemon

[Install]
WantedBy=default.target

Example with variables

The following is an example of a user version of sickbeard.service, which takes into account variable home directories where SickBeard can find certain files:

~/.config/systemd/user/sickbeard.service

[Unit]
Description=SickBeard Daemon

[Service]
ExecStart=/usr/bin/env python2 /opt/sickbeard/SickBeard.py --config %h/.sickbeard/config.ini --datadir %h/.sickbeard

[Install]
WantedBy=default.target

Last modified at: Tue, 5 Jan 2021 12:26:32 +0000