3 ms·
On Ubuntu (and probably other distros that use Systemd as well) you need to enable the user service manually once for your user: systemctl --user enable --
by raek 5y ago
On Ubuntu (and probably other distros that use Systemd as well) you need to enable the user service manually once for your user:
systemctl --user enable --now syncthing.service
This will start syncthing whenever your user session is active. By default that means when you login. If you run this command:
sudo loginctl enable-linger $USER
Then your user service manager will be started at boot and run regardless if you are logged in or not. (The default behavior makes more sense on desktop and laptop computers.)
- raek 5y agoMore information: https://docs.syncthing.net/users/autostart.html#using-systemd https://docs.syncthing.net/users/autostart.html#using-system... The Debian/Ubuntu packages ship all the needed files. You only need to activate them.
- deaddabe 5y agoThanks! I will use the enable-linger on the NAS running 24/7, and configure it using a remote browser (probably via SSH tunnel). This way I can always sync to NAS even if everything else is off, and the laptop/desktop will sync from the NAS when required.
- raek 5y agoI saw just now that there are also system units (started with "systemctl enable --now syncthing@USER_NAME_HERE.service", note the lack of --user). If you use those then you don't need to activate linger. Using those is probably considered the more standard way of doing things on an unattended server.
- deaddabe 5y agoNice catch, this usecase seems common enough.
- jszymborski 5y agoSupervisord also works really well for this purpose https://docs.syncthing.net/users/autostart.html#using-supervisord https://docs.syncthing.net/users/autostart.html#using-superv...