I have wrote script /etc/init.d/xxx which start/stop my service on CentOS 5.5.
When I call 'service start xxx' or 'service stop xxx' everything works fine.
But when I restart my machine, I see in the logs that on shutdown the service was not stopped.
However, it started on boot.
> chkconfig --list xxx xxx 0:off 1:off 2:on 3:on 4:on 5:on 6:off
What I am doing wrong.
Thank you.
UPD: the header of the script:
#!/bin/bash
#
# Startup script for the xxx
#
# chkconfig: 345 99 01
# description: This script ...
#
### BEGIN INIT INFO
# Provides: xxx
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start:
### END INIT INFO
Best Answer
I am not a linux guru, more of a noob actually, but in order to execute the shutdown script you must create a lock file in /var/lock/subsys/ folder in your startup script. I found the answer here: CentOS Forum
Script example: