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

SABnzbd-Synology "failed to run the package service" #2416

Closed
regblade85 opened this issue Jul 24, 2016 · 25 comments
Closed

SABnzbd-Synology "failed to run the package service" #2416

regblade85 opened this issue Jul 24, 2016 · 25 comments
Labels

Comments

@regblade85
Copy link

Hi,

im a novice user so please excuse the ignorance.

I have installed SABnzbd on my synology DS1815+ and i keep getting the following message "failed to run the package service". Can someone please help.

@henrysingleton
Copy link

I'm having the same issue on a completely fresh DS916+ with DSM 6.0.1-7393 Update 2.

Running the start script manually returns this:

$ /var/packages/sabnzbd/scripts/start-stop-status start
Starting SABnzbd ...
Password: 
su: Permission denied

It seems the script is trying to switch user (su) to the sabnzbd user: su - ${USER} -c "PATH=${PATH} ${PYTHON} ${SABNZBD} -f ${CFG_FILE} --pidfile ${PID_FILE} -d"

Just running su - sabnzbd as root manually results in the same permission denied error:

# su - sabnzbd
su: Permission denied

Looking at the PAM config, according to its documentation, the pam_unix.so extension only allows users that have a password set to use su. I assume the sabnzbd user doesn't and probably shouldn't have a password set, so maybe the PAM configuration needs to change instead?

# cat /etc/pam.d/su
auth     sufficient     pam_rootok.so
auth     sufficient     pam_unix.so
account  sufficient     pam_unix.so
session  sufficient     pam_unix.so

Maybe the the PAM configuration changed in a recent DSM update? This is a little out of my wheelhouse, andI've only just got my NAS yesterday, so not sure if this is the right track.

@regblade85
Copy link
Author

Im going to be completely honest.....i have no idea what you just said. Im a novice with no development back ground.

Reg Kumar

On 26 Jul 2016 9:47 am, at 9:47 am, Henry Singleton notifications@github.com wrote:

I'm having the same issue on a completely fresh DS916+ with DSM
6.0.1-7393 Update 2.

Running the start script manually returns this:

$ /var/packages/sabnzbd/scripts/start-stop-status start
Starting SABnzbd ...
Password: 
su: Permission denied

It seems the script is trying to switch user (su) to the sabnzbd user:
su - ${USER} -c "PATH=${PATH} ${PYTHON} ${SABNZBD} -f ${CFG_FILE} --pidfile ${PID_FILE} -d"

Just running su - sabnzbd as root manually results in the same
permission denied error:

# su - sabnzbd
su: Permission denied

Looking at the PAM config, according to its documentation, the
pam_unix.so extension only allows users that have a password set to
use su. I assume the sabnzbd user doesn't and probably shouldn't have a
password set, so maybe the PAM configuration needs to change instead?

# cat /etc/pam.d/su
auth     sufficient     pam_rootok.so
auth     sufficient     pam_unix.so
account  sufficient     pam_unix.so
session  sufficient     pam_unix.so

Maybe the the PAM configuration changed in a recent DSM update? This is
a little out of my wheelhouse, andI've only just got my NAS yesterday,
so not sure if this is the right track.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#2416 (comment)

@henrysingleton
Copy link

henrysingleton commented Jul 26, 2016

That was more for the maintainers, no problem :)

Regardless, I obviously didn't search the current issue list enough, because there was a fix here that worked for me: #2207 (comment)

From what I can tell, when the sabnzbd install script ran, it created the users correctly, but for some reason they weren't added to the /etc/shadow file, which prevents the su command from working correctly.

To resolve this, I manually added the following line to the end of the /etc/shadow file:

sabnzbd:*:10933:0:99999:7:::

@regblade85 you could try amending your /etc/shadow file as described above. Note that you'll need to get SSH access and will need to edit that file as root. If you don't know what this means I wouldn't recommend trying as it would be very easy to make damaging changes to your system. There may be other ways to resolve this issue that don't involve editing that file manually.

I still have an issue with Sabnzbd being unable to write to folders on my volume but I assume I'll have to set up permissions elsewhere, which isn't really a bug.

@regblade85
Copy link
Author

This is where my noobness is going to come out. Have you got instructions to do this please?

Reg Kumar

On 26 Jul 2016 12:36 pm, at 12:36 pm, Henry Singleton notifications@github.com wrote:

That was more for the maintainers, no problem :)

Regardless, I obviously didn't search the current issue list enough,
because there was a fix here that worked for me:
#2207 (comment)

From what I can tell, when the sabnzbd install script ran, it created
the users correctly, but for some reason they weren't added to the
/etc/shadow file, which prevents the su command from working
correctly.

To resolve this, I manually added the following line to the end of the
/etc/shadow file:

sabnzbd:*:10933:0:99999:7:::

@regblade85 you could try doing the same then going to Package Control
and attempting to "Run" the sabnzbd package again.

I still have an issue with Sabnzbd being unable to write to folders on
my volume but I assume I'll have to set up permissions elsewhere, which
isn't really a bug.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#2416 (comment)

@madvtak
Copy link

madvtak commented Aug 3, 2016

@henrysingleton are you using root as the user?

@madvtak
Copy link

madvtak commented Aug 3, 2016

This is my output when I try the script ./start-stop-status start

Starting SABnzbd ... ./start-stop-status: line 22: PATH=/usr/local/sabnzbd/bin:/usr/local/sabnzbd/env/bin:/usr/local/python/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin /usr/local/sabnzbd/env/bin/python /usr/local/sabnzbd/share/SABnzbd/SABnzbd.py -f /usr/local/sabnzbd/var/config.ini --pidfile /usr/local/sabnzbd/var/sabnzbd.pid -d: No such file or directory

@regblade85
Copy link
Author

Btw sabz is working for me now

Reg Kumar

On 3 Aug 2016 6:50 pm, at 6:50 pm, madvtak notifications@github.com wrote:

This is my output when I try the script ./start-stop-status start

Starting SABnzbd ...
./start-stop-status: line 22:
PATH=/usr/local/sabnzbd/bin:/usr/local/sabnzbd/env/bin:/usr/local/python/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
/usr/local/sabnzbd/env/bin/python
/usr/local/sabnzbd/share/SABnzbd/SABnzbd.py -f
/usr/local/sabnzbd/var/config.ini --pidfile
/usr/local/sabnzbd/var/sabnzbd.pid -d: No such file or directory


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#2416 (comment)

@ghost
Copy link

ghost commented Sep 14, 2016

@henrysingleton Adding the line to the /etc/shadow file worked fine for me. Thanks for the tip!

@dels78
Copy link

dels78 commented Oct 26, 2016

Adding the line worked for me too! Thanks!

@mnathani
Copy link

mnathani commented Nov 3, 2016

I added the line to /etc/shadow, and sab worked, however the changes got reverted automatically and sab was no longer able to start. Any way to make the changes to /etc/shadow persistent?

@henrysingleton
Copy link

@mnathani Not sure, I assume this is a recent change in a newer version of dsm. I've been hesitant to upgrade because of something like this. Did it overwrite the changes to /etc/shadow after a reboot?

As an alternative, you could run sabnzbd as root, but I would recommend against it for security reasons.

@mnathani
Copy link

mnathani commented Nov 3, 2016

The changes to /etc/shadow got reverted even before reboot.

@horstepipe
Copy link

Hey Henry
I added the line to the shadow file, but I'm still getting the permission denied error.
How can I check whether the sabnzbd user was created at all?

DSM 6, DS414

Best regards

@horstepipe
Copy link

ok starting it via ./start-stop-status start results in the error, but I can start it via GUI in package center.
Thank you very much for the hint

@jrtwynam
Copy link

jrtwynam commented Dec 8, 2016

Hi,

I'm having a similar issue. I recently bought a Synology DS216j, and I'm trying to set SABnzbd up on it. I've installed the package, and at first it wouldn't even run. After doing some searching, I found a couple of sites that suggested adjusting the start-stop-status file so that it said USER="root", which worked. It allowed SABnzbd to run.

Now, the problem with this approach is that from what I can tell, it will run fine and download files fine, and even execute whatever post-processing script I choose without issue. However, the resulting files seem to have no permissions on them. I've even changed the setting within SABnzbd in Config/Folders so that it runs chmod 0777 on the file. This works, in the sense that it runs... but instead of it changing the permissions on the file to rwxrwxrwx, it changes them to rw-rw----. So my media server box, which is connected using an account I created (cunningly called media_server), is unable to see or do anything with the file. In order to watch these files on my tv, I need to manually adjust the permissions, which defeats the purpose of automating the download.

What I'd like to do is be able to run SABnzbd under the media_server account, but nothing I've tried has worked. In the GUI, I've allowed that account access to SABnzbd, and tried adjusting the start-stop-status file to run under that account, but it still won't start unless I run it as root.

What am I missing?

@KaraokeStu
Copy link
Contributor

As a temporary workaround, I have created a user called apps and added it to the group users, then set the script to use that user. Go to /var/packages/sabnzbd/target and run chown apps:users . -R

@jrtwynam
Copy link

jrtwynam commented Dec 9, 2016

That sounds very similar to what I've done. My account is called media_server, and it's added to the "users" default group automatically. I just tried your suggestion about the chown command, but it didn't help - it still gave me the "failed to run package" error.

As a workaround, what I've done is created a scheduled task the runs every 5 minutes, and executes this command:

find /volume1/"TV Shows" -type d -not -perm 777 -exec chmod 777 {} \;

It's not really the solution I'd like, but it'll do until I figure out why it's not letting me run it under any user account. I figure it should let me choose whatever account I want to run it under, but it seems to disagree.

@Veldkornet
Copy link

I've just setup a new Synology and installed SABnzbd. At first, I only needed to add the sabnzbd user to the /etc/shadow file and then everything was working.

But now after a reboot, it no longer works. When I say, /var/packages/sabnzbd/scripts/start-stop-status start, it tells me that the user sabnzbd does not exist.

So as per advice above, I made the sabdnzbd user, I've added it to the "Users" and "sc-download" group, changed ownership (cd /var/packages/sabnzbd/target, sudo chown -R sabnzbd:sc-download .)

But now when I try to start it, it asks me for the sudo password , but I just get the error "su: Permission denied". Also, it doesn't start via the GUI.

So what am I missing, how can I get this working again.

@regblade85
Copy link
Author

regblade85 commented Apr 24, 2017 via email

@Hubfront
Copy link

Hubfront commented May 7, 2017

I wonder if this package is still installing and running on DSM 5? I plan to downgrade to DSM 5.2.

@KaraokeStu
Copy link
Contributor

Yes, it still works perfectly on DSM 5.x

That said, I don't think it'll be long now before we have the user scripts sorted to get DSM 6 compatible (at least with the testing/beta package)

@Hubfront
Copy link

Hubfront commented May 7, 2017

Hi, that sounds great. If im completely wrong about this, please correct me: You developers are really doing a great job with spksrc but it seems to me synology has failed completely to support you with technical help since they come up with DSM 6. They must be stupid not to honor what you do for attractiveness of their nas. I hope, my english is understandable at least. I know, they make the big money with their big nas and this community is more directed towards the home users, but i still think they are stupid with not showing enough respect for the work you developers do for the community in your spare time.

@KaraokeStu
Copy link
Contributor

Thanks for the vote of confidence. We are still working on the DSM 6.x support, and we finally have some tool chains released to work with. Time is our only enemy now!

@Hubfront
Copy link

Hubfront commented May 10, 2017

It's not so easy to downgrade from 6.1.1, so i just did a reset of 6.1.1 for a fresh start, keeping my data. So far i only installed nzbget and did manually create the necessary user and permissions befor installing the package: #2526 (comment)

It works but i understand after doing it myself, that user creation is different now with DSM 6.

@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