Cron and IPKG problems

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
ciprian.trofin
Know my way around
Posts: 117
Joined: Thu Feb 03, 2011 6:04 pm

Cron and IPKG problems

Post by ciprian.trofin »

Hi all,
I'm having a problem with cron: after a NAS restart, some commands in crontab file do not work. Some do, some don't. In order to make them work, I have to log in NAS (SSH) and restart the cron service:

Code: Select all

/etc/init.d/crond.sh restart
I checked the issue as much as I could, but I'm stucked. It looks like there are some ipkg issues.

Here it goes.

I run 2 Python interpreters: Python 2.7, installed via official QPKG package, and Python 2.7.3, installed via ipkg. I need v2.7.3 because some python modules are not available with earlier releases.

I wrote 2 scripts, each using a different python interpreter. The only thing they do is output the current date / time to a file.

/share/scripts/test27.py - uses the 2.7 interpreter - QPKG package

Code: Select all

#!/usr/bin/env python2.7

import datetime
open("/share/scripts/test27.txt", "a").write("%s\n" % datetime.datetime.now())
/share/scripts/test2.py - uses the 2.7.3 interpreter - IPKG package

Code: Select all

#!/usr/bin/env python2

import datetime
open("/share/scripts/test2.txt", "a").write("%s\n" % datetime.datetime.now())
I add the following lines to crontab:

Code: Select all

* * * * * /share/scripts/test2.py
* * * * * /share/scripts/test27.py
and restart the service.

After a while, both /share/scripts/test27.txt and /share/scripts/test2.txt start to update (as expected - both scripts are run via cron).

I reboot the NAS, and only test27.txt updates - that means cron is not running the the script using the ipkg interpreter. After I login NAS and restart the cron service, both files (test27.txt and test2.txt) start updating, meaning both scripts are run by cron.

Can you help me solve the problem?
TS-219P+, firmware 3.7.3 Build 20120801
2 x WDC WD30EFRX-68EUZN080.0 (previously 2 x ST32000542AS, replaced because of defects and / or size issues), Back-UPS ES 700G
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Cron and IPKG problems

Post by pwilson »

Please provide output for:

Code: Select all

echo "Optware binaries live at $(ls -alF /opt | awk '{ print $10 }')bin"
ls -alF $(ls -alF /opt | awk '{ print $10 }')bin/perl*
#done

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
ciprian.trofin
Know my way around
Posts: 117
Joined: Thu Feb 03, 2011 6:04 pm

Re: Cron and IPKG problems

Post by ciprian.trofin »

Thanks Guru :)
I will run the script when I get home.

Should I run it multiple times (right after NAS reboot and after cron restart) ?
TS-219P+, firmware 3.7.3 Build 20120801
2 x WDC WD30EFRX-68EUZN080.0 (previously 2 x ST32000542AS, replaced because of defects and / or size issues), Back-UPS ES 700G
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Cron and IPKG problems

Post by pwilson »

ciprian.trofin wrote:Thanks Guru :)
I will run the script when I get home.

Should I run it multiple times (right after NAS reboot and after cron restart) ?
Once will suffice.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
ciprian.trofin
Know my way around
Posts: 117
Joined: Thu Feb 03, 2011 6:04 pm

Re: Cron and IPKG problems

Post by ciprian.trofin »

Here it goes:

Code: Select all

[~] # echo "Optware binaries live at $(ls -alF /opt | awk '{ print $10 }')bin"
Optware binaries live at ->bin
[~] # ls -alF $(ls -alF /opt | awk '{ print $10 }')bin/perl*
/bin/ls: invalid option -- >
BusyBox v1.01 (2012.07.14-18:37+0000) multi-call binary

Usage: ls [-1AacCdeFilnpLRrSsTtuvwxXhk] [filenames...]

List directory contents

Options:
        -1      list files in a single column
        -A      do not list implied . and ..
        -a      do not hide entries starting with .
        -C      list entries by columns
        -c      with -l: show ctime
        -d      list directory entries instead of contents
        -e      list both full date and full time
        -F      append indicator (one of */=@|) to entries
        -i      list the i-node for each file
        -l      use a long listing format
        -n      list numeric UIDs and GIDs instead of names
        -p      append indicator (one of /=@|) to entries
        -L      list entries pointed to by symbolic links
        -R      list subdirectories recursively
        -r      sort the listing in reverse order
        -S      sort the listing by file size
        -s      list the size of each file, in blocks
        -T NUM  assume Tabstop every NUM columns
        -t      with -l: show modification time
        -u      with -l: show access time
        -v      sort the listing by version
        -w NUM  assume the terminal is NUM columns wide
        -x      list entries by lines instead of by columns
        -X      sort the listing by extension
        -h      print sizes in human readable format (e.g., 1K 243M 2G )


[~] #
TS-219P+, firmware 3.7.3 Build 20120801
2 x WDC WD30EFRX-68EUZN080.0 (previously 2 x ST32000542AS, replaced because of defects and / or size issues), Back-UPS ES 700G
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Cron and IPKG problems

Post by pwilson »

ciprian.trofin wrote:Here it goes:

Code: Select all

[~] # echo "Optware binaries live at $(ls -alF /opt | awk '{ print $10 }')bin"
Optware binaries live at ->bin
[~] # ls -alF $(ls -alF /opt | awk '{ print $10 }')bin/perl*
/bin/ls: invalid option -- >
BusyBox v1.01 (2012.07.14-18:37+0000) multi-call binary

Usage: ls [-1AacCdeFilnpLRrSsTtuvwxXhk] [filenames...]

List directory contents

Options:
        -1      list files in a single column
        -A      do not list implied . and ..
        -a      do not hide entries starting with .
        -C      list entries by columns
        -c      with -l: show ctime
        -d      list directory entries instead of contents
        -e      list both full date and full time
        -F      append indicator (one of */=@|) to entries
        -i      list the i-node for each file
        -l      use a long listing format
        -n      list numeric UIDs and GIDs instead of names
        -p      append indicator (one of /=@|) to entries
        -L      list entries pointed to by symbolic links
        -R      list subdirectories recursively
        -r      sort the listing in reverse order
        -S      sort the listing by file size
        -s      list the size of each file, in blocks
        -T NUM  assume Tabstop every NUM columns
        -t      with -l: show modification time
        -u      with -l: show access time
        -v      sort the listing by version
        -w NUM  assume the terminal is NUM columns wide
        -x      list entries by lines instead of by columns
        -X      sort the listing by extension
        -h      print sizes in human readable format (e.g., 1K 243M 2G )


[~] #
I really hate BusyBox! :cry:

Please try this instead:

Code: Select all

echo "Optware binaries live at $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin"
/bin/ls -alF $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin/perl*
#done
Please provide this output.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
ciprian.trofin
Know my way around
Posts: 117
Joined: Thu Feb 03, 2011 6:04 pm

Re: Cron and IPKG problems

Post by ciprian.trofin »

Code: Select all

[~] # echo "Optware binaries live at $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin"
Optware binaries live at /share/MD0_DATA/.qpkg/Optware/bin
[~] # /bin/ls -alF $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin/perl*
ls: /share/MD0_DATA/.qpkg/Optware/bin/perl*: No such file or directory
[~] # #done
[~] #
Just in case you missed: I use python, not perl. Replacing perl with python (in your script) gives:

Code: Select all

[~] # echo "Optware binaries live at $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin"
Optware binaries live at /share/MD0_DATA/.qpkg/Optware/bin
[~] # /bin/ls -alF $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin/python*
lrwxrwxrwx    1 admin    administ        9 Mar  8  2014 /share/MD0_DATA/.qpkg/Optware/bin/python2 -> python2.7*
lrwxrwxrwx    1 admin    administ       16 Mar  8  2014 /share/MD0_DATA/.qpkg/Optware/bin/python2-config -> python2.7-config*
-rwxr-xr-x    1 admin    administ     3368 Apr 12  2012 /share/MD0_DATA/.qpkg/Optware/bin/python2.7*
-rwxr-xr-x    1 admin    administ     1618 Apr 12  2012 /share/MD0_DATA/.qpkg/Optware/bin/python2.7-config*
[~] # #done
[~] #
TS-219P+, firmware 3.7.3 Build 20120801
2 x WDC WD30EFRX-68EUZN080.0 (previously 2 x ST32000542AS, replaced because of defects and / or size issues), Back-UPS ES 700G
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Cron and IPKG problems

Post by pwilson »

ciprian.trofin wrote:

Code: Select all

[~] # echo "Optware binaries live at $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin"
Optware binaries live at /share/MD0_DATA/.qpkg/Optware/bin
[~] # /bin/ls -alF $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin/perl*
ls: /share/MD0_DATA/.qpkg/Optware/bin/perl*: No such file or directory
[~] # #done
[~] #
Just in case you missed: I use python, not perl. Replacing perl with python (in your script) gives:

Code: Select all

[~] # echo "Optware binaries live at $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin"
Optware binaries live at /share/MD0_DATA/.qpkg/Optware/bin
[~] # /bin/ls -alF $(/bin/ls -alF /opt | /bin/awk '{ print $11 }')bin/python*
lrwxrwxrwx    1 admin    administ        9 Mar  8  2014 /share/MD0_DATA/.qpkg/Optware/bin/python2 -> python2.7*
lrwxrwxrwx    1 admin    administ       16 Mar  8  2014 /share/MD0_DATA/.qpkg/Optware/bin/python2-config -> python2.7-config*
-rwxr-xr-x    1 admin    administ     3368 Apr 12  2012 /share/MD0_DATA/.qpkg/Optware/bin/python2.7*
-rwxr-xr-x    1 admin    administ     1618 Apr 12  2012 /share/MD0_DATA/.qpkg/Optware/bin/python2.7-config*
[~] # #done
[~] #
According to this output both will be running the exact same version of Python either way.

Use:

Code: Select all

#!/usr/bin/env python2.7


on both scripts.

The big problem is figuring out what is actually being run. Consider this output:

Code: Select all

admin@NASTY2:~# /bin/ls -alFLi /usr/bin/python* /opt/bin/python* /Apps/opt/bin/python* | /usr/bin/sort
21237317 -rwxrwxr-x    1 admin    administ      3092 Feb 17  2012 /opt/bin/python*
21237317 -rwxrwxr-x    1 admin    administ      3092 Feb 17  2012 /opt/bin/python2.5*
21237318 -rwxrwxr-x    1 admin    administ      1418 Feb 17  2012 /opt/bin/python-config*
21237318 -rwxrwxr-x    1 admin    administ      1418 Feb 17  2012 /opt/bin/python2.5-config*
29294815 -rwxr-xr-x    1 admin    administ      1687 Mar 24 23:30 /usr/bin/python-config*
29294815 -rwxr-xr-x    1 admin    administ      1687 Mar 24 23:30 /usr/bin/python2.7-config*
29294816 -rwxr-xr-x    1 admin    administ   4577532 Mar 24 23:30 /usr/bin/python*
29294817 -rwxr-xr-x    1 admin    administ   4577532 Mar 24 23:30 /usr/bin/python2.7*
46400956 -rwxr-xr-x    1 admin    administ      3740 Jun  1 15:16 /Apps/opt/bin/python*
46400956 -rwxr-xr-x    1 admin    administ      3740 Jun  1 15:16 /Apps/opt/bin/python2*
46400956 -rwxr-xr-x    1 admin    administ      3740 Jun  1 15:16 /Apps/opt/bin/python2.7*
11 Filesnames! And there really are only 6 different files.
Last edited by pwilson on Thu Jul 02, 2015 4:14 am, edited 1 time in total.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
ciprian.trofin
Know my way around
Posts: 117
Joined: Thu Feb 03, 2011 6:04 pm

Re: Cron and IPKG problems

Post by ciprian.trofin »

I'm not sure about this:

Code: Select all

[~] # python2.7
Python 2.7 (r27:82500, Aug 21 2010, 10:10:43)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[~] # python2
Python 2.7.3 (default, Apr 12 2012, 13:08:47)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[~] # /usr/bin/env python2.7
Python 2.7 (r27:82500, Aug 21 2010, 10:10:43)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[~] # /usr/bin/env python2
Python 2.7.3 (default, Apr 12 2012, 13:08:47)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

Also:

Code: Select all

[/share/scripts] # ./test2.py
2.7.3 (default, Apr 12 2012, 13:08:47)
[GCC 4.2.3]
[/share/scripts] # ./test27.py
2.7 (r27:82500, Aug 21 2010, 10:10:43)
[GCC 4.2.3]
[/share/scripts] #
where test2.py is:

Code: Select all

#!/usr/bin/env python2

import sys
print sys.version
and test27.py is:

Code: Select all

#!/usr/bin/env python2.7

import sys
print sys.version
TS-219P+, firmware 3.7.3 Build 20120801
2 x WDC WD30EFRX-68EUZN080.0 (previously 2 x ST32000542AS, replaced because of defects and / or size issues), Back-UPS ES 700G
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Cron and IPKG problems

Post by pwilson »

ciprian.trofin wrote:I'm not sure about this:

Code: Select all

[~] # python2.7
Python 2.7 (r27:82500, Aug 21 2010, 10:10:43)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[~] # python2
Python 2.7.3 (default, Apr 12 2012, 13:08:47)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[~] # /usr/bin/env python2.7
Python 2.7 (r27:82500, Aug 21 2010, 10:10:43)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[~] # /usr/bin/env python2
Python 2.7.3 (default, Apr 12 2012, 13:08:47)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

Also:

Code: Select all

[/share/scripts] # ./test2.py
2.7.3 (default, Apr 12 2012, 13:08:47)
[GCC 4.2.3]
[/share/scripts] # ./test27.py
2.7 (r27:82500, Aug 21 2010, 10:10:43)
[GCC 4.2.3]
[/share/scripts] #
where test2.py is:

Code: Select all

#!/usr/bin/env python2

import sys
print sys.version
and test27.py is:

Code: Select all

#!/usr/bin/env python2.7

import sys
print sys.version
Please provide output for:

Code: Select all

/bin/ls -alFLi /usr/bin/python* /opt/bin/python* /Apps/opt/bin/python* | /usr/bin/sort

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
ciprian.trofin
Know my way around
Posts: 117
Joined: Thu Feb 03, 2011 6:04 pm

Re: Cron and IPKG problems

Post by ciprian.trofin »

Code: Select all

[~] # /bin/ls -alFLi /usr/bin/python* /opt/bin/python* /Apps/opt/bin/python* | /usr/bin/sort
ls: /Apps/opt/bin/python*: No such file or directory
43778150 -rwxr-xr-x    1 admin    administ  4512756 Aug 21  2010 /usr/bin/python2.7*
43778152 -rwxr-xr-x    1 admin    administ     1618 Aug 21  2010 /usr/bin/python-config*
43778152 -rwxr-xr-x    1 admin    administ     1618 Aug 21  2010 /usr/bin/python2.7-config*
43778153 -rwxr-xr-x    1 admin    administ  4512756 Aug 21  2010 /usr/bin/python*
43782464 -rwxr-xr-x    1 admin    administ     3368 Apr 12  2012 /opt/bin/python2*
43782464 -rwxr-xr-x    1 admin    administ     3368 Apr 12  2012 /opt/bin/python2.7*
43782465 -rwxr-xr-x    1 admin    administ     1618 Apr 12  2012 /opt/bin/python2-config*
43782465 -rwxr-xr-x    1 admin    administ     1618 Apr 12  2012 /opt/bin/python2.7-config*
[~] #
I just found this: http://askubuntu.com/questions/23009/re ... s-not-work
I inserted the following dummy entry in crontab:

Code: Select all

* * * * * env > /share/scripts/env.txt
I rebooted the NAS and waited for /share/scripts/env.txt to be generated and saved the file. After that, I restarted cron and waited for a new env.txt.
The major difference is PATH related: just after reboot, I get this:

Code: Select all

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin
After cron restart, I get this:

Code: Select all

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin:/opt/bin:/opt/sbin
It looks I'm going somewhere: /opt/bin and /opt/sbin path is not available to cron after NAS reboot.
TS-219P+, firmware 3.7.3 Build 20120801
2 x WDC WD30EFRX-68EUZN080.0 (previously 2 x ST32000542AS, replaced because of defects and / or size issues), Back-UPS ES 700G
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Cron and IPKG problems

Post by pwilson »

ciprian.trofin wrote:

Code: Select all

[~] # /bin/ls -alFLi /usr/bin/python* /opt/bin/python* /Apps/opt/bin/python* | /usr/bin/sort
ls: /Apps/opt/bin/python*: No such file or directory
43778150 -rwxr-xr-x    1 admin    administ  4512756 Aug 21  2010 /usr/bin/python2.7*
43778152 -rwxr-xr-x    1 admin    administ     1618 Aug 21  2010 /usr/bin/python-config*
43778152 -rwxr-xr-x    1 admin    administ     1618 Aug 21  2010 /usr/bin/python2.7-config*
43778153 -rwxr-xr-x    1 admin    administ  4512756 Aug 21  2010 /usr/bin/python*
43782464 -rwxr-xr-x    1 admin    administ     3368 Apr 12  2012 /opt/bin/python2*
43782464 -rwxr-xr-x    1 admin    administ     3368 Apr 12  2012 /opt/bin/python2.7*
43782465 -rwxr-xr-x    1 admin    administ     1618 Apr 12  2012 /opt/bin/python2-config*
43782465 -rwxr-xr-x    1 admin    administ     1618 Apr 12  2012 /opt/bin/python2.7-config*
[~] #
You can see the concern. Part of the problem is that /usr/bin is in the $PATH at bootup, while /opt/bin is not. Similarly, when cron runs things, /usr/bin is in the $PATH, while /opt/bin is not.

It will take some experimentation to see if this is the issue.

Check out output from:

Code: Select all

for i in /opt/bin/python /opt/bin/python2.7 /usr/bin/python /usr/bin/python2.7  ; do $i -V ;done
This produces the following output here:

Using explicit paths to the one you want may or may not work, I haven't played with this type of thing in years.

You might see if you can modify the first line of your scripts to specify the exact one you want.

Example:

Code: Select all

admin@NASTY2:~# for i in /Apps/opt/bin/python /Apps/opt/bin/python2.7 /opt/bin/python /opt/bin/python2.7 \
> /usr/bin/python /usr/bin/python2.7  ; do $i -V ;done
Python 2.7.9
Python 2.7.9
Python 2.5.6
Python 2.7.3
Python 2.7.9
Python 2.7.9
admin@NASTY2:~# 

Why do you need 2.7.3 again?

Code: Select all

#!/usr/bin/env python
Should give you Python v2.7.9 if you de-install all Optware versions.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
ciprian.trofin
Know my way around
Posts: 117
Joined: Thu Feb 03, 2011 6:04 pm

Re: Cron and IPKG problems

Post by ciprian.trofin »

I need a python version more recent than 2.7.3, because I use beautifulsoup4 module (it requires 2.7.3 or later)

Code: Select all

[~] # for i in /opt/bin/python /opt/bin/python2.7 /usr/bin/python /usr/bin/python2.7  ; do $i -V ;done
-sh: /opt/bin/python: No such file or directory
Python 2.7.3
Python 2.7
Python 2.7
[~] #
For now, /usr/bin/env python gives me python 2.7 (even older than optware 2.7.3).
2.7.9 should be OK, but I don't know how / where to find it. My NAS is ARM, not Intel. Also, python is not default with NAS firmware, the user has to install it from App Center or Optware; if I give up Optware (as you suggest), I can only turn to App Center, where the python QPKG is obsolete.
TS-219P+, firmware 3.7.3 Build 20120801
2 x WDC WD30EFRX-68EUZN080.0 (previously 2 x ST32000542AS, replaced because of defects and / or size issues), Back-UPS ES 700G
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Cron and IPKG problems

Post by pwilson »

ciprian.trofin wrote:I need a python version more recent than 2.7.3, because I use beautifulsoup4 module (it requires 2.7.3 or later)

Code: Select all

[~] # for i in /opt/bin/python /opt/bin/python2.7 /usr/bin/python /usr/bin/python2.7  ; do $i -V ;done
-sh: /opt/bin/python: No such file or directory
Python 2.7.3
Python 2.7
Python 2.7
[~] #
For now, /usr/bin/env python gives me python 2.7 (even older than optware 2.7.3).
2.7.9 should be OK, but I don't know how / where to find it. My NAS is ARM, not Intel. Also, python is not default with NAS firmware, the user has to install it from App Center or Optware; if I give up Optware (as you suggest), I can only turn to App Center, where the python QPKG is obsolete.
Or upgrade your Firmware to "current" Firmware. :roll: :roll: :roll: :roll:

Please review the QNAP Security Bulletins and Advisories page. You are crazy to still be running any QTS 3.x.x Firmware version , especially if your network is connected to the Internet.

Current Firmware will provide you with "current-ish" versions of the tools you apparently like playing with.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
ciprian.trofin
Know my way around
Posts: 117
Joined: Thu Feb 03, 2011 6:04 pm

Re: Cron and IPKG problems

Post by ciprian.trofin »

Thank you Patrick for you generous help, but I'll pass the upgrade. I have my share with borked fw upgrades, or buggy versions - they thought me not to mess with something that works (I'm not talking just about QNAP). I had problems with QNAP software that took long time to solve and the issues / lockups on FW upgrades (documented on this forum) scare my like hell :(

Sooo... in the end, there is no clear solution to my problem. AFAIK, bosybox crontab does not allow setting variables. Is there any way to set the full PATH variable before crond starts after reboot?
TS-219P+, firmware 3.7.3 Build 20120801
2 x WDC WD30EFRX-68EUZN080.0 (previously 2 x ST32000542AS, replaced because of defects and / or size issues), Back-UPS ES 700G
Post Reply

Return to “Miscellaneous”