2010-04-20 14:01:45 +00:00
|
|
|
description "Startup autofs System for local configuration files"
|
|
|
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
|
|
|
version 1.0
|
|
|
|
emits none special
|
|
|
|
|
|
|
|
start on (runlevel [2345] and (started mountfs))
|
2010-06-23 10:16:49 +00:00
|
|
|
stop on runlevel [016]
|
2010-04-20 14:01:45 +00:00
|
|
|
|
|
|
|
console none
|
|
|
|
|
2010-09-20 13:28:27 +00:00
|
|
|
pre-start script
|
|
|
|
source /etc/init/functions
|
2010-04-20 14:01:45 +00:00
|
|
|
if [ -f /etc/sysconfig/auto.master ] && grep automount /etc/nsswitch.conf|grep -q files; then
|
|
|
|
if [ -f /var/run/autofs/automount_files.pid ]; then
|
2010-10-10 13:48:05 +00:00
|
|
|
if ps -ef|\
|
|
|
|
grep automount |\
|
|
|
|
grep nis |\
|
|
|
|
awk '{print $2}'|\
|
|
|
|
grep -q `cat /var/run/autofs/automount_files.pid`; then
|
2010-04-20 14:01:45 +00:00
|
|
|
echo "Automount already running - not started"
|
|
|
|
exit 10
|
|
|
|
else
|
|
|
|
echo -n "Removing old files"
|
|
|
|
rm /var/run/autofs/automount_files.pid
|
|
|
|
fi
|
|
|
|
fi
|
2010-10-10 13:48:05 +00:00
|
|
|
else
|
|
|
|
exit 10
|
2010-04-20 14:01:45 +00:00
|
|
|
fi
|
|
|
|
end script
|
2010-09-20 13:28:27 +00:00
|
|
|
|
|
|
|
exec automount -f -p /var/run/autofs/automount_files.pid -t `cat /etc/sysconfig/autofstime` /etc/sysconfig/auto.master
|