LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-08-2010, 10:23 AM   #1
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 112

Rep: Reputation: 15
chkconfig: cannot add new service.


Hi,

I've just created a new chkready script. but on trying to add it will the following command I get an error:

Code:
$ chkconfig --add languagetool 
service languagetool does not support chkconfig
PS: Just learned how to write a chkconfig script. Please check this post for script.
 
Old 03-08-2010, 10:46 AM   #2
sarin
Member
 
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Blog Entries: 2

Rep: Reputation: 34
#!/bin/bash
# test script
# Authors: Sarin
# chkconfig: 345 25 75
# description: Nothing


You should have a header like the one shown above. The only useful thing there is
# chkconfig: 345 25 75
345: levels 345
25,75: Decides the starting and stopping order
 
Old 03-08-2010, 01:14 PM   #3
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 112

Original Poster
Rep: Reputation: 15
I thought those were plain comments...anyway is there any logic for the starting and stopping order? 25,75?
 
Old 03-08-2010, 01:47 PM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,933
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by deostroll View Post
I thought those were plain comments...anyway is there any logic for the starting and stopping order? 25,75?
Those are start priorities...

A quick look at the chkconfig man page tells us this...

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 sec-
       ond 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.
 
Old 03-09-2010, 01:03 AM   #5
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 112

Original Poster
Rep: Reputation: 15
chkconfig still doesn't accept...here is how the script looks now:

Code:
#!/bin/bash
# language tool service script
# chkconfig: 345 20 80
# desc: service to start the language tool grammar check java program

# /etc/init.d/languagetool

case "$1" in
  start)
        echo -e "Starting languagetool service\n"
        #To run it as root:
        /var/www/html/languagetool/languagetool.sh
        ;;
  stop)
        echo -e "Stopping languagetool\n"
        #To run it as root:
        #/path/to/command/to/stop/languagetool
        #Or to run it as some other user:
        #/bin/su - username -c /path/to/command/to/stop/languagetool
        #echo "."
        kill `ps -ef | grep 'java -cp' | grep -v grep | awk '{ print $2 }'`
        ;;

  *)
        echo "Usage: /sbin/service languagetool {start|stop}"
        exit 1
esac

exit 0
 
Old 03-09-2010, 01:09 AM   #6
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 112

Original Poster
Rep: Reputation: 15
okay problem fixed. I wrote it exactly how u've mentioned it the first time...
 
  


Reply

Tags
centos, chkconfig, daemon, service


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
I had start smb service but in chkconfig it closed boy_to_man Linux - Newbie 6 12-19-2006 09:41 AM
service foo does not support chkconfig packets Linux - Newbie 2 12-18-2006 10:23 PM
chkconfig --add noir911 Linux - General 3 11-23-2006 01:26 AM
solaris equivalent of chkconfig and service of redhat linux sanjeevkchopra Solaris / OpenSolaris 3 07-11-2006 03:45 PM
AIX equivalent of chkconfig and service in redhat linux sanjeevkchopra AIX 1 07-11-2006 10:07 AM


All times are GMT -5. The time now is 02:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration