| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-08-2010, 10:23 AM
|
#1
|
|
Member
Registered: Aug 2007
Location: Chennai
Distribution: ubuntu
Posts: 111
Rep:
|
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.
|
|
|
|
03-08-2010, 10:46 AM
|
#2
|
|
Member
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 351
Rep:
|
#!/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
|
|
|
|
03-08-2010, 01:14 PM
|
#3
|
|
Member
Registered: Aug 2007
Location: Chennai
Distribution: ubuntu
Posts: 111
Original Poster
Rep:
|
I thought those were plain comments...anyway is there any logic for the starting and stopping order? 25,75?
|
|
|
|
03-08-2010, 01:47 PM
|
#4
|
|
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,763
Rep: 
|
Quote:
Originally Posted by deostroll
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.
|
|
|
|
03-09-2010, 01:03 AM
|
#5
|
|
Member
Registered: Aug 2007
Location: Chennai
Distribution: ubuntu
Posts: 111
Original Poster
Rep:
|
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
|
|
|
|
03-09-2010, 01:09 AM
|
#6
|
|
Member
Registered: Aug 2007
Location: Chennai
Distribution: ubuntu
Posts: 111
Original Poster
Rep:
|
okay problem fixed. I wrote it exactly how u've mentioned it the first time...
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:27 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|