Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Closed Thread
  Search this Thread
Old 05-03-2007, 11:22 AM   #1
LQ Newbie
Registered: Aug 2006
Posts: 13

Rep: Reputation: 0
custom init.d script will start but won't stop

Hey all, I've written a custom init.d script that will basically run a script /root/home/scripts/startup on startup and then when the server is shutting down run /root/home/scripts/shutdown.

I've run chkconfig --add testscript and it does have correct sym links for S and K in rc3.d,rc5.d, rc0.d, rc6.0.

Can anybody suggest anything? Sorry I've also posted this in the Red Hat forum. I'm running Red Hat Enterprise 4.0.



# chkconfig: 35 75 10
# description: my test server function

#Source function library.
. /etc/init.d/functions

start() {
initlog -c "echo -n TESTSCRIPT starting: "
### touch the lock file ###
touch /var/lock/subsys/startscript
touch /var/lock/subsys/stopscript
success $"My test script starting"

stop() {
initlog -c "echo -n RUNNING STOPSCRIPT: "
### Remove the lock file ###
rm -f /var/lock/subsys/startscript
rm -f /var/lock/subsys/stopscript
success $"My test script stopping"

case "$1" in
status servicename
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1

exit 0
Old 05-03-2007, 01:06 PM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,274
Blog Entries: 10

Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847
Naught. Naughty. You're only supposed to post in one forum. If you think you chose the wrong one you should ask the moderator to move it.
Old 05-03-2007, 01:23 PM   #3
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,191
Blog Entries: 4

Rep: Reputation: 464Reputation: 464Reputation: 464Reputation: 464Reputation: 464
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closed Thread

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to register auto start/stop service script with chkconfig travellers Linux - Software 8 06-15-2009 12:02 PM
custom init.d script will start but won't stop Qwerty9119 Red Hat 2 05-03-2007 01:51 PM
pure-ftpd init script fails to start server in standalone mode Cronjob Debian 1 05-23-2006 01:11 AM
using cron to start and stop a bash script monty Linux - Software 2 03-20-2006 03:30 PM
need a perl script to stop & start program cccc Programming 43 07-23-2005 08:27 PM

All times are GMT -5. The time now is 05:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration