-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Syncthing update deletes syncthing
user and has permissions issues
#3414
Comments
These are all changes due to the fact that the SynoCommunity made the packages suited for DSM 6 in a new framework. DSM 6 packages are running as a hidden user and permissions have to be granted via the groups sc-media and/or sc-download. Port changes are not supported by DSM, so you have to use the port that is configured during the package installation. Disappearing icons are mostly due to the fact that only for the admin a icon is placed by default on the desktop, for all other users you must first give permissions via the privileges wizard in the control panel. On a more personal note: |
After upgrading syncthing didn't seem to start, so I went to look for the cause:
Line number 6:
It seems something in this isn't correct. This is the case for two Synology servers with this package installed.
Then, I managed to get this error and the home path was incorrect:
Which was fixed by adding this line at the top of /var/packages/syncthing/scripts/service-setup:
Yep, you guessed it, onto the next issue:
No permissions at all? More files seem to have this.
I don't seem to be able to setup the permissions correctly for this... |
For command line start / stop / status, it is now required to use Synology tool or else set few documented environment variables: https://github.com/SynoCommunity/spksrc/wiki/Frequently-Asked-Questions#how-to-query-package-status-or-start-from-command-line Our framework and packages are far complex enough to also support custom service port. Desktop icon is generated with default service port as documented in https://github.com/SynoCommunity/spksrc/wiki/SynoCommunity-Used-Ports I have no idea what happened to "var" content which is supposed to be properly handled at upgrade. I propose you check there is no "syncthing" process running before removing Please report log file content then. In case you upgraded from DSM 4.x, it is important to migrate Shared Folder with "Windows ACL" support - see https://github.com/SynoCommunity/spksrc/wiki/Permission-Management for details. |
Before the update, the icon from the Main Menu and the link from package centre worked fine with my custom service port (I think, I have no means of confirming this). The icon has now entirely disappeared. |
I manually removed the lock file and started the package with synopkg:
Same error
File doesn't exist:
As the sc-syncthing user, I can't access this folder:
|
@cmangla @Techwolf12 Don't mess with the user, the DSM 6 packages are running as an hidden user and cannot be used for setting permissions. |
@BenjV The custom port was working perfectly fine in DSM 6 before the Syncthing package update. Even now, I am using a custom port, which still works. I just need to manually add that to the firewall. The previous package added an icon to my Main Menu, which I could simply click to open the Syncthing interface in a new tab, with my alternative port. I think that worked out of the box, but it is possible I hacked it in a long time ago and forgot about it. |
The icons and the firewall setting are set during package installation and cannot be changed. Of course you can hack into the system and change things, but the point is that with a next upgrade of DSM you have a good change that things are not working anymore. And changing the port is completely useless, what use would it have? |
@BenjV The problem is that the package already didn't work after upgrading, if was working I wouldn't be messing with it. I've manually created a user, gave permissions to the folder in appstore via a chown, ran the program via Task scheduler and it works. If someone finds out what the issue with the package is, I would love to hear it. |
If you don't get that option then it is already supporting ACL's In stead of giving all kind of information what happens when you try to start it manually, you should post the log files from a normal installation/start of the package. Just now I installed syncting and started it without any problem. |
Here is the install log, as we can see from "Granting 'sc-syncthing' unix ownership on /volume1/@appstore/syncthing/var", the script tries unix permissions instead of ACL. Which is correct. The issue is NOT with the shared folders and their permissions. Manually running works, running via the package doesn't.
Or the folder isn't supposed to use ACL, as it is a system folder. Not accessible from the web-interface.
See the install log above and the other logs in my previous comments which might contain valuable info for the developers.
Fresh install? This was an existing install that was upgraded. I believe the issue is in the user change. |
/volume1/@appstore/syncthing/var is the installation folder for the software and there just linux permissions are used. If you have a problem with an upgrade then the shared folders you are using don't have the correct permissions. If there are existing folder(s), subfolder(s) and file(s) you have to grant the group "sc-syncthing" read/write permissions via FileStation to those. |
Exactly, this is where the issue is at, not the shared folders. I was modifying the permissions of this folder to get it working. |
Not possible because the install script set the permission correct for those folders during the upgrade. I advise you to uninstall synthing and do a fresh install to be sure you did not mess up more. On a personal note, syncthing uses far to much resources to my opinion, the standard tools from Synology do a much better job than syncthing. |
Reinstalling is a fix yes, however the package needs to be fixed so an upgrade would just work (#3058). The package upgrade messed itself up.
Nope, sorry, it didn't. Which is why I started to fix this manually. I'm thinking you are not getting this issue at all, so let's clear the discussion for the developers so they can fix the upgrade script :) |
I understand perfectly what you are saying but your conclusion is simply wrong. When the package center does an upgrade it saves certain (config) files to a temp directory and then removes the complete installation. |
@Techwolf12 The reason of file permissions mess is that you have run Conclusion: I have to improve script to fail if invoked as root when not expected |
Setup
Package Name: Syncthing
Package Version: 0.14.49-15
NAS Model: DS213
NAS Architecture: armv5tel
DSM version: DSM 6.2-23739 Update 2
Expected behavior
Package update should correctly deal with custom configurations.
Actual behavior
Steps to reproduce
1. Install the Syncthing update
2. Follow displayed instructions on setup for sc-syncthing
3. Fix the firewall settings in-case the settings for Syncthing are incorrect after update
Package log
/usr/local/syncthing/var/syncthing_install.log
_/usr/local/syncthing/var/syncthing.log
_The text was updated successfully, but these errors were encountered: