Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in Syncthing Serviceman script (no "systemctl enable" command?) #646

Open
illtellyoulater opened this issue Aug 30, 2023 · 2 comments

Comments

@illtellyoulater
Copy link

illtellyoulater commented Aug 30, 2023

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?

@mathwhiz1212
Copy link

@coolaj86 Potentially (but not necessarily), related to #635

@coolaj86
Copy link
Member

coolaj86 commented Sep 5, 2023

Ah, I bet this is a bug in serviceman because user services on Linux haven't been tested very much.

I will investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants