Red Hat Enterprise Linux > AS/ES/WS v. 3 > Issue
<<
315 of 593
>>
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
}
|
Red Hat Enterprise Linux
>
AS/ES/WS v. 3
> Issue
<<
315
of
593
>>