BenjV / SYNO-packages

43 stars 10 forks source link

Autosub DSM6.0 package will not start #8

Open Northguy opened 5 years ago

Northguy commented 5 years ago

Installed the latest DSM package, but the service fails to start.

Result from /var/log/synopkg.log:

2018/10/13 22:45:44     start autosub: begin to start version 1.2.5
2018/10/13 22:45:48     start autosub 1.2.5 Begin start-stop-status start
Autosub would not start!
2018/10/13 22:46:06     start autosub 1.2.5 End start-stop-status start ret=[1]
2018/10/13 22:46:11     (system) trigger autosub 1.2.5 Begin start-stop-status stop
No autosub.pid file found. Assuming autosub is not running
2018/10/13 22:46:11     (system) trigger autosub 1.2.5 End start-stop-status stop ret=[0]
2018/10/13 22:46:12     stop autosub: begin to stop version 1.2.5
2018/10/13 22:46:12     stop autosub: stop version 1.2.5 successfully, result 0
2018/10/13 22:46:13     start autosub: start version 1.2.5 failed, result 272

autosub user as well as sc-media group has gotten access on video shared folder.

BenjV commented 5 years ago

To little informatie. Try a reboot of your Nas.

Northguy commented 5 years ago

Followed the following steps:

  1. Performed a reboot,
  2. provided internal user autosub read/write access on /volume3/videos
  3. provided user group sc-media read/write access on /volume3/videos

Tried to start the Autosub package through the package center -> Result = package tries to start, but fails.

Did some more investigation. Tried to start the package through SSH. Got the following:

#########@#########:/var/packages/autosub/scripts$ sh start-stop-status start /var/packages/python/target/bin/python: can't open file 'AutoSub.py': [Errno 2] No such file or directory Autosub would not start!

Apparently the start script cannot run Autosub.py

Looked up the python binary:

@######:/var/packages/python/target/bin$ dir py*

-rwxr-xr-x 1 root root 101 May 28 16:48 pydoc -rwxr-xr-x 1 root root 247 Jul 14 20:36 pyhtmlizer lrwxrwxrwx 1 root root 7 May 28 16:48 python -> python2 lrwxrwxrwx 1 root root 9 May 28 16:48 python2 -> python2.7 -rwxr-xr-x 1 root root 3764 May 28 16:59 python2.7

python is there... python is linked to python2 and not to python2.7. Don't know if that is a problem?

How does the start-stop-script determine the _SYNOPKGPKGDEST variable? Because in my impression, this is the only variable which can cause the start-stop script to fail?

BenjV commented 5 years ago

First of all you cannot use the start-stopstatus script from the commandline. The package center set some environment variables like "SYNOPKG_PKGDEST" and they are used and if you use the script yourself it does not work.

Northguy commented 5 years ago

OK, sorry for the ignorance. I tried to provide you with more information (as per request) and tried to solve some things myself. Any directions on where to look or how to start the package from the package center? Or should I just accept that it doesn't work and give up.

BenjV commented 5 years ago

What version of DSM are you running and did you install the python 2.7 from the SynoCommunity? The problem is that starting autosub work everywhere accept for you so it is hard to figure out the problem.

You can try to start it from the commandline with the following command sudo synopkg start autosub

But maybe change a few lines in the start_stop_status script so you get some output. On the following lines you should remove the output redirect (> /dev/null) cd ${SYNOPKG_PKGDEST} > /dev/null ${AUTOSUB_CMD} > /dev/null

Northguy commented 5 years ago

What version of DSM are you running and did you install the python 2.7 from the SynoCommunity?

I am running DSM 6.2.1-23824. I have installed the Python package by Safihre (2.7.14-19) from Synocommunity

The problem is that starting autosub work everywhere accept for you so it is hard to figure out the problem.

I understand. I am willing to investigate, but have only limited knowledge on where to look. I understand the basics of SSH-ing and linux, but there it ends.

You can try to start it from the commandline with the following command sudo synopkg start autosub

Hey, this worked. I wonder what the difference is between starting from the DSM desktop and the command line. Should be some rights issue I guess?

login as: ####

@####'s password:

@####:~$ sudo synopkg start autosub

Password: package autosub start successfully

It is still showing as not activated in the Package Center though... Should I access it through a url, or should the started package create an icon on the DSM desktop?

But maybe change a few lines in the start_stop_status script so you get some output. On the following lines you should remove the output redirect (> /dev/null) cd ${SYNOPKG_PKGDEST} > /dev/null ${AUTOSUB_CMD} > /dev/null

removed the redirects, stopped the package and then tried to start it again, but now it shows Failed to start package 272. but no additional output is showing when sudo-ing.

I guess that the rootcause for the last issue is that pid file is still present somewhere, but don't know where to delete it.

BenjV commented 5 years ago

You can find the pidfile in /volume1/@appstore/autosub/autosub.pid

I think I have a clue now. I encounterd this once before. When the package start python has to be initialized and autosub also before it can write the pidfile. If this takes to long the package center wil not see the pidfile in time an concludes that the package is not running. In the start_stop_status script there is a line which says: counter=15 You can make that 15 a higher number like 30 and then try it again.

Northguy commented 5 years ago

In the start_stop_status script there is a line which says: counter=15 You can make that 15 a higher number like 30 and then try it again.

Tried it: will not work. I think I need to give up on subtitles :-(