-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add systemd unit to snap packages #4015
Comments
It would need to be a user unit like we ship the Debian packages. I don't know enough about neither systemd nor really snaps to judge the best way to do this, so leaving for someone who does. |
Yes, IIUC a separate syncthing process will need to run for each user (that is member in the "users" or a "syncthing" group). I do not know if the network ports are required to be persistent over time and reboots. For servers including NAS devices (where users are not logged in directly), however, the syncthing processes must be system units. So a configuration option "start permanent server processes for syncthing users" is needed, and the user units should just abort if the system unit mechanism already started processes for the users. |
Ok, port numbers don't seem to be required to be persistent, but it makes very much sense to keep them persistent in system unit configurations, to have the server setup work reliably without separate discovery servers. |
@calmh @mhalano You do not know much about Snaps Packages, but does this¹ solve it? [1] https://wiki.archlinux.org/index.php/Snapd other ref for code http://majorsilence.github.io/Dev/docs/Services/linux-service |
@gutierri The second link seems right. The important line is "daemon: simple". Here is the meta data for 'snapweb' snap: https://pastebin.com/88289zj4 and here is the correspondent Systemd unit: https://pastebin.com/ByDHGUa0 |
Any news about that? |
No-one has submitted a PR for this. So, no. |
@calmh Are you looking for a PR on the unit file itself, or the snapcraft.yaml to get the install to put this in? |
Whichever way solves the problem best. As said above, I'm not really the systemd nor snap guy. Our existing unit file is in use in the Debian packages and so on, so it can of course not become snap-specific, if that's even a thing. |
Being an user service, there's still no way to support this as we do for system services (as web apps are for examples). Once that support will be there, it will be possible to have this in place (with auto-reload on snap refresh). See this bug https://bugs.launchpad.net/snappy/+bug/1613420 |
until this is handled by the snap install. I just grabbed the syncthing@.service file from the syncthing project. Then changed the ExecStart to point to syncthing@.service
I just saved this file in stop any existing syncthing instances running as my user.
set up systemd user service
then checked if it started correctly
all is good and it's working. |
hi @josephRice I encountered the same issue, but unfortunately still failed to start syncthing systemd services. |
Please do not pollute issues with support questions. |
Some clarify why this is closed. |
I tested Syncthing Snap and works great. The only problem is I need to start the service manually with:
$ snap run syncthing
Some Snaps provides a system service. May be this could be a problem with Syncthing which uses a user service instead of a system service on non-Snap packages.
So I think should be a way to start Syncthing Snap-version automatically with a Systemd service.
The text was updated successfully, but these errors were encountered: