DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-09-26 12:04:14

hochers
Member
Registered: 2010-01-17
Posts: 7

Run programs at startup

Hi,

I have an acer easystore which is quite similar to the 323 I think. I just got one problem: after rebooting I have to run the programs manually and insert the cronjobs also by hand. I inserted the stuff I want on restart in the es_plug file (for 323 fun_plug) but it doesnt work. For example to run lighttp I put in the es_plug the following line;

    sh /ffp/start/lighttp.sh start

But it does not start. what do I have to do to get it started automatically.

Thanks

Offline

 

#2 2010-09-26 14:07:58

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Run programs at startup

Is that line the only line in es_plug? I think the script should at least contain:

Code:

#!/ffp/bin/sh

export PATH=/ffp/sbin:/ffp/bin:/usr/sbin:/sbin:/usr/bin:/bin

sh /ffp/start/lighttp.sh start

and the script might have to be executable.
But I think it's a better idea to call rc instead:

Code:

#!/ffp/bin/sh

/ffp/etc/rc start

and make the services which have to be started executable in /ffp/start

Offline

 

#3 2010-09-30 09:42:46

hochers
Member
Registered: 2010-01-17
Posts: 7

Re: Run programs at startup

Hi again,

does it have to be #!/ffp/bin/sh ? my file starts with #!/bin/sh  and afterwards some variables and the
sh /ffp/start/sshd.sh start 
.....
sh /ffp/start/lighttpd.sh start
....

and so one. So ssh starts at the beginning but all the other stuff I but in there doesnt do nothing.

What is rc ?

Thanks again

Offline

 

#4 2010-09-30 11:17:23

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Run programs at startup

does it have to be #!/ffp/bin/sh ?

Maybe. the shell specified after #! is used to execute the script. When you specify /bin/sh the internal shell of the firmware is used, which could be too simple to execute the script, while /ffp/bin/sh is sufficient.

/ffp/start/lighttpd.sh internally specifies /ffp/bin/sh again, so only your 'variables' are influenced by this header. On the other hand, you specify 'sh' explicitly to execute /ffp/start/lighttpd.sh, which overrules the specification in this script. Which sh is used (/bin/sh or /ffp/bin/sh) depends on whether you specified /ffp/bin in the beginning of the PATH variable or not.

What is rc ?

/ffp/etc/rc is a script which is designed to start (or stop) all executable scripts in /ffp/start

Offline

 

#5 2010-09-30 14:28:29

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: Run programs at startup

If the scripts are in the ffp/start directory, and are executable, then you don't need another script to call them, they will be run automatically when ffp starts.


3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

#6 2010-09-30 17:39:00

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Run programs at startup

Define 'starting ffp'

Offline

 

#7 2010-10-01 13:21:50

hochers
Member
Registered: 2010-01-17
Posts: 7

Re: Run programs at startup

Thanks a lot, everything is working!!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB