chkconfig and linux scripts
I would like to one of my script in startup, I have copied into inist.d directory and try to do the followig command and it doesn't work.
# chkconfig dnstest on service dnstest does not support chkconfig Does dnstest file needs to be in any standard format? PLease let mek now. |
assuming the file is workable, you need to
chkconfig -add dnstest to "add" the service to chkconfig before "chkconfig dnstest on". You only need to add it once (please check format in man page - writing from memory) |
Thank you, but isn't it same command. I tried and getting same error.
# chkconfig --add dnstest service dnstest does not support chkconfig Am I missing anything here? Please help me. |
Could you post the header of your script?
Usually the scripts in /etc/init.d are wrapper scripts that start daemons or other scripts. Look for /etc/init.d/skeleton. If it exists, you can base such a script on it. |
And chkconfig --add XXX is not the same as chkconfig XXX on. Add adds the "service" into chkconfig, On tells it what to do at startup for each runlevel
|
They are not the same commands. Actually your first post the command does not have the correct syntax.
See man chkconfig for more information. The initscript header does have a certain format. The format depends on the linux distribution/version you are running. Have you looked at the files already in the /etc/init.d directory? |
Onther way around the problem, especially if you just want a one-off execution, is to run the script from rc.local or you can even run it from a user's cron with @reboot
|
All times are GMT -5. The time now is 07:04 PM. |