diff --git a/files/service/maldet.sh b/files/service/maldet.sh index 6473782..b8ca3e8 100644 --- a/files/service/maldet.sh +++ b/files/service/maldet.sh @@ -7,7 +7,11 @@ # processname: maldet # Source function library. -. /etc/init.d/functions +if [ -f /etc/init.d/functions ]; then + . /etc/init.d/functions +elif [ -f /lib/lsb/init-functions ]; then + . /lib/lsb/init-functions +fi if [ -f "/etc/sysconfig/maldet" ]; then . /etc/sysconfig/maldet elif [ "$(egrep ^default_monitor_mode /usr/local/maldetect/conf.maldet 2> /dev/null)" ]; then @@ -18,7 +22,11 @@ elif [ "$(egrep ^default_monitor_mode /usr/local/maldetect/conf.maldet 2> /dev/n fi RETVAL=0 prog="maldet" -LOCKFILE=/var/lock/subsys/$prog +if [ -d /var/lock/subsys ]; then + LOCKFILE=/var/lock/subsys/$prog +else + LOCKFILE=/var/lock/$prog +fi if [ -z "$MONITOR_MODE" ]; then echo "error no default monitor mode defined, set \$MONITOR_MODE in /etc/sysconfig/maldet or \$default_monitor_mode in /usr/local/maldetect/conf.maldet"