diff --git a/etc/init/autofs-nis.conf b/etc/init/autofs-nis.conf index cdc5fd6..7a51710 100644 --- a/etc/init/autofs-nis.conf +++ b/etc/init/autofs-nis.conf @@ -12,13 +12,19 @@ pre-start script source /etc/init/functions if grep automount /etc/nsswitch.conf|grep -q nis; then if [ -f /var/run/autofs/automount_nis.pid ]; then - if ps -ef|awk '{print $2}'|grep -q `cat /var/run/autofs/automount_nis.pid`; then + if ps -ef|\ + grep automount |\ + grep nis |\ + awk '{print $2}'|\ + grep -q `cat /var/run/autofs/automount_nis.pid`; then echo -n "Automount already running" exit 10 else rm /var/run/autofs/automount_nis.pid fi fi + else + exit 10 fi end script diff --git a/etc/init/autofs.conf b/etc/init/autofs.conf index 2b3a9c8..ef63de1 100644 --- a/etc/init/autofs.conf +++ b/etc/init/autofs.conf @@ -12,7 +12,11 @@ pre-start script source /etc/init/functions if [ -f /etc/sysconfig/auto.master ] && grep automount /etc/nsswitch.conf|grep -q files; then if [ -f /var/run/autofs/automount_files.pid ]; then - if ps -ef|awk '{print $2}'|grep -q `cat /var/run/autofs/automount_files.pid`; then + if ps -ef|\ + grep automount |\ + grep nis |\ + awk '{print $2}'|\ + grep -q `cat /var/run/autofs/automount_files.pid`; then echo "Automount already running - not started" exit 10 else @@ -20,6 +24,8 @@ pre-start script rm /var/run/autofs/automount_files.pid fi fi + else + exit 10 fi end script