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

Update syncthing guide (https://webinstall.dev/syncthing/) for system execution? #624

Open
illtellyoulater opened this issue Jun 15, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@illtellyoulater
Copy link

illtellyoulater commented Jun 15, 2023

At https://webinstall.dev/syncthing/ the serviceman command used to create a Syncthing service for the current user is:

env PATH="$PATH" serviceman add --user --name syncthing -- syncthing --home ~/.config/syncthing/

How can I modify the above line to create a service for starting Syncthing at system startup independently of users logging in? Would that simply become:

env PATH="$PATH" serviceman add --system --name syncthing -- syncthing --home ~/.config/syncthing/

Yes I am aware this would (if correct) start the specifc Syncthing instance installed by the user below their home dir, but I would be fine with that.
Btw, what's the meaning of PATH="$PATH" ?

@illtellyoulater
Copy link
Author

illtellyoulater commented Jun 15, 2023

Ok I think the correct way to do this for a service installed with webinstall by a regular user within their home dir, is to leave untouched the original serviceman command:

env PATH="$PATH" serviceman add --user --name syncthing -- syncthing --home ~/.config/syncthing/

and then, agin from the user shell do:

loginctl enable-linger $USER

which enables user lingering as explained here https://mycorrhiza.wiki/hypha/systemd_101 meaning user services will keep running even when the user is not connected, making it work similarly, I guess, to a system service.

Can someone confirm this is ok? If so, please consider addng it to https://webinstall.dev/syncthing/ as I'm certain it would save quite a few headaches...

@coolaj86
Copy link
Member

coolaj86 commented Jul 4, 2023

@illtellyoulater It looks like you're running this on Linux?

I think it's fine to use enable-linger, but I also think a system service might be more appropriate for your use case.

When I'm on Linux I'm almost exclusively using --system --username "$(id -u -n)".

@coolaj86 coolaj86 added the documentation Improvements or additions to documentation label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants