]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - VBLADE/vblade-master/contrib/persistence/vblade.init.daemon
3 PATH
=/sbin
:/usr
/sbin
:/bin
:/usr
/bin
6 VBLADE
="/usr/sbin/$NAME"
9 PIDDIR
="/var/run/vblade/"
11 [ -x "$VBLADE" ] || exit 0
12 [ -x "$DAEMON" ] || exit 0
16 # Emulation of LSB functions
23 if [ "$CODE" -eq 0 ] ; then
30 # Start a vblade instance
33 # 0 if daemon has been started
34 # 1 if daemon was already running
35 # 2 if daemon could not be started
40 sh
-n "$CONFIG" 2>/dev
/null
|| return 2
51 [ "$netif" ] || return 2
52 [ "$shelf" ] || return 2
53 [ "$slot" ] || return 2
54 [ "$filename" ] || return 2
56 if [ "$ionice" ] ; then
57 if [ -x "$IONICE" ] ; then
58 ionice
="$IONICE $ionice"
67 --pidfiles "$PIDDIR" \
72 --pidfiles "$PIDDIR" \
73 --output daemon.notice \
74 --stdout daemon.notice \
75 --stderr daemon.err
-- \
76 $VBLADE $options $shelf $slot $netif $filename || return 2
79 # Stop a vblade instance
82 # 0 if daemon has been stopped
83 # 1 if daemon was already stopped
84 # 2 if daemon could not be stopped
85 # other if a failure occurred
92 --pidfiles "$PIDDIR" || return 1
96 --pidfiles "$PIDDIR" \
98 # Wait until the process is gone
99 for i
in $(seq 1 10) ; do
103 --pidfiles "$PIDDIR" || return 0
113 INSTANCE
="$(basename "${CONFIG%%.conf}")"
117 [ "$VERBOSE" != no
] && log_daemon_msg
"Starting $DESC" "$INSTANCE"
118 do_start
"$INSTANCE" "$CONFIG"
120 0|1) [ "$VERBOSE" != no
] && log_end_msg
0 ;;
121 2) [ "$VERBOSE" != no
] && log_end_msg
1 ;;
125 [ "$VERBOSE" != no
] && log_daemon_msg
"Stopping $DESC" "$INSTANCE"
128 0|1) [ "$VERBOSE" != no
] && log_end_msg
0 ;;
129 2) [ "$VERBOSE" != no
] && log_end_msg
1 ;;
138 echo "$DESC instance $INSTANCE is running"
140 echo "$DESC instance $INSTANCE is not running"
144 restart
|force
-reload)
145 log_daemon_msg
"Restarting $DESC" "$INSTANCE"
149 do_start
"$INSTANCE" "$CONFIG"
153 # Old process is still running or
165 echo "Usage: /etc/init.d/vblade {start|stop|status|restart|force-reload} [<export> ...]" >&2
177 CONFIG
="/etc/vblade.conf.d/$1.conf"
178 if [ -f "$CONFIG" ] ; then
184 for CONFIG
in /etc
/vblade.conf.d
/*.conf
; do
185 if [ -f "$CONFIG" ] ; then