functions: add detect_init_style().
authorMichael Adam <obnox@samba.org>
Fri, 16 Jan 2009 12:26:57 +0000 (13:26 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 16 Jan 2009 12:26:57 +0000 (13:26 +0100)
Michael

config/functions

index c6295c3f0be8ccb2d2b6bb4332df682d5d46ec8e..cca93e9b9b6d4fc7139692000b17c981f1894ec2 100644 (file)
@@ -13,6 +13,20 @@ loadconfig() {
     fi
 }
 
+##############################################################
+# determine on what type of system (init style) we are running
+detect_init_style() {
+    # only do detection if not already set:
+    test "x$CTDB_INIT_STYLE" != "x" && return
+
+    if [ -x /sbin/startproc ]; then
+        CTDB_INIT_STYLE="suse"
+    elif [ -x /sbin/start-stop-daemon ]; then
+        CTDB_INIT_STYLE="ubuntu"
+    else
+        CTDB_INIT_STYLE="redhat"
+    fi
+}
 
 ######################################################
 # simulate /sbin/service on platforms that don't have it