Re: Starting systemd user services on boot on a Debian server
Ansgar Burchardt wrote:
> Fredrik Jonson <fredrik@jonson.org> writes:
> > What is the recommended way to set up Systemd user services with Debian?
>
> Just run 'loginctl enable-linger [USER]' as root.
Initially that didn't work...
root@host# loginctl enable-linger foouser
Failed to create bus connection: No such file or directory
A quick google seems to indicate[0][1] that it is related to dbus somehow.
I checked, and the server didn't have dbus installed on the machine, so I
installed it (apt-get install dbus) and reran the command:
root@host# loginctl enable-linger foouser
This time the command ran without any apparent objections from the system.
Next, I create my unit in $HOME/.config/systemd/user/foo.service but
systemctl fails to enable it:
foouser@host$ systemctl --user enable foo.service
Failed to get D-Bus connection: Connection refused
Now what?
I notice that there isn't a systemd or dbus instance running under the user.
Should there be, and if, what's responsible for starting it?
Additionally, when I try to start a user instance manually, it fails:
foouser@host$ systemd --user
Trying to run as user instance, but $XDG_RUNTIME_DIR is not set.
[0] http://immae.eu/blog/2014/05/26/manage-your-session-with-systemd/
[1] https://lists.archlinux.org/pipermail/arch-general/2014-May.txt
--
Fredrik Jonson
Reply to: