--- hdapsd.init 2009-10-26 07:56:26.000000000 +0100 +++ /etc/init.d/hdapsd 2010-02-09 21:05:06.415196323 +0100 @@ -12,15 +12,17 @@ return 1 fi - if [ ! -b /dev/${DISK} ]; then - eerror "Could not find disk /dev/${DISK}!" - eerror "Adjust the DISK setting in /etc/conf.d/hdapsd" - return 1 - fi + for disk in ${DISK}; do + if [[ -b /dev/$disk ]] && [[ -e /sys/block/$disk/device/unload_heads ]]; then + DISKOPTS+="-d $disk " + else + ewarn "$disk from DISKS does not exist or does not support unload feature" + fi + done - if [[ ! -e /sys/block/${DISK}/queue/protect ]] && [[ ! -e /sys/block/${DISK}/device/unload_heads ]] ; then - eerror "No protect entry for ${DISK}!" - eerror "Make sure your kernel is patched with the blk_freeze patch" + if [[ -z ${DISKOPTS} ]]; then + eerror "Could not find any of the disks!" + eerror "Adjust the DISK setting in /etc/conf.d/hdapsd" return 1 fi @@ -43,7 +45,7 @@ ebegin "Starting Hard Drive Active Protection System daemon" start-stop-daemon --start --exec /usr/sbin/hdapsd \ --pidfile /var/run/hdapsd.pid \ - -- -b -p -d "${DISK}" -s "${THRESHOLD}" ${OPTIONS} + -- -b -p ${DISKOPTS} -s "${THRESHOLD}" ${OPTIONS} eend $? }