Will McDonald wrote:
If you added something like...
# chkconfig: 345 20 80 # description: Does LDM stuff
... after your shabang #!/bin/sh line that should suffice. That would start your LDM script after networking in runlevels 345 and stop it before networking's stopped when hopping back down through the runleves.
I can't recall if you need a "chkconfig --add ldm" but if your script's not visible in "chkconfig --list" then try it. The chkconfig man page's RUNLEVEL FILES section should have all the info you need.
Yes, you do need the "chkconfig --add ldm". This is what creates the links in the runlevel directories.
If you wanted to go the whole hog you could also look at integrating your startup stuff into /var/lock/subsys etc. Just have a look through an existing init script.
If you want init to shutdown the service for you, you need a lock file in /var/lock/subsys with the same name as your main script. Just have the start routine touch it and the stop routine remove it.
Bowie Bailey wrote:
Will McDonald wrote:
If you added something like...
# chkconfig: 345 20 80 # description: Does LDM stuff
... after your shabang #!/bin/sh line that should suffice. That would start your LDM script after networking in runlevels 345 and stop it before networking's stopped when hopping back down through the runleves.
I can't recall if you need a "chkconfig --add ldm" but if your script's not visible in "chkconfig --list" then try it. The chkconfig man page's RUNLEVEL FILES section should have all the info you need.
Yes, you do need the "chkconfig --add ldm". This is what creates the links in the runlevel directories.
If you wanted to go the whole hog you could also look at integrating your startup stuff into /var/lock/subsys etc. Just have a look through an existing init script.
If you want init to shutdown the service for you, you need a lock file in /var/lock/subsys with the same name as your main script. Just have the start routine touch it and the stop routine remove it.
When using the gui Service Configuration, I see the ldm service in there, but when highlighted, I get a status message of "env: /etc/init.d/ldm: No such file or directory. Wondering now if maybe this was not a dos type script to start with, and it's not being recognized. "file ldm" says it's a bourne shell script however...
Ideas or suggestions?
On 6/1/06, Sam Drinkard sam@wa4phy.net wrote:
When using the gui Service Configuration, I see the ldm service in there, but when highlighted, I get a status message of "env: /etc/init.d/ldm: No such file or directory. Wondering now if maybe this was not a dos type script to start with, and it's not being recognized. "file ldm" says it's a bourne shell script however...
Ideas or suggestions?
Either the permissions (or ACLs, if you have them enabled) are wrong on the script, or there is an error in the shebang line (including stray \r characters).
Dave K wrote:
On 6/1/06, Sam Drinkard sam@wa4phy.net wrote:
When using the gui Service Configuration, I see the ldm service in there, but when highlighted, I get a status message of "env: /etc/init.d/ldm: No such file or directory. Wondering now if maybe this was not a dos type script to start with, and it's not being recognized. "file ldm" says it's a bourne shell script however...
Ideas or suggestions?
Either the permissions (or ACLs, if you have them enabled) are wrong on the script, or there is an error in the shebang line (including stray \r characters).
It turns out the file had been created in dos. A dos2unix fixed the problem.
thanks all for the advice.