Possible bug in Syncthing Serviceman script (no "systemctl enable" command?)
Hi, as per instructions at https://webinstall.dev/syncthing/, I ran the following commands to setup Syncthing automatic execution:
mkdir -p ~/.config/syncthing/
env PATH="$PATH" serviceman add --user --name syncthing -- syncthing --home ~/.config/syncthing/
which resulted in the following output:
> syncthing --home ~/.config/syncthing/
OPTIONS: Making some assumptions...
# Because this is your current working directory
--workdir /home/myuser
COMMAND: Service "syncthing" will be run like this (more or less):
# Starts as "myuser", when "myuser" logins
/home/myuser/.local/bin/syncthing --home /home/myuser/.config/syncthing
LAUNCHER: Starting systemd USER MODE service unit...
systemctl --user daemon-reload || true
systemctl stop --user syncthing.service || true
systemctl start --user syncthing.service || exit
This successfully brought up Syncthing, and correctly created a "syncthing.service" file under ~/.config/systemd/user/ dir.
However, after rebooting and logging again into "myuser", Syncthing was not started.
Looking back at above systemctl commands I noticed that a systemctl --user enable syncthing.service was missing, so I ran it myself and got
Created symlink /home/myuser/.config/systemd/user/default.target.wants/syncthing.service → /home/myuser/.config/systemd/user/syncthing.service.
And after this step I could verify that Syncthing was automatically starting on system reboot.
So in order to make thing clearer for other users or future myself, is this actually a bug in the serviceman script, or did I do anything wrong?
@coolaj86 Potentially (but not necessarily), related to https://github.com/webinstall/webi-installers/issues/635
Ah, I bet this is a bug in serviceman because user services on Linux haven't been tested very much.
I will investigate.