bacula: Changed storage daemon to run as bacula user instead of root and converted tape alerts to use custom script.

This commit is contained in:
Timo Mkinen 2013-05-21 08:38:15 +03:00
parent f3ad618caa
commit 9c3f13701a
3 changed files with 60 additions and 6 deletions

23
bacula/files/tapealert Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` <device>" 1>&2
exit 1
fi
PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
DEVICE=$1
GENERIC=`readlink /sys/class/scsi_tape/\`basename ${DEVICE}\`/device/generic`
if [ $? -ne 0 ]; then
echo "ERR: Cannot find tape drive ${DEVICE}" 1>&2
exit 1
fi
GENERIC=/dev/`basename ${GENERIC}`
tapeinfo -f ${GENERIC} | fgrep TapeAlert
if [ $? -eq 1 ]; then
exit 0
fi
smartctl -H -l error ${GENERIC}