/etc/init.d/drbdlinksclean is in drbdlinks 1.22-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | #!/bin/sh
#
# drbdlinks: Cleans links made by drbdlinks.
#
# chkconfig: 2345 74 06
# description: Calls drbdlinks on initial system boot and shutdown to make
# sure that any links set up by drbdlinks are cleaned up when
# drbd is not running.
#
### BEGIN INIT INFO
# Provides: drbdlinksclean
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Clean up drbdlinks links on system boot or shutdown.
# Description: Calls drbdlinks on initial system boot and shutdown to make
# sure that any links set up by drbdlinks are cleaned up when
# drbd is not running.
### END INIT INFO
#
# This script has been modified from the CentOS/RHEL version provided by
# upstream to Debian
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=drbdlinks
SCRIPTNAME=/etc/init.d/$NAME
# Source function library.
. /lib/lsb/init-functions
FOUNDFILE=0
[ -f /etc/drbdlinks.conf ] && FOUNDFILE=1
# also clean up old /var/run location.
for FILE in /var/lib/drbdlinks/configs-to-clean/* \
/var/run/drbdlinks/configs-to-clean/*
do
[ ! -f "$FILE" ] && continue
FOUNDFILE=1
break
done
if [ "$FOUNDFILE" != 1 ]
then
echo "No /etc/drbdlinks.conf file. Aborting."
exit 1
fi
case "$1" in
start)
"$0" stop
exit "$?"
;;
stop)
echo -n 'Cleaning up drbdlinks.conf links...'
# main drbdlinks.conf file
RET=0
if [ -f /etc/drbdlinks.conf ]
then
if grep -q '^mountpoint(' /etc/drbdlinks.conf
then
/usr/sbin/drbdlinks stop
RET=$?
else
echo "No mountpoint found in /etc/drbdlinks.conf, skipping." | \
logger -t drbdlinksclean
echo "No mountpoint found in /etc/drbdlinks.conf, skipping."
fi
fi
# clean up any supplemental config files
for FILE in /var/lib/drbdlinks/configs-to-clean/* \
/var/run/drbdlinks/configs-to-clean/*
do
[ ! -f "$FILE" ] && continue
echo -n "Cleaning up '${FILE##*/}' links..."
echo "Cleaning up '${FILE##*/}' links..." | \
logger -t drbdlinksclean
/usr/sbin/drbdlinks --config-file "$FILE" stop || RET=$?
done
if [ "$RET" -eq 0 ]
then
log_success_msg OK
else
log_failure_msg stop-failure
exit 1
fi
;;
restart|force-reload)
"$0" start
;;
status)
exec /usr/sbin/drbdlinks status
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
|