Run some script after booting up

Post your questions about BT download, FTP download, HTTP download, or QGet download software here.

Run some script after booting up

Postby mistrsoft » Tue Mar 22, 2011 5:07 pm

Hi,

I've already posted this question in pyLoad thread but with no answer.

I've set up schedule for shutting down and starting on and I need to to manualy start this script each time after booting

screen -dmS python /opt/pyload/pyLoadCore.py

could you please somebody tell me where I should to put it to run it after boot?
mistrsoft
Starting out
 
Posts: 20
Joined: Thu Mar 17, 2011 11:36 pm
NAS Model: TS-259 Pro+

Re: Run some script after booting up

Postby onlyalex » Tue Mar 22, 2011 7:44 pm

Hi mate

You need to make an autorun.sh script. Follow the wiki
http://wiki.qnap.com/wiki/Running_Your_ ... at_Startup

Best regards.
Nas1: Qnap TS-809 Pro "3.7.1 Build 0615"
Nas2: Qnap TS-119 "3.5.0 Build0816"
Nas3: Qnap TS-119P+ "3.5.0 Build0816"
Nas4: Qnap TS-212 "3.6.0 Build0210"
Nas5: Qnap TS-259 Pro+"3.5.0 Build 0815"
Nas6: Qnap TS-459 Pro II "3.5.0 Build 0815"
iPad2: 64Gig 3G "iOS 6"
UPS: APC Back-UPS RS 550VA

QNAP Comparison Cart HERE | 1Bay | 2Bay | 4Bay | 5Bay | 6Bay | 8Bay | 1U | 2U |
QNAP Compatibility List HERE | Online User Manual | Tutorials | Frequently Asked Questions |
User avatar
onlyalex
Experience counts
 
Posts: 1463
Joined: Fri Nov 27, 2009 3:16 pm
Location: Gothenburg Sweden
NAS Model: TS-639U

Re: Run some script after booting up

Postby mistrsoft » Wed Mar 23, 2011 3:06 pm

Yes I've already looked at this page.. But there is no tutorial for my TS-259 Pro+.

I tried mount commands from steps 3-5 but it says that /dev/mtdblock4 can't be mount.. So I'm here and asking what to do..;)
mistrsoft
Starting out
 
Posts: 20
Joined: Thu Mar 17, 2011 11:36 pm
NAS Model: TS-259 Pro+

Re: Run some script after booting up

Postby onlyalex » Wed Mar 23, 2011 4:17 pm

You need to run the mount command for the x86 unit
mount -t ext2 /dev/sdx6 /tmp/config

Cheers.
Nas1: Qnap TS-809 Pro "3.7.1 Build 0615"
Nas2: Qnap TS-119 "3.5.0 Build0816"
Nas3: Qnap TS-119P+ "3.5.0 Build0816"
Nas4: Qnap TS-212 "3.6.0 Build0210"
Nas5: Qnap TS-259 Pro+"3.5.0 Build 0815"
Nas6: Qnap TS-459 Pro II "3.5.0 Build 0815"
iPad2: 64Gig 3G "iOS 6"
UPS: APC Back-UPS RS 550VA

QNAP Comparison Cart HERE | 1Bay | 2Bay | 4Bay | 5Bay | 6Bay | 8Bay | 1U | 2U |
QNAP Compatibility List HERE | Online User Manual | Tutorials | Frequently Asked Questions |
User avatar
onlyalex
Experience counts
 
Posts: 1463
Joined: Fri Nov 27, 2009 3:16 pm
Location: Gothenburg Sweden
NAS Model: TS-639U

Re: Run some script after booting up

Postby mistrsoft » Fri Mar 25, 2011 1:41 am

Hi,

thanks for your advice.

Ok, I've created script autorun.sh like is describe in tutorial. But it doesn't work..:( My script look like this

cd /share/MD0_DATA/.qpkg/Optware/bin
/share/MD0_DATA/.qpkg/Optware/bin/screen -dmS python /opt/pyload/pyLoadCore.py

I wrote there complete paths but still nothing..;/ first line is because python when I put whole path is second row and run it then screen command won't work so that's why is there cd command.

I've tried write it only like this
/share/MD0_DATA/.qpkg/Optware/bin/python /opt/pyload/pyLoadCore.py -- daemon
but same result - nothing

When I manualy start script
sh autorun.sh
it works.. But not automaticly..;(

Any next advice?
mistrsoft
Starting out
 
Posts: 20
Joined: Thu Mar 17, 2011 11:36 pm
NAS Model: TS-259 Pro+

Re: Run some script after booting up

Postby onlyalex » Fri Mar 25, 2011 4:26 pm

Did you run the chmod command?
Code: Select all
# chmod +x /tmp/config/autorun.sh


My autorun.sh includes this:
Code: Select all
#!/bin/sh
/share/MD0_DATA/.qpkg/autorun/autorun_linked.sh


Try this: autorun_linked.sh (this must also be chmod +x)
Code: Select all
#!/bin/sh
/share/MD0_DATA/.qpkg/Optware/bin/screen -dmS python /opt/pyload/pyLoadCore.py


Try to run the autorun_linked
1
Code: Select all
cd /share/MD0_DATA/.qpkg/autorun

2
Code: Select all
./autorun_linked.sh
Nas1: Qnap TS-809 Pro "3.7.1 Build 0615"
Nas2: Qnap TS-119 "3.5.0 Build0816"
Nas3: Qnap TS-119P+ "3.5.0 Build0816"
Nas4: Qnap TS-212 "3.6.0 Build0210"
Nas5: Qnap TS-259 Pro+"3.5.0 Build 0815"
Nas6: Qnap TS-459 Pro II "3.5.0 Build 0815"
iPad2: 64Gig 3G "iOS 6"
UPS: APC Back-UPS RS 550VA

QNAP Comparison Cart HERE | 1Bay | 2Bay | 4Bay | 5Bay | 6Bay | 8Bay | 1U | 2U |
QNAP Compatibility List HERE | Online User Manual | Tutorials | Frequently Asked Questions |
User avatar
onlyalex
Experience counts
 
Posts: 1463
Joined: Fri Nov 27, 2009 3:16 pm
Location: Gothenburg Sweden
NAS Model: TS-639U

Re: Run some script after booting up

Postby mistrsoft » Wed Mar 30, 2011 2:37 pm

Hi. I'm sorry I was out of town. And yesterday I finally tried your advices. The result is nothing.
I did it exactly you wrote it.
when i manually start the script as you write in the end it works.. but the autorun file won't to run it..:(
I don't know what to do next.. I maybe try to invite some my buddy which has better knowledge of unix systems.

Thanks for your help..
mistrsoft
Starting out
 
Posts: 20
Joined: Thu Mar 17, 2011 11:36 pm
NAS Model: TS-259 Pro+

Re: Run some script after booting up

Postby mistrsoft » Tue Apr 05, 2011 2:17 pm

Hi, I finally did it.

I found tutorial on this page.
http://www.boerse.bz/informationen/tutorials/720437-how-pyload-auf-einem-nas-qnap-installieren.html
Just follow 5th step. It's german but just do what is in code section.

I have TS-259 Pro+ and I had to make small changes in step with mounting.
Replace this
Code: Select all
# mount -t ext2 /dev/mtdblock5 /tmp/config

with this
Code: Select all
# mount -t ext2 /dev/sdx6 /tmp/config


and then I changed path in this code
Code: Select all
#!/bin/sh
#Symlink Optware to /opt

rm -rf /opt
ln -sf /share/HDA_DATA/.qpkg/Optware /opt

#export Optware PATH
echo "export PATH=$PATH:/opt/bin:/opt/sbin:/usr/local/sbin" >> /etc/profile

#Autostart von pyLoad
cd /opt/pyload/
./pyLoad.sh start


to this
Code: Select all
#!/bin/sh
#Symlink Optware to /opt

rm -rf /opt
ln -sf /share/MD0_DATA/.qpkg/Optware /opt

#export Optware PATH
echo "export PATH=$PATH:/opt/bin:/opt/sbin:/usr/local/sbin" >> /etc/profile

#Autostart von pyLoad
cd /opt/pyload/
./pyLoad.sh start


other code is correct.

And now it's finaly working after start up.

Enjoy
mistrsoft
Starting out
 
Posts: 20
Joined: Thu Mar 17, 2011 11:36 pm
NAS Model: TS-259 Pro+

Re: Run some script after booting up

Postby abtron » Wed Apr 06, 2011 1:38 pm

hi

do you know what is wrong if i get this exeption:
mount: mounting /dev/mtdblock5 on /tmp/config failed: No such file or directory

the directory is there, but what else do i have to do to mount?

thx
abtron
New here
 
Posts: 2
Joined: Wed Apr 06, 2011 1:36 pm
NAS Model: TS-419P

Re: Run some script after booting up

Postby mistrsoft » Wed Apr 06, 2011 7:21 pm

Are you sure that you are using right directory in mount command? Which type of NAS do you have? If you have NAS with x86 cpu you have to use this

Code: Select all
# mount -t ext2 /dev/sdx6 /tmp/config
mistrsoft
Starting out
 
Posts: 20
Joined: Thu Mar 17, 2011 11:36 pm
NAS Model: TS-259 Pro+

Re: Run some script after booting up

Postby abtron » Thu Apr 07, 2011 12:25 am

sorry, posted the wrong link.
i tried with sdx6.
but i have a synology 409+ not a qnap...does that matter ?
abtron
New here
 
Posts: 2
Joined: Wed Apr 06, 2011 1:36 pm
NAS Model: TS-419P

Re: Run some script after booting up

Postby mistrsoft » Thu Apr 07, 2011 2:56 pm

this tutorial is for qnap nas servers.. So I don't know if it will work for synology.. Try google to find solution for your model..
mistrsoft
Starting out
 
Posts: 20
Joined: Thu Mar 17, 2011 11:36 pm
NAS Model: TS-259 Pro+


Return to Download Station and QGet

Who is online

Users browsing this forum: No registered users and 3 guests