File fix-initscript.dif of Package cobbler
--- config/cobblerd
+++ config/cobblerd 2011/01/11 11:40:56
@@ -7,8 +7,10 @@
### BEGIN INIT INFO
# Provides: cobblerd
-# Required-Start: network, xinetd, httpd
+# Required-Start: $syslog $local_fs $network $remote_fs apache2
+# Required-Stop: $syslog $local_fs $network $remote_fs apache2
# Default-Start: 3 4 5
+# Default-Stop: 0 1 6
# Short-Description: daemon for libvirt virtualization API
# Description: This is a daemon that a provides remote cobbler API
# and status tracking
@@ -26,12 +28,14 @@
[ -x /usr/bin/cobblerd ] || exit 0
DEBIAN_VERSION=/etc/debian_version
-SUSE_RELEASE=/etc/SuSE-release
+SUSE_RELEASE=/etc/SuSEconfig
+IS_SUSE="no"
# Source function library.
if [ -f $DEBIAN_VERSION ]; then
break
-elif [ -f $SUSE_RELEASE -a -r /etc/rc.status ]; then
+elif [ -d $SUSE_RELEASE -a -r /etc/rc.status ]; then
. /etc/rc.status
+ IS_SUSE="yes"
else
. /etc/rc.d/init.d/functions
fi
@@ -49,8 +53,8 @@
start() {
echo -n $"Starting cobbler daemon: "
- if [ -f $SUSE_RELEASE ]; then
- startproc -f -p /var/run/$SERVICE.pid /usr/bin/cobblerd $CONFIG_ARGS
+ if [ $IS_SUSE == "yes" ]; then
+ startproc -p /var/run/$SERVICE.pid /usr/bin/cobblerd $CONFIG_ARGS
rc_status -v
elif [ -e $DEBIAN_VERSION ]; then
if [ -f $LOCKFILE ]; then
@@ -71,7 +75,7 @@
stop() {
echo -n $"Stopping cobbler daemon: "
- if [ -f $SUSE_RELEASE ]; then
+ if [ $IS_SUSE == "yes" ]; then
killproc -TERM /usr/bin/cobblerd
rc_status -v
elif [ -f $DEBIAN_VERSION ]; then
@@ -106,7 +110,7 @@
$1
;;
status)
- if [ -f $SUSE_RELEASE ]; then
+ if [ $IS_SUSE == "yes" ]; then
echo -n "Checking for service cobblerd "
checkproc /usr/bin/cobblerd
rc_status -v