freebsd-ports/sysutils/dsbmd/files/dsbmd.in
Tobias Kortkamp a9743126ec sysutils/dsbmd: Update to 1.3
- Support for XFS and Btrfs has been added via the new LKL option.

- Detection for attached GELI devices has been added.

- A bug where the console gets flooded by a ata0: FAILURE - zero length DMA
  transfer attempted messages has been fixed.

- A bug where DSBMD delayed system shutdown has been fixed.

Changes:	https://freeshell.de/~mk/projects/dsbmd-relnotes.html
PR:		226564
Submitted by:	Marcel Kaiser <mk@nic-nac-project.org> (maintainer)
2018-03-13 02:25:31 +00:00

46 lines
753 B
Bash

#!/bin/sh
# $FreeBSD$
#
# PROVIDE: dsbmd
# REQUIRE: LOGIN devfs devd mountlate
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# dsbmd_enable (bool): Set to NO by default.
# Set it to YES to enable dsbmd.
#
. /etc/rc.subr
name=dsbmd
command=%%PREFIX%%/libexec/dsbmd
rcvar=dsbmd_enable
pidfile=/var/run/dsbmd.pid
stop_cmd=dsbmd_stop
load_rc_config $name
: ${dsbmd_enable:="NO"}
dsbmd_stop()
{
if [ -f ${pidfile} ]; then
echo "Stopping ${name}."
pid=$(cat ${pidfile})
n=0
while [ $n -lt 5 ]; do
kill ${pid} 2>/dev/null || return 0
n=$(($n + 1))
sleep 1
done
kill -KILL ${pid} 2>/dev/null
else
echo "${name} is not running."
return 1
fi
}
run_rc_command "$1"