LinuxQuestions.org
Review your favorite Linux distribution.
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 03-13-2011, 06:01 PM   #1
x201s
Member
 
Registered: Dec 2010
Posts: 67

Rep: Reputation: 0
chkconfig --add doesn't let me add


Hi All,
I have this script, called zope, which I am trying to register as a service.
When I type "chkconfig --add zope", it says "service zope does not support chkconfig" yet when I type "service zope start", it starts zope server alright.

When I type "chkconfig --list", no zope is in sight. If I run,
"chkconfig --del zope", it complains with same "does not support" error.

After registering zope, even while it was complaining, I set the run
level ("chkconfig --levels 2345 zope on").

Also, when I run:
su -l $ZOPE_USER -c "${INSTANCE_HOME}/bin/instance start" > /dev/null 2>&1
with appropriate substitution for ZOPE_USER and INSTANCE_HOME, zope starts alright.


Does anyone see any obvious error? Or some hidden edict that I am not following?

The file is in /etc/init.d.
.//------------------------------
#!/bin/sh
# chkconfig: 2345 84 16
#
# Source function library.
. /etc/rc.d/init.d/functions

INSTANCE_HOME=/home/zope/testInstance

INSTANCE_NAME=`basename ${INSTANCE_HOME}`
ZOPE_USER=zope
RETVAL=0

#get config
. /etc/sysconfig/network

#check if network is "up"
[ "${NETWORKING}" = no ] && exit 0

start(){
echo -n "Starting zope: "

su -l $ZOPE_USER -c "${INSTANCE_HOME}/bin/instance start" > /dev/null 2>&1
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/${INSTANCE_NAME}
echo
}

# call 'em
case "$1" in
start)
start
;;
esac

exit 0
//----------------------
Somewhere, ([url]https://mail.zope.org/pipermail/zope/2001-June/092773.html)
I found I could do:
cd /etc/rc.d/rc3.d; ln -s ../init.d/zope S73zope ..... but what is this
S73zope file? Who creates it? I don't have it in my system. (So I get error, if I execute that command.)
(Is it created when "chkconfig --levels 2345 zope on" is executed?)

**
Thank you for your time.
 
Old 03-13-2011, 06:12 PM   #2
Brocifer
Member
 
Registered: Mar 2011
Posts: 46

Rep: Reputation: 1
Quote:
Originally Posted by x201s View Post
Hi All,
I have this script, called zope, which I am trying to register as a service.
When I type "chkconfig --add zope", it says "service zope does not support chkconfig" yet when I type "service zope start", it starts zope server alright.

When I type "chkconfig --list", no zope is in sight. If I run,
"chkconfig --del zope", it complains with same "does not support" error.

After registering zope, even while it was complaining, I set the run
level ("chkconfig --levels 2345 zope on").

Also, when I run:
su -l $ZOPE_USER -c "${INSTANCE_HOME}/bin/instance start" > /dev/null 2>&1
with appropriate substitution for ZOPE_USER and INSTANCE_HOME, zope starts alright.


Does anyone see any obvious error? Or some hidden edict that I am not following?

The file is in /etc/init.d.
.//------------------------------
#!/bin/sh
# chkconfig: 2345 84 16
#
# Source function library.
. /etc/rc.d/init.d/functions

INSTANCE_HOME=/home/zope/testInstance

INSTANCE_NAME=`basename ${INSTANCE_HOME}`
ZOPE_USER=zope
RETVAL=0

#get config
. /etc/sysconfig/network

#check if network is "up"
[ "${NETWORKING}" = no ] && exit 0

start(){
echo -n "Starting zope: "

su -l $ZOPE_USER -c "${INSTANCE_HOME}/bin/instance start" > /dev/null 2>&1
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/${INSTANCE_NAME}
echo
}

# call 'em
case "$1" in
start)
start
;;
esac

exit 0
//----------------------
Somewhere, ([url]https://mail.zope.org/pipermail/zope/2001-June/092773.html)
I found I could do:
cd /etc/rc.d/rc3.d; ln -s ../init.d/zope S73zope ..... but what is this
S73zope file? Who creates it? I don't have it in my system. (So I get error, if I execute that command.)
(Is it created when "chkconfig --levels 2345 zope on" is executed?)

**
Thank you for your time.
What is the output from:

Code:
chkconfig --list | grep zope
the S73zope is an alias in your runlevel 3 init directory that tells your system to start zope in runlevel 3, you should leave it alone. If it was preceded w/ a 'K' its function would be to prevent it from loading in rl 3.

This might help too man.

Last edited by Brocifer; 03-13-2011 at 07:25 PM. Reason: bonehead mistake
 
Old 03-14-2011, 09:47 PM   #3
x201s
Member
 
Registered: Dec 2010
Posts: 67

Original Poster
Rep: Reputation: 0
Brocifer, thanks for the comments.

Somebody pointed that hkconfig requires a description: line as well, like:

#!/bin/sh
# chkconfig: 2345 84 16
# description: Zope service

I am a happy man again!

Cheers.
 
  


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
[SOLVED] chkconfig problem:cannot add conky RudraB Linux - Networking 2 09-12-2010 03:20 PM
[SOLVED] chkconfig: cannot add new service. deostroll Linux - Server 5 03-09-2010 01:09 AM
chkconfig --add auditd mccartjd Linux - Newbie 6 05-21-2008 03:28 PM
chkconfig --add noir911 Linux - General 3 11-23-2006 01:26 AM
How do I add a program to the chkconfig --list? hunterhunter Linux - General 1 04-12-2006 05:13 PM


All times are GMT -5. The time now is 12:04 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