I tried to start at boot a service running in my user's context, which did not work with multi-user as target but only with default, i.e., graphical.
I enabled lingering for my user and the service
sudo loginctl enable-linger $USER
systemctl --user enable $SERVCE
systemctl --user start $SERVICE
However, the service did not got started after reboots.
The service originally targeted multi-user
[Install]
WantedBy=multi-user.target
i.e., resulting in the service link
$HOME/.config/systemd/user/multi-user.target.wants/SERVICE.service
Not as expected, the service did not got started at boot.
Only after changing the target to default
WantedBy=default.target
(which is currently graphical) and re-enabling the service, the service got started automatically.
However, I had assumed that graphical is downstream of multi-user as target, i.e., being 'later', or?
What may be have prevented the service to start with multi-user?
default.target
forWantedBy=
in.service
, andtimers.target
intimer
? as in https://niels.kobschaetzki.net/blog/2015/11/11/creating-systemd-timers-instead-of-a-personal-crontab/ – Grzegorz Wierzowiecki Jul 31 '16 at 15:42.service
has aWantedBy=
, as it will always be called explicitly from the timer unit. But the examples I have put aWants=....timer
in the[Unit]
part of the.service
. – meuh Jul 31 '16 at 15:51multi-user.target
in pastebin.com/8B5jLUkz output of systemd-analyze critical-chain ? (I am using Arch Linux -> maybe it's distro specific?) – Grzegorz Wierzowiecki Jul 31 '16 at 15:52