LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-10-2007, 09:55 PM   #1
mokku
Member
 
Registered: Feb 2007
Posts: 197

Rep: Reputation: 30
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.
 
Old 12-10-2007, 10:00 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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)

Last edited by billymayday; 12-10-2007 at 10:01 PM.
 
Old 12-10-2007, 10:19 PM   #3
mokku
Member
 
Registered: Feb 2007
Posts: 197

Original Poster
Rep: Reputation: 30
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.
 
Old 12-10-2007, 10:34 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.

Last edited by jschiwal; 12-10-2007 at 10:37 PM.
 
Old 12-10-2007, 10:41 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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
 
Old 12-10-2007, 10:45 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,933

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
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?
 
Old 12-10-2007, 10:50 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I get "bash: chkconfig: command not found" when I try to run chkconfig? non-thrash Fedora 10 05-20-2010 01:31 PM
solaris equivalent of chkconfig and service of redhat linux sanjeevkchopra Solaris / OpenSolaris 3 07-11-2006 04:45 PM
AIX equivalent of chkconfig and service in redhat linux sanjeevkchopra AIX 1 07-11-2006 11:07 AM
chkconfig ?? jchin Linux - Newbie 4 10-16-2003 02:59 AM


All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration