Re:Syncthing – a continuous file synchronization program
by raek on Thursday October 14, 2021 @04:46AM
(#28861885)
On Ubuntu (and probably other distros that use Systemd as well) you need to enable the user service manually once for your user:
This will start syncthing whenever your user session is active. By default that means when you login. If you run this command:
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.)
[ Parent
| on HN ]
Re:Syncthing – a continuous file synchronization program
by raek on Thursday October 14, 2021 @04:50AM
(#28861900)
More information: https://docs.syncthing.net/users/autostart.html#using-system...
The Debian/Ubuntu packages ship all the needed files. You only need to activate them.
Re:Syncthing – a continuous file synchronization program
by deaddabe on Thursday October 14, 2021 @05:02AM
(#28861958)
Thanks! 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.
Re:Syncthing – a continuous file synchronization program
by raek on Thursday October 14, 2021 @05:08AM
(#28861990)
I 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.
Re:Syncthing – a continuous file synchronization program
by deaddabe on Thursday October 14, 2021 @06:07AM
(#28862322)
Nice catch, this usecase seems common enough.
Re:Syncthing – a continuous file synchronization program
by jszymborski on Thursday October 14, 2021 @11:40AM
(#28865813)
Supervisord also works really well for this purpose
https://docs.syncthing.net/users/autostart.html#using-superv...