LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-22-2008, 08:27 AM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
chkconfig not working???


I tried to add httpd to started with chkconfig:
root@2 init.d]# chkconfig --add httpd

But it still says off for all run levels:
[root@2 init.d]# chkconfig --list |grep httpd
httpd 0ff 1ff 2ff 3ff 4ff 5ff 6ff

And httpd is a valid service:
[root@2 init.d]# service httpd
Usage: httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}

Any ideas why 3: is not saying on?

TIA
 
Old 12-22-2008, 08:35 AM   #2
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
chkconfig httpd on

then:

chkconfig --list httpd

Good luck and Merry X-mas!
 
Old 12-22-2008, 08:56 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
To change on/off use the --level option instead of --add. The -add option only uses the runlevel default values from the init script.

To turn http on in runlevel 3:
chkconfig --level 3 httpd on

see man chkconfig pages for more details.
 
Old 12-22-2008, 10:50 AM   #4
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Thanks that worked.

Do you know why --add wouldn't have worked? From the man page it looks like it should.

--add name

This option adds a new service for management by chkconfig. When a new service is added, chkconfig ensures that
the service has either a start or a kill entry in every runlevel. If any runlevel is missing such an entry, chk-
config creates the appropriate entry as specified by the default values in the init script. Note that default
entries in LSB-delimited âINIT INFOâ sections take precedence over the default runlevels in the initscript.
 
Old 12-22-2008, 10:54 AM   #5
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
chkconfig --add service, only adds the service to be able to manage it, but it doesnt add it to runlevels, for that you need to run like chkconfig httpd on or other ways like the other guy wrong. I am using usually chkconfig httpd on, coz its simple, but u can do it differently.
 
Old 12-22-2008, 11:42 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
It depends on your /etc/rc.d/init.d/httpd init script file.
Example:
Code:
      #!/bin/sh
      #
      # Startup script for the Apache Web Server
      #
      # chkconfig: 345 85 15
      # description: Apache is a World Wide Web server.  It is used to serve \
      #	       HTML files and CGI.
The --add option uses this line: "chkconfig: 345 85 15". 345 are the run levels. Post the line from your init script. Once the service is added use --level to change run levels.
 
Old 12-22-2008, 01:30 PM   #7
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by abefroman View Post
Thanks that worked.

Do you know why --add wouldn't have worked? From the man page it looks like it should.

--add name

This option adds a new service for management by chkconfig. When a new service is added, chkconfig ensures that
the service has either a start or a kill entry in every runlevel. If any runlevel is missing such an entry, chk-
config creates the appropriate entry as specified by the default values in the init script. Note that default
entries in LSB-delimited âINIT INFOâ sections take precedence over the default runlevels in the initscript.
The "--add" just adds (it's conveniently named ) the service into the "chkconfig" database. You manage the run levels with "--level" as stated above.

-C
 
  


Reply



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 12:31 PM
chkconfig ?? vonedaddy Linux - Newbie 2 11-07-2007 11:44 PM
I can't "service squid start" , and chkconfig squid on not working Niceman2005 Linux - Software 0 11-10-2004 08:18 PM
chkconfig ?? jchin Linux - Newbie 4 10-16-2003 01:59 AM
chkconfig --del not working?? kbaker Linux - General 1 09-30-2002 05:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05: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
Open Source Consulting | Domain Registration