Browse Source

Improve init scripts

Christoph Biedl 2 years ago
parent
commit
4ae6b7ada5
2 changed files with 106 additions and 0 deletions
  1. 103 0
      debian/patches/improve-init-scripts.patch
  2. 3 0
      debian/patches/series

+ 103 - 0
debian/patches/improve-init-scripts.patch

@@ -0,0 +1,103 @@
+Subject: Improve init scripts
+Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Forwarded: not-yet
+Date: 2018-09-23
+
+--- a/contrib/persistence/vblade.init.in
++++ b/contrib/persistence/vblade.init.in
+@@ -8,7 +8,7 @@
+ # Default-Start:     2 3 4 5
+ # Default-Stop:      0 1 6
+ # Short-Description: vblade exports
+-# Description:       Manage all vlbade exports defined in
++# Description:       Manage all vblade exports defined in
+ #                    /etc/vblade.conf.d/
+ ### END INIT INFO
+ 
+@@ -98,6 +98,10 @@
+         --exec $ionice "$VBLADE" -- \
+         $shelf $slot $netif $filename $options \
+         || return 2
++    sleep 1
++    start-stop-daemon --start --quiet \
++        --pidfile "$PIDFILE" --exec "$VBLADE" --test > /dev/null \
++        && return 2
+ [% ELSIF control == 'daemon' -%]
+     "$DAEMON" \
+         --running \
+@@ -112,6 +116,12 @@
+         --stdout daemon.notice \
+         --stderr daemon.err -- \
+         $VBLADE $options $shelf $slot $netif $filename || return 2
++    sleep 1
++    "$DAEMON" \
++        --running \
++        --name "$INSTANCE" \
++        --pidfiles "$PIDDIR" \
++        || return 2
+ [% END -%]
+ }
+ 
+@@ -168,7 +178,10 @@
+             do_start "$INSTANCE" "$CONFIG"
+             case "$?" in
+                 0|1)    [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+-                2)      [ "$VERBOSE" != no ] && log_end_msg 1 ;;
++                2)
++                    [ "$VERBOSE" != no ] && log_end_msg 1
++                    EXIT=1
++                    ;;
+             esac
+             ;;
+         stop)
+@@ -176,7 +189,10 @@
+             do_stop "$INSTANCE"
+             case "$?" in
+                 0|1)    [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+-                2)      [ "$VERBOSE" != no ] && log_end_msg 1 ;;
++                2)
++                    [ "$VERBOSE" != no ] && log_end_msg 1
++                    EXIT=1
++                    ;;
+             esac
+             ;;
+         status)
+--- a/contrib/persistence/vblade.init.lsb-daemon
++++ b/contrib/persistence/vblade.init.lsb-daemon
+@@ -77,6 +77,12 @@
+         --stdout daemon.notice \
+         --stderr daemon.err -- \
+         $VBLADE $options $shelf $slot $netif $filename || return 2
++    sleep 1
++    "$DAEMON" \
++        --running \
++        --name "$INSTANCE" \
++        --pidfiles "$PIDDIR" \
++        || return 2
+ }
+ 
+ # Stop a vblade instance
+@@ -121,7 +127,10 @@
+             do_start "$INSTANCE" "$CONFIG"
+             case "$?" in
+                 0|1)    [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+-                2)      [ "$VERBOSE" != no ] && log_end_msg 1 ;;
++                2)
++                    [ "$VERBOSE" != no ] && log_end_msg 1
++                    EXIT=1
++                    ;;
+             esac
+             ;;
+         stop)
+@@ -129,7 +138,10 @@
+             do_stop "$INSTANCE"
+             case "$?" in
+                 0|1)    [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+-                2)      [ "$VERBOSE" != no ] && log_end_msg 1 ;;
++                2)
++                    [ "$VERBOSE" != no ] && log_end_msg 1
++                    EXIT=1
++                    ;;
+             esac
+             ;;
+         status)

+ 3 - 0
debian/patches/series

@@ -2,6 +2,9 @@
 # cherry-picked from upstream
 cherry-pick.vblade-24-1-g02afd36.support-for-vblade-persistence.patch
 
+# to be upstreamed
+improve-init-scripts.patch
+
 # local modification
 local.makefile-additional-commands.patch
 local.vbladed-check-params.patch