Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

service file does not support chkconfig

4,118 views
Skip to first unread message

nick048

unread,
Feb 12, 2010, 1:46:06 AM2/12/10
to
Hi to All,

I have create as root in /etc/rc.d/init.d the file below named dbora:

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME=/u01/app/oracle/product/10.2.0/db_1
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi

case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
touch /var/lock/subsys/dbora
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
rm -f /var/lock/subsys/dbora
;;
esac

After I have execute:

#chmod 750 /etc/rc.d/init.d/dbora

At last

#chkconfig --add /etc/rc.d/init.d/dbora

This message is returned

"service dbora does not support chkconfig".

Can someone help me ? Have You an idea ?

Thank You and best regards
Gaetano

Eef Hartman

unread,
Feb 12, 2010, 3:38:14 AM2/12/10
to
nick048 <nicosia...@moonsoft.it> wrote:
> #chkconfig --add /etc/rc.d/init.d/dbora
>
> This message is returned
>
> "service dbora does not support chkconfig".

You need comments like this (this is from the script for nfs):
### BEGIN INIT INFO
# Provides: nfs
# Required-Start: $network $portmap
# Required-Stop: $network $portmap
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: NFS client services
# Description: All necessary services for NFS clients
### END INIT INFO
in the beginning of your init script, so that chkconfig knows
when it should start it and what's required to be ALREADY running
when starting it.
In this case nfs should be started in runlevels 3 and 5, after the
network is up and the portmap service has been started, it should
stop it in other levels BEFORE stopping the portmapper and network.

Without this info chkconfig doesn't know in what runlevels it should
create the start and stop links and what priority (number) it should
give those links. Again for nfs, these are the links:
lrwxrwxrwx 1 root root 6 2009-02-09 14:23 /etc/init.d/rc3.d/K04nfs -> ../nfs
lrwxrwxrwx 1 root root 6 2009-02-09 14:23 /etc/init.d/rc3.d/S05nfs -> ../nfs
lrwxrwxrwx 1 root root 6 2009-02-09 14:23 /etc/init.d/rc5.d/K04nfs -> ../nfs
lrwxrwxrwx 1 root root 6 2009-02-09 14:23 /etc/init.d/rc5.d/S05nfs -> ../nfs
The numbers make sure it is started after S01 thru S04, cq K01 thru K04
(S is the "start" link, K the "kill" one, which is used during shutdown
or init level changes).
--
*******************************************************************
** Eef Hartman, Delft University of Technology, dept. SSC/ICT **
** e-mail: E.J.M....@tudelft.nl - phone: +31-15-278 82525 **
*******************************************************************

Martijn Lievaart

unread,
Feb 12, 2010, 2:07:24 PM2/12/10
to
On Fri, 12 Feb 2010 09:38:14 +0100, Eef Hartman wrote:

> nick048 <nicosia...@moonsoft.it> wrote:
>> #chkconfig --add /etc/rc.d/init.d/dbora
>>
>> This message is returned
>>
>> "service dbora does not support chkconfig".
>
> You need comments like this (this is from the script for nfs): ### BEGIN
> INIT INFO
> # Provides: nfs
> # Required-Start: $network $portmap

(snip)

That's one style supported by chkconfig. The OP uses the other style. I
don't know why it doesn't work, so he may try this style, but your
comment that you need this style is wrong.

M4

nick048

unread,
Feb 13, 2010, 1:49:00 AM2/13/10
to
Solved !

I have inserted an incorrect line in the header of the script. Look
the code:

Incorrect Code:


#!/bin/sh
# chkconfig: 345 99 10

# descrition: Oracle auto start-stop script.

This is the correct code
#!/bin/sh
#chkconfig: 345 99 10
#description: Oracle auto start-stop script.

Now chkconfig work fine! The script run at Linux correctly.

By
Gaetano

Martijn Lievaart

unread,
Feb 13, 2010, 7:10:46 AM2/13/10
to

Please file a bug, because in that case the man page is wrong:

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.

^^^^^^^^^ Note the space here.

M4

Robert Nichols

unread,
Feb 14, 2010, 10:32:33 AM2/14/10
to
In article <6fhi47-...@news.rtij.nl>,
Martijn Lievaart <m...@rtij.nl.invlalid> wrote:

The space isn't the problem. Every one of the files in my /etc/init.d
has that. The misspelling of "description" is the real killer.

--
Bob Nichols AT comcast.net I am "RNichols42"

0 new messages