[systemd-devel] require a system service unit to start a user service as a dependency

John graysky at archlinux.us
Thu Dec 24 02:47:48 UTC 2020


I need to have the following start
/usr/lib/systemd/user/pulseaudio.service so it can make use of
pulseaudio.  Using a After= or Wants= does not work.  What is the
correct way to have a system service like this run a user service
unit?

% cat /usr/lib/systemd/system/kodi.service
[Unit]
Description=Kodi standalone (GBM)
After=remote-fs.target network-online.target nss-lookup.target
sound.target bluetooth.target polkit.service upower.service
mysqld.service
Wants=network-online.target polkit.service upower.service
Conflicts=getty at tty1.service

[Service]
User=kodi
Group=kodi
EnvironmentFile=-/etc/conf.d/kodi-standalone
TTYPath=/dev/tty1
Environment=WINDOWING=gbm
ExecStart=/usr/bin/kodi-standalone
ExecStop=/usr/bin/killall --user kodi --exact --wait kodi-gbm
Restart=on-abort
StandardInput=tty
StandardOutput=journal

[Install]
Alias=display-manager.service


More information about the systemd-devel mailing list