Lines Matching +full:lsb +full:- +full:first

1 # SPDX-License-Identifier: BSD-2-Clause
2 # This is a script with common functions etc used by zfs-import, zfs-load-key,
3 # zfs-mount, zfs-share and zfs-zed.
7 # Released under the 2-clause BSD license.
10 # Debian GNU/kFreeBSD zfsutils 8.1-3 package, written by Aurelien Jarno.
15 if [ -f /etc/rc.d/init.d/functions ]; then
18 elif [ -L /etc/init.d/functions.sh ]; then
21 elif [ -f /lib/lsb/init-functions ]; then
22 # LSB, Debian, and derivatives
23 . /lib/lsb/init-functions
27 # on different distributions - it would be way too easy
30 # LSB functions - fall through
41 if [ -n "$tIFS" ]
52 if [ "$1" -eq 0 ]; then
75 # Unknown - simple substitutes.
79 if [ "$ret" -ge 1 ]; then
105 if [ -f @initconfdir@/zfs ]; then
109 # ----------------------------------------------------
123 if [ "$ret" -eq 0 ]; then
143 if type start-stop-daemon > /dev/null 2>&1 ; then
144 # LSB functions
145 start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
146 --exec "$DAEMON_BIN" --test > /dev/null || return 1
149 start-stop-daemon --start --quiet --exec "$DAEMON_BIN" -- \
156 if [ -f "$PIDFILE" ] && [ -d /run/sendsigs.omit.d ]
158 ln -sf "$PIDFILE" /run/sendsigs.omit.d/zed
163 daemon --pidfile "$PIDFILE" "$DAEMON_BIN" "$@"
185 if type start-stop-daemon > /dev/null 2>&1 ; then
186 # LSB functions
187 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
188 --pidfile "$PIDFILE" --name "$DAEMON_NAME"
190 [ "$ret" = 0 ] && rm -f "$PIDFILE"
195 killproc -p "$PIDFILE" "$DAEMON_NAME"
197 [ "$ret" = 0 ] && rm -f "$PIDFILE"
216 # LSB functions
221 status -p "$PIDFILE" "$DAEMON_NAME"
236 if type start-stop-daemon > /dev/null 2>&1 ; then
237 # LSB functions
238 start-stop-daemon --stop --signal 1 --quiet \
239 --pidfile "$PIDFILE" --name "$DAEMON_NAME"
243 killproc -p "$PIDFILE" "$DAEMON_NAME" -HUP
255 if [ ! -x "$ZPOOL" ]; then
259 "$ZPOOL" -? > /dev/null 2>&1
263 if [ ! -x "$ZFS" ]; then
267 "$ZFS" -? > /dev/null 2>&1
277 if [ -x /sbin/udevadm ]; then
278 /sbin/udevadm trigger --action=change --subsystem-match=block
280 elif [ -x /sbin/udevsettle ]; then
289 if grep -qiE '(^|[^\\](\\\\)* )zfs=(off|no|0)( |$)' /proc/cmdline;
291 # Called with zfs=(off|no|0) - bail because we don't
295 # from the shell - we know what we're doing).
297 [ -n "$init" ] && exit 3
312 set -- $(mount | grep ' on / ')
322 echo "$var" | grep -Eiq "^yes$|^on$|^true$|^1$" && return 0 || return 1
329 [ -r "/sys/module/${module}/version" ] && return 0 || return 1
345 # first parameter is a regular expression that filters mtab
353 unset $(env | sed -e '/^MTAB_/!d' -e 's,=.*,,')
355 while read -r fs mntpnt fstype opts rest; do
356 if echo "$fs $mntpnt $fstype $opts" | grep -qE "$match"; then
368 mntpnt=$(printf '%b' "$mntpnt" | tr -d '/. -')
381 mntpnt=$(printf '%b' "$mntpnt" | tr -d '/. -')
389 # first parameter is a regular expression that filters fstab
397 unset $(env | sed -e '/^FSTAB_/!d' -e 's,=.*,,')
400 while read -r fs mntpnt fstype opts; do
401 echo "$fs" | grep -qE '^#|^$' && continue
402 echo "$mntpnt" | grep -qE '^none|^swap' && continue
403 echo "$fstype" | grep -qE '^swap' && continue
405 if echo "$fs $mntpnt $fstype $opts" | grep -qE "$match"; then
429 while read -r _ mp _; do