Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > AS/ES/WS v. 3 > Issue <<  315 of 593 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 5119
Last update: 03-05-05
Issue:
I have written a script to start/stop a service and placed a link in /etc/rc.d/rc#.d, but it still will not stop automatically. Why is this?
Resolution:
Release Found: Red Hat Enterprise Linux 3

Symptom:
You have written a script to start and stop a service and placed it in the directory /etc/rc.d/init.d. After using chkconfig to enable the service at different runlevels, the service starts successfully but will not stop automatically when shutting down or switching runlevels.

Solution:
There must be a corresponding lock file present in the /var/lock/subsys directory while the daemon or service is running. If there is no lock file, the service will start automatically but will not stop when changing runlevels. To create a lock file, simply touch a file in the start() section of the script and delete that file in the stop() section. For example:

 
start() {
  ...
  touch /var/lock/subsys/servicename
}

stop() {
  ...
  rm -f /var/lock/subsys/servicename
}
      



How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > AS/ES/WS v. 3 > Issue <<   315  of  593  >>