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/extra ccion/mare ografod&
/home/ipn/datalogger/trans mision/gsm comm&
}
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 $?
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/extra
/home/ipn/datalogger/trans
}
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Just add it to the rc.local script on your system then.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Now I have my lines
home/ipn/datalogger/extrac cion/mareo grafod&
/home/ipn/datalogger/trans mision/gsm comm&
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 ..
Now I have my lines
home/ipn/datalogger/extrac
/home/ipn/datalogger/trans
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/extra ccion/mare ografod&`
a typo???
Can you check the startup logs for errors.
Is the missing "/" for `home/ipn/datalogger/extra
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
ASKER
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,