]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - VBLADE/vblade-master/contrib/persistence/vblade.init.lsb-daemon
5 # Required-Start: $remote_fs $syslog $network
6 # Required-Stop: $remote_fs $syslog $network
7 # Default-Start: 2 3 4 5
9 # Short-Description: vblade exports
10 # Description: Manage all vlbade exports defined in
14 PATH
=/sbin
:/usr
/sbin
:/bin
:/usr
/bin
17 VBLADE
="/usr/sbin/$NAME"
18 DAEMON
=/usr
/bin
/daemon
19 IONICE
=/usr
/bin
/ionice
20 PIDDIR
="/var/run/vblade/"
22 [ -x "$VBLADE" ] || exit 0
23 [ -x "$DAEMON" ] || exit 0
27 # Load the VERBOSE setting and other rcS variables
30 # Define LSB functions
31 .
/lib
/lsb
/init
-functions
33 # Start a vblade instance
36 # 0 if daemon has been started
37 # 1 if daemon was already running
38 # 2 if daemon could not be started
43 sh
-n "$CONFIG" 2>/dev
/null
|| return 2
54 [ "$netif" ] || return 2
55 [ "$shelf" ] || return 2
56 [ "$slot" ] || return 2
57 [ "$filename" ] || return 2
59 if [ "$ionice" ] ; then
60 if [ -x "$IONICE" ] ; then
61 ionice
="$IONICE $ionice"
70 --pidfiles "$PIDDIR" \
75 --pidfiles "$PIDDIR" \
76 --output daemon.notice \
77 --stdout daemon.notice \
78 --stderr daemon.err
-- \
79 $VBLADE $options $shelf $slot $netif $filename || return 2
82 # Stop a vblade instance
85 # 0 if daemon has been stopped
86 # 1 if daemon was already stopped
87 # 2 if daemon could not be stopped
88 # other if a failure occurred
95 --pidfiles "$PIDDIR" || return 1
99 --pidfiles "$PIDDIR" \
101 # Wait until the process is gone
102 for i
in $(seq 1 10) ; do
106 --pidfiles "$PIDDIR" || return 0
116 INSTANCE
="$(basename "${CONFIG%%.conf}")"
120 [ "$VERBOSE" != no
] && log_daemon_msg
"Starting $DESC" "$INSTANCE"
121 do_start
"$INSTANCE" "$CONFIG"
123 0|1) [ "$VERBOSE" != no
] && log_end_msg
0 ;;
124 2) [ "$VERBOSE" != no
] && log_end_msg
1 ;;
128 [ "$VERBOSE" != no
] && log_daemon_msg
"Stopping $DESC" "$INSTANCE"
131 0|1) [ "$VERBOSE" != no
] && log_end_msg
0 ;;
132 2) [ "$VERBOSE" != no
] && log_end_msg
1 ;;
136 status_of_proc
-p "$PIDDIR/$INSTANCE.pid" "$VBLADE" "vblade instance $INSTANCE" || EXIT
=$?
138 restart
|force
-reload)
139 log_daemon_msg
"Restarting $DESC" "$INSTANCE"
143 do_start
"$INSTANCE" "$CONFIG"
147 # Old process is still running or
159 echo "Usage: /etc/init.d/vblade {start|stop|status|restart|force-reload} [<export> ...]" >&2
171 CONFIG
="/etc/vblade.conf.d/$1.conf"
172 if [ -f "$CONFIG" ] ; then
178 for CONFIG
in /etc
/vblade.conf.d
/*.conf
; do
179 if [ -f "$CONFIG" ] ; then