Chapter 24. Use systemd for user services
This is how to set up a user-specific automated systemd process, i.e., a way to replace startup scripts that used to live in /etc/init.d. This process should work for any user service; this example is for Dropbox.
-
Stop existing services
Stop any existing Dropbox processes
-
Create a systemd user service
mkdir -p ~/.config/systemd/user/cp ~/Dropbox/Basic/new_machine/linux/config/dropbox.service ~/.config/systemd/userNote
dropbox.service[Unit] After=local-fs.target network.target Description=Dropbox as a user service [Service] Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus Environment=DISPLAY=:0 ExecStart=%h/.dropbox-dist/dropboxd Restart=on-failure RestartSec=1 Type=simple [Install] WantedBy=default.target
Source: archlinux forum.
-
Test it
systemctl --user startdropbox.serviceView the log with
journalctl --user --unit=dropbox -
If it works, automate it.
systemctl --user enabledropbox.service