 +. /lib/lsb/init-functions
  
  NAME="shinken-skonf"
-
+ 
+@@ -50,6 +51,31 @@ curdir=$(dirname "$0")
+ 
+ export SHINKEN_MODULE_FILE="$NAME"  ## for 'shinken' init script to see that it's called by us
+ 
+-"$curdir/shinken" $@ skonf
++case "$1" in 
++  start)
++    "$curdir/shinken" start skonf
++    ;;
++  stop)
++    "$curdir/shinken" stop skonf
++    ;;
++  check|checkconfig)
++    "$curdir/shinken" checkconfig skonf
++    ;;
++  status)
++    "$curdir/shinken" status skonf
++    ;;
++  reload)
++    "$curdir/shinken" reload skonf
++   ;;
++  restart|force-reload)
++    "$curdir/shinken" restart skonf
++    ;;
++  *)
++    echo "Usage: /etc/init.d/shinken-skonf [-d] {start|stop|reload|restart|check}
++
++  -d  start requested module(s) in debug mode, only useful with start|restart
++" || true
++    exit 1
++esac
+ 
+ exit $?
+diff --git a/debian/patches/11_shinken_init.patch b/debian/patches/11_shinken_init.patch
+index 865d7a3..d06286b 100644
+--- a/debian/patches/11_shinken_init.patch
++++ b/debian/patches/11_shinken_init.patch
+@@ -1,190 +0,0 @@
+-diff --git a/bin/init.d/shinken b/bin/init.d/shinken
+-index 5e7e495..a424ecc 100755
+---- a/bin/init.d/shinken
+-+++ b/bin/init.d/shinken
+-@@ -40,11 +40,22 @@
+- # Deadlink :(
+- # http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
+-
+-+. /lib/lsb/init-functions
+-
+- NAME="shinken"
+-
+--## If you want to give a test to the BETA skonf tool, you can add skonf to the list below
+--AVAIL_MODULES="scheduler poller reactionner broker receiver arbiter"
+-+
+-+## This permits to overhidde the default "default shinken cfg file":
+-+[ -z "$SHINKEN_DEFAULT_FILE" ] && SHINKEN_DEFAULT_FILE="/etc/default/$NAME"
+-+## so you can now do:
+-+## bash -c "SHINKEN_DEFAULT_FILE=$your_own_default_file $init_path/shinken $action $args"
+-+## to easily use your own config
+-+
+-+#echo "Using $SHINKEN_DEFAULT_FILE .."
+-+
+-+# Reads configuration variable file if it is present
+-+[ -r "$SHINKEN_DEFAULT_FILE" ] && . "$SHINKEN_DEFAULT_FILE"
+-+
+-
+- ## SHINKEN_MODULE_FILE is set by shinken-* if it's one of these that's calling us.
+- if [ -z "$SHINKEN_MODULE_FILE" ]; then
+-@@ -106,16 +120,6 @@ DEBUG=false
+- CMD=""
+- SUBMODULES=""
+- 
+--## This permits to overhidde the default "default shinken cfg file":
+--[ -z "$SHINKEN_DEFAULT_FILE" ] && SHINKEN_DEFAULT_FILE="/etc/default/$NAME"
+--## so you can now do:
+--## bash -c "SHINKEN_DEFAULT_FILE=$your_own_default_file $init_path/shinken $action $args"
+--## to easily use your own config
+--
+--#echo "Using $SHINKEN_DEFAULT_FILE .."
+--
+--
+--
+- usage() {
+-     cat << END
+- Usage: $SCRIPTNAME [ -d ] {start|stop|restart|status|check} $_usage_mods_
+-@@ -152,20 +156,11 @@ else
+-     done
+- fi
+- 
+--
+--# Reads configuration variable file if it is present
+--[ -r "$SHINKEN_DEFAULT_FILE" ] && . "$SHINKEN_DEFAULT_FILE"
+--
+--
+- # Now look if some required variables are pre defined:
+- if ! test "$SHINKENCFG"
+- then
+-     SHINKENCFG="$ETC/nagios.cfg"
+- fi
+--if ! test "$SHINKENSPECIFICCFG"
+--then
+--    SHINKENSPECIFICCFG="$ETC/shinken-specific.cfg"
+--fi
+- 
+- # If var or run dir is missing, create them and chown them
+- [ ! -d $VAR ] && mkdir -p $VAR && chown $SHINKENUSER:$SHINKENGROUP $VAR
+-@@ -284,13 +279,20 @@ do_start() {
+-     [ "$DEBUG" = 1 ] && DEBUGCMD="--debug "$(getdebugfile "$mod")
+-     # Skonf need skonf.cfg, arbiter nagios.cfg, and the other OTHERd.ini
+-     if [ "$mod" = 'skonf' ]; then
+--	output=$("$modfilepath" -d -c "$SKONFCFG" $DEBUGCMD 2>&1)
+-+        output=$("$modfilepath" -d -c "$SKONFCFG" $DEBUGCMD 2>&1)
+-         rc=$?
+-     elif [ "$mod" != "arbiter" ]; then
+--        output=$("$modfilepath" -d -c "$ETC/${mod}d.ini" $DEBUGCMD 2>&1)
+-+        modINI=$(echo "$"${mod}CFG | tr '[:lower:]' '[:upper:]')
+-+        modinifile=$(eval echo ${modINI})
+-+        output=$("$modfilepath" -d -c "${modinifile}" $DEBUGCMD 2>&1)
+-         rc=$?
+-     else
+--        output=$("$modfilepath" -d -c "$SHINKENCFG" -c "$SHINKENSPECIFICCFG" $DEBUGCMD 2>&1)
+-+        if ! test "$SHINKENSPECIFICCFG"
+-+        then
+-+            output=$("$modfilepath" -d -c "$SHINKENCFG" $DEBUGCMD 2>&1)
+-+        else
+-+            output=$("$modfilepath" -d -c "$SHINKENCFG" -c "$SHINKENSPECIFICCFG" $DEBUGCMD 2>&1)
+-+        fi
+-         rc=$?
+-     fi
+-     # debug:
+-@@ -373,7 +375,13 @@ do_stop() {
+- #
+- do_check() {
+-     [ "$DEBUG" = 1 ] && DEBUGCMD="--debug $VAR/${mod}-debug.log"
+--    "$BIN/shinken-arbiter" -v -c "$ETC/nagios.cfg" -c "$ETC/shinken-specific.cfg" $DEBUGCMD 2>&1
+-+    if ! test "$SHINKENSPECIFICCFG"
+-+        then
+-+            "$BIN/shinken-arbiter" -v -c "$SHINKENCFG" $DEBUGCMD 2>&1
+-+        else
+-+            "$BIN/shinken-arbiter" -v -c "$SHINKENCFG" -c "$SHINKENSPECIFICCFG" $DEBUGCMD 2>&1
+-+    fi
+-+
+-     return $?
+- }
+- 
+-diff --git a/bin/init.d/shinken-arbiter b/bin/init.d/shinken-arbiter
+-index 02ca504..b828bf1 100755
+---- a/bin/init.d/shinken-arbiter
+-+++ b/bin/init.d/shinken-arbiter
+-@@ -37,6 +37,7 @@
+- # Author: Gabes Jean <naparuba@gmail.com>
+- #         Olivier LI-KIANG-CHEONG <lkco@gezen.fr>
+- 
+-+. /lib/lsb/init-functions
+- 
+- NAME="shinken-arbiter"
+- 
+-diff --git a/bin/init.d/shinken-broker b/bin/init.d/shinken-broker
+-index b92f0ad..6c8f09c 100755
+---- a/bin/init.d/shinken-broker
+-+++ b/bin/init.d/shinken-broker
+-@@ -44,6 +44,7 @@
+- # Author: Gabes Jean <naparuba@gmail.com>
+- #         Olivier LI-KIANG-CHEONG <lkco@gezen.fr>
+- 
+-+. /lib/lsb/init-functions
+- 
+- NAME="shinken-broker"
+- 
+-diff --git a/bin/init.d/shinken-poller b/bin/init.d/shinken-poller
+-index 04a6cfa..361d4fb 100755
+---- a/bin/init.d/shinken-poller
+-+++ b/bin/init.d/shinken-poller
+-@@ -45,6 +45,7 @@
+- # Author: Gabes Jean <naparuba@gmail.com>
+- #         Olivier LI-KIANG-CHEONG <lkco@gezen.fr>
+- 
+-+. /lib/lsb/init-functions
+- 
+- NAME="shinken-poller"
+- 
+-diff --git a/bin/init.d/shinken-reactionner b/bin/init.d/shinken-reactionner
+-index db29e3e..9fcec9f 100755
+---- a/bin/init.d/shinken-reactionner
+-+++ b/bin/init.d/shinken-reactionner
+-@@ -44,6 +44,7 @@
+- # Author: Gabes Jean <naparuba@gmail.com>
+- #         Olivier LI-KIANG-CHEONG <lkco@gezen.fr>
+- 
+-+. /lib/lsb/init-functions
+- 
+- NAME="shinken-reactionner"
+- 
+-diff --git a/bin/init.d/shinken-receiver b/bin/init.d/shinken-receiver
+-index e7b8b5f..241119a 100755
+---- a/bin/init.d/shinken-receiver
+-+++ b/bin/init.d/shinken-receiver
+-@@ -44,6 +44,7 @@
+- # Author: Gabes Jean <naparuba@gmail.com>
+- #         Olivier LI-KIANG-CHEONG <lkco@gezen.fr>
+- 
+-+. /lib/lsb/init-functions
+- 
+- NAME="shinken-receiver"
+- 
+-diff --git a/bin/init.d/shinken-scheduler b/bin/init.d/shinken-scheduler
+-index 5af33ff..74fdadf 100755
+---- a/bin/init.d/shinken-scheduler
+-+++ b/bin/init.d/shinken-scheduler
+-@@ -44,6 +44,7 @@
+- # Author: Gabes Jean <naparuba@gmail.com>
+- #         Olivier LI-KIANG-CHEONG <lkco@gezen.fr>
+- 
+-+. /lib/lsb/init-functions
+- 
+- NAME="shinken-scheduler"
+- 
+-diff --git a/bin/init.d/shinken-skonf b/bin/init.d/shinken-skonf
+-index 6498433..cc0c8d8 100755
+---- a/bin/init.d/shinken-skonf
+-+++ b/bin/init.d/shinken-skonf
+-@@ -43,6 +43,7 @@
+- # Author: Gabes Jean <naparuba@gmail.com>
+- #         Olivier LI-KIANG-CHEONG <lkco@gezen.fr>
+- 
+-+. /lib/lsb/init-functions
+- 
+- NAME="shinken-skonf"
+-

 
 # If var or run dir is missing, create them and chown them
 [ ! -d $VAR ] && mkdir -p $VAR && chown $SHINKENUSER:$SHINKENGROUP $VAR
@@ -284,13 +279,20 @@ do_start() {
     [ "$DEBUG" = 1 ] && DEBUGCMD="--debug "$(getdebugfile "$mod")
     # Skonf need skonf.cfg, arbiter nagios.cfg, and the other OTHERd.ini
     if [ "$mod" = 'skonf' ]; then

diff --git a/bin/init.d/shinken b/bin/init.d/shinken
index ce51dcc..4c49de2 100755
--- a/bin/init.d/shinken
+++ b/bin/init.d/shinken
@@ -23,10 +23,10 @@
 
 ### BEGIN INIT INFO
 # Provides:          shinken
-# Required-Start:    $local_fs
-# Required-Stop:     $local_fs
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
 # Default-Start:     2 3 4 5
-# Default-Stop:      S 0 1 6
+# Default-Stop:      0 1 6
 # Short-Description: Shinken monitoring daemon
 # Description:       Shinken is a monitoring tool composed of many separated modules:
 #     - arbiter     : the main one : control everything else.
@@ -40,11 +40,22 @@
 # Deadlink :(
 # http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
 
+. /lib/lsb/init-functions
 
 NAME="shinken"
 
-## If you want to give a test to the BETA skonf tool, you can add skonf to the list below
-AVAIL_MODULES="scheduler poller reactionner broker receiver arbiter"
+
