Link to home
Start Free TrialLog in
Avatar of hernan007
hernan007

asked on

Init.d and Scripts : Starting a Script before of others

Dear Experts,

I have a Script in order to run  2 applications, one is in order to   have communication with a gsm modem, the other  is to have control for an equipment.  
 I want to start my script before the all other programs or  in the end of all programs,  because I need have a serial communication and have an information obtained by the equipment but is necessary start (or in the end) more slowly to have the correct answer  

what can I do?


cheers,

my script is:

#!/bin/sh
start() {
      /home/ipn/datalogger/extraccion/mareografod&
        /home/ipn/datalogger/transmision/gsmcomm&
}      
stop() {
      echo -n "stoping services..."
      /sbin/ifdown -a
}
restart() {
      stop
      start
}      

case "$1" in
  start)
        start
      ;;
  stop)
        stop
      ;;
  restart|reload)
        restart
      ;;
  *)
      echo $"Usage: $0 {start|stop|restart}"
      exit 1
esac

exit $?

SOLUTION
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hernan007
hernan007

ASKER

iools,  thanks

Im using  debian lenny  with an AMD Geode lx800 processor ,

is possible run my script after 3 minutes  that  the complete system is loaded??

cheers,
the name of my Script is   S50mareografod  
you mean after all the run scripts have started?

Just add it to the rc.local script on your system then.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks

Now  I have my  lines

home/ipn/datalogger/extraccion/mareografod&
/home/ipn/datalogger/transmision/gsmcomm&

in the start section in rc.local script   but it not work ..my lines not are loaded

I think that is necessary have the script in the end when the system is loaded in other case the communication with my data logger is incomplete (I have files with not completed information).

in the sleep command my serial ports works?  or all the system is affected ?

thanks ..

 
What happens when you run rc.local.

Can you check the startup logs for errors.
Is the missing "/" for `home/ipn/datalogger/extraccion/mareografod&`
a typo???

an easy way is to put your script location in the file /etc/rc.local or /etc/boot.local if your linux is Suse