You are not logged in.
Cannot get a systemd user service to start automatically at system boot without user logging. The 'linger' is enabled for the user. Manually with 'systemctl start' the service starts OK. Systemd manual for "loginctl enable-linger" reads:
Enable/disable user lingering for one or more users. If enabled for a specific user, a user manager is spawned for the user at boot and kept around after logouts. This allows users who are not logged in to run long-running services.
Does the phrase marked in bold mean that all user's services are automatically started at the system boot when lingering is enabled? If so, what could be the cause that the service doesn't start?
Last edited by nbd (2015-10-07 06:32:42)
bing different
Offline
Lingering means that the service would remain active even if the user of that service logs out of all his/her sessions. You have to log in once for the service to start. If you want the service to start on boot, then you'll have to create a system service and not a user service.
EDIT : Got it wrong... ignore what I said.
Last edited by hydracone (2015-10-07 10:24:26)
Offline
Well, it seemed to me that if systemd has a way to keep a service AFTER user's login, it's logically to have a way to start a service BEFORE login. Why then "a user manager is spawned for the user at boot" and not at first login? Anyways, maybe someone advise if there is a way to start a user service apart from with 'su' by root?
bing different
Offline
hydracone, the whole point of lingering is to allow user services to start without a user having to log in each time (e.g. a multi-user server). Also, nbd highlighted it from the manpage.
Manually with 'systemctl start' the service starts OK.
Have you enabled the service?
systemctl --user enable $yourservice
Otherwise, after I saw your post, I was like "oh, I've got the same issue", and I noticed how user services whose symlinks were in multi-user.target.wants would not start automatically, but symlinks in default.target.wants do. Perhaps you should check where the symlinks are placed after enabling them (I don't know why it's like this, though).
Last edited by ayekat (2015-10-07 05:48:14)
Offline
ayekat:
yes, that's was the issue: the service was enabled under a wrong target. After setting the correct target it starts OK. Thanks for the helping.
bing different
Offline
Oh yeah.... I didn't read through the man page thoroughly.... sorry about that nbd!!!
Offline