problem with chkconfig

General support questions including new installations
Post Reply
diskun
Posts: 3
Joined: 2009/10/27 01:12:17
Location: Spain

problem with chkconfig

Post by diskun » 2009/10/27 01:23:46

Hi,

sorry but my english is poor :( I'm from Spain

I have a little problem with command chkconfig.
I have a script named [b]carpald[/b] and his path is [b]/etc/rc.d/init.d/[/b].

I need use chkconfig with this script but when i write command:

chkconfig --add carpald

System message is:

[b]carpald service does not support chkconfig[/b]

With chkconfig the system configures a script to boot on startup runlevels that we indicate.

Can you help me, please?

thank you :)

jiannma
Posts: 5
Joined: 2009/10/09 09:15:09

Re: problem with chkconfig

Post by jiannma » 2009/10/27 04:25:30

The chkconfig command is to update and query information for system services,
like httpd,mysqld ...


If you want to put your script to boot on startup runlevels t,you should write your script path in the file
called "/etc/rc.local", you may see this file carefully ~~~




Hope it would help you~~

User avatar
WhatsHisName
Posts: 1549
Joined: 2005/12/19 20:21:43
Location: /earth/usa/nj

Re: problem with chkconfig

Post by WhatsHisName » 2009/10/27 04:45:42

For chkconfig to manage your script, you need to configure your script as described in the chkconfig manpage section RUNLEVEL FILES (at the end of the manpage).

yyagol
Posts: 1015
Joined: 2006/06/10 18:27:44
Location: 32 4′N 34 47′E
Contact:

Re: problem with chkconfig

Post by yyagol » 2009/10/27 06:38:01

chkconfig need 2 things in the head of your script
# chkconfig:
# description:

like [b]WhatsHisName[/b] say loot at the manual , taken from the manual :

[code]Runlevel Files

Each service which should be manageable by chkconfig needs two or more commented lines added to its init.d script.
The first line tells chkconfig what runlevels the service should be started in by default, as well as the start and stop priority levels.
If the service should not, by default, be started in any runlevels, a - should be used in place of the runlevels list.
The second line contains a description for the service, and may be extended across multiple lines with backslash continuation.

For example, random.init has these three lines:

# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.

This says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80.
You should be able to figure out what the description says; the \ causes the line to be continued. The extra space in front of the line is ignored. [/code]

slashslash
Posts: 35
Joined: 2009/05/21 07:18:38

Re: problem with chkconfig

Post by slashslash » 2009/10/27 07:44:35

You can use an existing script such as /etc/init.d/sshd as a template. Just change the chkconfig S and K parameters to match the desired behavior of the new service.

diskun
Posts: 3
Joined: 2009/10/27 01:12:17
Location: Spain

Re: problem with chkconfig

Post by diskun » 2009/10/27 09:25:37

thank you

The problem was that he had wrote description with errors

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: problem with chkconfig

Post by AlanBartlett » 2009/10/27 12:22:52

For the record, a template file and its accompanying notes -- [b]/usr/share/doc/initscripts-8.45.30/sysvinitfiles[/b].

Post Reply