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

Transmission 2.84 doesnt work on DSM6 beta1 with brtfs file system. #1880

Closed
qubabos opened this issue Oct 15, 2015 · 39 comments
Closed

Transmission 2.84 doesnt work on DSM6 beta1 with brtfs file system. #1880

qubabos opened this issue Oct 15, 2015 · 39 comments
Labels

Comments

@qubabos
Copy link

qubabos commented Oct 15, 2015

Hello there,
When I set volume in brtfs file system after instalation of transmission package service cannot start in DSM6.0 beta. I think its permission related. When i create volume in ext4 during service configuration (when I set download directories) i can view user transmission and assign priviliges to download folders. When i finish this install wizard, package installing correctly and service is up and working. In brtfs file system it doesnt work at all. I try to change folders permissions to users group or everyone but it also doesnt resolve this issue.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Oct 16, 2015

Your explanation isn't completely clear to me, but let's see if I've interpreted you correctly.

Like a lot of packages, Transmission needs certain permissions on the download dir and other locations. We set those permissions during package installation.
Regardless of the underlying file system, if you recreate the volume on which those directories are located, the permissions are lost.
If you don't know how to correct those permissions manually, just remove and reinstall the package.

@qubabos
Copy link
Author

qubabos commented Oct 16, 2015

For an example - I create shared /volume2/transmission (volume2 is brtfs file system). admin, guest users and administrators group has permissions to read/write. installing package transmission like any other and during install wizard seting /volume2/transmission as download directory (without watch and incomplete dir's). next web interface user (different from build in dsm accounts), next, apply. After that i get popup "Failed to run the package service".
When installing package on ext4, in the middle of basic package config (without finish him by apply) when I check folder permissions I can add permissions for user "transmission" for filesystem. After hit apply and complete package install and up to run - this user "transmission" cannot be viewed and no permission to filesystem can be updated/ changed or modified.
Removing and reinstall the package doesnt resolve this issue.
when i try to add permissions from ssh console i use

cd volume2
chmod -R 777 transmission/
chown -R transmission:users transmission/

also package service cannot start. right now I have this issue same on ext4 clean volume1. DSM was installed from scratch - NAS was restored to factory defaults.

some logs :
2015-10-16_111824
2015-10-16_111924

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Oct 16, 2015

Let's start at the beginning. I would prefer it if you uninstalled the Transmission package, created a shared folder called downloads on volume1 and set r/w permissions for the users group via the GUI for that shared folder. Nothing else.
Then install Transmission, without making any changes during the installation process. That way, I more or less know that you have started with a clean setup.

If the package starts, great. If not, run the following command:

su transmission -c "PATH=/usr/local/transmission/bin:/usr/local/python/bin:${PATH} /usr/local/transmission/bin/transmission-daemon -g /usr/local/transmission/var/ -x /usr/local/transmission/var/transmission.pid"

If it does not show any errors and returns to the prompt, I would expect a running process (confirm with ps -w | grep transmission and the web interface should be available at http://nas-ip:9091.
If something else happens, please provide that info.

To be clear, DSM6 has a lot of unknowns at this point. There might not be a fix available immediately. If you are not prepared for that, I would suggest to go back to DSM5.x.

@rjulie95
Copy link

Hi,

This issue is 'su' not working yet on DSM 6.0

The copy of message receve to the synology support :

After consulting with our PM team, unfortunately, this feature hasn't been supported. However, you would be able to switch the user by the "sudo su" command after the final official version is released.

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Oct 21, 2015

Hm...seems Synology has replaced busybox with a more traditional shell on DSM6?
Seeing their message, sudo -u ${USER} [...] might work as a replacement, or we can maybe look at using start-stop-daemon for all packages.

If we go for the first, we'll have to make sure that packages will continue to work on both DSM5 and DSM6 with some additional logic (similar to the http/nobody approach, I imagine). Problem is that the sudo command isn't actually available at this point, so that means no fix until Synology releases DSM with it included.

On the other hand, using start-stop-daemon would seem overkill for packages that have their own daemon built-in. I'm not sure I like that either :/

@SynoCommunity/developers, ideas or suggestions?

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Oct 21, 2015

Although this doesn't explain @qubabos' problem, if he experiences a difference between a package running on btrfs vs ext4. It either means those observations were incorrect, or that this is a completely unrelated problem.

@rjulie95
Copy link

Hi,

A this time all package that I use works on DSM6
Y confirm busybox is replaced by tradional shell. But a this time sudo is not fonctionnal in the first beta

On all my package I pulled the line 'su' for start-stop-status and all work fine

@rjulie95
Copy link

Y have same problem that @qubabos !
Y juste change the line in start-stop that solve my problem
you can see an explanation here, sorry is in french : http://www.nas-forum.com/forum/topic/49155-dsm-60-sabnzbd-ne-se-lance-plus/

And this same solution for all package, for transmission also

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Oct 21, 2015

@rjulie95 If you remove su, that means you're running all packages as root. That's not how our packages are intended to run, and you might experience problems because of that.

@qubabos
Copy link
Author

qubabos commented Oct 21, 2015

i finally manage to resolve this by replacing permissions for /var/packages/transmission with no manual edit of script files or spk package.

@rjulie95
Copy link

Yes I understand

@rjulie95
Copy link

What have you changed ? It's possible to explain ?

Thank

@qubabos
Copy link
Author

qubabos commented Oct 21, 2015

of course, sorry - changing chmod 777 -R for /var/packages/transmission and also (not sure if this is it) adding write for "users" group for download folder. I restored previous settings.json from dsm 5.2 (need to convert volumes for btrfs) and package service runing just fine.

@rjulie95
Copy link

And on start-stop-status shell do you have a 'su' command ?

@qubabos
Copy link
Author

qubabos commented Oct 21, 2015

no, leave it as it was in dsm 5.2.

@rjulie95
Copy link

It's possible to verify if you have busybox on your NAS ?

@qubabos
Copy link
Author

qubabos commented Oct 21, 2015

ash-4.3# sudo
ash: sudo: command not found
ash-4.3# su
ash-4.3#

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Oct 26, 2015

So if I'm understanding the progress correctly here, this isn't actually a problem (anymore)?

@qubabos
Copy link
Author

qubabos commented Oct 26, 2015

yes. it has been resolved for now but instalation out-of-box doesnt work anymore. need some adjust by ssh

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Oct 26, 2015

That'll have to wait until DSM6 is officially released imo, because it might change during the time the beta is running. Especially since there are people running the same packages on DSM6 without problems, it doesn't seem to affect everyone.

@qubabos
Copy link
Author

qubabos commented Oct 26, 2015

i must noticed that upgrade with fully working package from dsm 5.2 performing fine and transmission works also just fine. when i totaly reinstall dsm 6.0 from scratch and change volume to btrfs this issue occurs. wait for people to change their volumes :)

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Oct 26, 2015

Ok. You might want to report that to Synology if you haven't already, because the underlying file system should not affect permissions. Although they'll probably say: yeah, third-party packages, no support ;)

@qubabos
Copy link
Author

qubabos commented Oct 26, 2015

yeah, right :) mark this as resolved :D thank you for your input, regards mate :)

@talisto
Copy link

talisto commented Nov 2, 2015

I got Transmission working on a fresh install of DSM 6.0b. Here's how I did it.

First of all, the installation of the package didn't create a Transmission user account. I'm not sure if that is supposed to happen as part of the installer or not. Regardless, I created a "transmission" user through the control panel.

Once the user was created, I SSHed into the NAS as root, and attempted to run the startup script manually, like so:

/var/packages/transmission/scripts/start-stop-status start

Then I got this error:

Starting Transmission ...
su: failed to execute /sbin/nologin: No such file or directory

The default shell for new users is /sbin/nologin, and running su transmission in the startup script initiates that shell in this line:

su ${USER} -c "PATH=${PATH} ${TRANSMISSION} -g ${INSTALL_DIR}/var/ -x ${PID_FILE}"

...so I took a hint from the Plex startup script and changed it to this:

su ${USER} -s /bin/sh -c "PATH=${PATH} ${TRANSMISSION} -g ${INSTALL_DIR}/var/ -x ${PID_FILE}"

...which forces it to use the GNU shell instead of /sbin/nologin.

Once I fixed the startup script, Transmission would run, but the Package Center wouldn't recognize it as running, and the /var/log/messages had a bunch of entries like this:

transmission-daemon[26813]: Couldn't save temporary file "/volume1/@appstore/transmission/var/settings.json.tmp.JGPvF5": Permission denied (variant.c:1227)
transmission-daemon[26813]: Unable to save pidfile "/usr/local/transmission/var/transmission.pid": Permission denied (daemon.c:573)
transmission-daemon[26386]: Couldn't save temporary file "/volume1/@appstore/transmission/var/settings.json.tmp.R8ioFW": Permission denied (variant.c:1227)
transmission-daemon[26813]: Couldn't save temporary file "/volume1/@appstore/transmission/var/settings.json.tmp.yEqk96": Permission denied (variant.c:1227)
transmission-daemon[27357]: Couldn't create "/usr/local/transmission/var//resume": Permission denied (utils.c:424)
transmission-daemon[27357]: Couldn't create "/usr/local/transmission/var//torrents": Permission denied (utils.c:424)
transmission-daemon[27357]: Couldn't create "/usr/local/transmission/var//blocklists": Permission denied (utils.c:424)

so I then chowned the transmission directory to the 'transmission' user, like so:

chown -hRL transmission /usr/local/transmission

..and then Transmission fired up just fine from the Package Center and everything works great. I used the exact same method to fix SABnzbd as well.

I hope that helps!

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Nov 3, 2015

@talisto (and others who choose to create a user manually via the DSM UI): Please note that your approach may very well result in a broken package when we release a DSM6-compatible version of this package. Running a beta has its risks, and this is one of them.

We (at least I) probably won't start looking into it until DSM6 is more mature, which means at least beta 2 and possibly even later than that.

@talisto
Copy link

talisto commented Nov 3, 2015

@Dr-Bean, I would hope that anyone using the DSM betas would anticipate and expect risks and complications along the way. I thought that sharing my experience getting the package working on the beta would help other users and even perhaps help the package maintainers when it comes time to troubleshoot these issues. The beta period for DSM 6.0 is a long 6 months and I'm sure there is going to be more and more activity on DSM 6.0 as it progresses.

With that said, perhaps having added a user through the DSM that would conflict with the package installation might be something that the package installation should anticipate, as it's certainly possible for that to occur in any version of the DSM.

@piwi82
Copy link
Contributor

piwi82 commented Nov 4, 2015

The SynoCommunity packages should not be distributed to DSM 6 beta as Synology has not released the tool chains for DSM 6. 😕

@Diaoul
Copy link
Member

Diaoul commented Nov 4, 2015

We will anticipate the release but for now it's a little early to tell if the issue is caused by DSM or by the package itself.
As @piwi82 said, that might as well be an issue due to the toolchain.

@Dr-Bean
Copy link
Contributor

Dr-Bean commented Nov 4, 2015

@talisto Not everyone has the same level of awareness with regards to the risks of using a beta. You didn't include that in your message, so that's why I commented :)

@piwi82 If we want to exclude packages from being distrubuted to DSM6, that'll have to be done via spkrepo (provide a catalog based on firmware level, or some kind of other key/value). Package Center isn't able to distinguish packages otherwise.
Otoh, we might not want that. Packages installed prior to upgrading work just fine (including package upgrades). From what I've seen, I think there's a relationship with busybox's adduser, as DSM6 switched to a different shell, but I haven't verified that yet.

/edit: we probably do need the new toolchains for packages that access or use kernel modules and things like that.

@cytec cytec mentioned this issue Nov 4, 2015
@Dr-Bean Dr-Bean added the dsm 6 label Nov 6, 2015
@gsaxam
Copy link

gsaxam commented Sep 5, 2016

I struggled for 2 days trying to get Transmission installed and running on my 216-II and finally tried talisto's trick and it worked. I just bought my NAS a few days ago and it came with DSM 6.0, however I was surprised to see that the OOB installation for Transmission failed.

@suykast
Copy link

suykast commented Dec 5, 2016

Or another solution, a easy way with SSH logged in as admin
Edit the file with "sudo vi /var/packages/transmission/scripts/start-stop-status" ("su" doesnt work on 6.0)
2 lines

USER="your username you choose within the install" <-- default is transmission

start_daemon ()
{
su - ${USER} -s /bin/sh -c "PATH= <-- add -s /bin/sh

Hit ESC, save with ":qw" (for the newbeesss)

Start script

/var/packages/transmission/scripts/start-stop-status start

Start transmission under Package Center and you will get the firewall setting
Start transmission again and open de the link http://your domain or ip:9091
In Package Center it will say "stopped but its working"

@ghost
Copy link

ghost commented Jan 17, 2017

This doesn't resolve it.

DSM 6.0.2-8451 Update 8
DSM date:
2017/01/06

@suykast
Copy link

suykast commented Jan 17, 2017

I have no probs with it, what error or issue do you have ?

@ghost
Copy link

ghost commented Jan 18, 2017 via email

@m4tt075
Copy link
Contributor

m4tt075 commented Sep 5, 2017

DSM6-compatible packages can be made available for testing purposes. If you are interested, please share your NAS model / architecture.

@qubabos
Copy link
Author

qubabos commented Sep 5, 2017

I will give a try to 64bit DSM6-compatible package for DS916+ :)

@m4tt075
Copy link
Contributor

m4tt075 commented Sep 5, 2017

Should be Braswell. Here you go:
https://www.dropbox.com/s/4x9vc58zmjncl2r/transmission_braswell-6.1_2.92-12.spk?dl=0
This is untested though. Please report back.

@byverdu
Copy link

byverdu commented Sep 24, 2017

@talisto solution works as a charm for the DS716+II on version DSM 6.1.3-15152. Thanks.... I was getting crazy!

@Safihre
Copy link
Contributor

Safihre commented Feb 19, 2018

Closing due to age. Test-packages for DSM6.1 and new architectures available here: #3138.
Those will later be published to the real package rep.

@Safihre Safihre closed this as completed Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests