init files muessen fuer neue upstart version auf .conf enden. autofs_function wird nicht mehr benötigt

git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_autofs@5515 504e572c-2e33-0410-9681-be2bf7408885
This commit is contained in:
kueller 2010-04-20 14:01:45 +00:00
parent e6416db19a
commit a7c835ee3d
5 changed files with 52 additions and 100 deletions

View File

@ -1,21 +0,0 @@
start on started mountfs
stop on stopping mountfs
console output
pre-start script
source /etc/event.d/functions
source /etc/event.d/autofs_function
source /etc/sysconfig/autofstime
if grep automount /etc/nsswitch.conf 2>/dev/null|\
grep files &>/dev/null; then
if [ -f /etc/sysconfig/auto.master ]; then
cat /etc/sysconfig/auto.master|initautomount files file
fi
fi
end script
post-stop script
kill `ps -ef|grep automount|grep file|awk '{print $2}'`
end script

View File

@ -1,19 +0,0 @@
start on started ypclient
stop on stopping ypclient
console output
pre-start script
source /etc/event.d/functions
source /etc/event.d/autofs_function
source /etc/sysconfig/autofstime
if grep automount /etc/nsswitch.conf 2>/dev/null|\
grep nis &>/dev/null; then
ypcat -k auto.master 2>/dev/null|initautomount nis yp
fi
end script
post-stop script
kill `ps -ef|grep automount|grep yp|awk '{print $2}'`
end script

25
etc/init/autofs-nis.conf Normal file
View File

@ -0,0 +1,25 @@
description "Startup autofs System for nis configuration files"
author "Harald Kueller <harald.kueller@compuextreme.de>"
version 1.0
emits none special
start on ( runlevel [2345] and ( started ypclient ))
stop on stopping ypclient
console output
script
source /etc/init/functions
source /etc/sysconfig/autofstime
if grep automount /etc/nsswitch.conf|grep -q nis; then
if [ /var/run/autofs/automount_nis.pid ]; then
if ps -ef|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
automount -f -C -v -p /var/run/autofs/automount_nis.pid -t $TIMEOUT auto.master
fi
end script

27
etc/init/autofs.conf Normal file
View File

@ -0,0 +1,27 @@
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))
stop on runlevel [S016]
console none
script
source /etc/init/functions
source /etc/sysconfig/autofstime
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
echo "Automount already running - not started"
exit 10
else
echo -n "Removing old files"
rm /var/run/autofs/automount_files.pid
fi
fi
automount -f -v -p /var/run/autofs/automount_files.pid -t $TIMEOUT /etc/sysconfig/auto.master
fi
end script

View File

@ -1,60 +0,0 @@
#!/bin/sh
# Begin /etc/init.d/network
# Script zum start des automount Daemons
# Wenn die Datei /etc/sysconfig/auto.master vorhanden ist, wird
# der automount Daemon gestartet
# Die Timeout Konfiguration erfolg über die Datei /etc/sysconfig/autofstime
# (c) Rainmaker MultiMedia OHG
#
# $Author: segler $
# $Date: 2006-05-19 16:35:53 +0200 (Fr, 19 Mai 2006) $
# $Revision: 3529 $
#
# $Log$
# Revision 1.6 2006/05/19 14:35:53 segler
# autofs versteht nun Einträge in /etc/nsswitch.conf und handelt danach
#
# Revision 1.5 2003/04/19 07:40:38 kueller
# Restartfunktion eingebaut
#
# Revision 1.4 2003/03/16 13:54:59 kueller
# Fehler in Schleife die die Dateibasierten Maps einliest - muss FILE, nicht
# HEAD Heissen
#
# Revision 1.3 2002/01/26 20:41:16 kueller
# /tmp/autofs wird nun gelöscht, wenn es nicht mehr benötigt wird
#
# Revision 1.2 2002/01/26 03:55:35 kueller
# Auswertung von /etc/sysconfig/auto.master komplett neu geschrieben -
# stark vereinfacht!
# NIS Support aktiviert - vorhandene nis-auto.master wird nun
# ebenfalls ausgewertet, und dort gefundene Maps aus dem NIS gestartet
#
# Revision 1.1.1.1 2001/09/23 00:10:47 kueller
# Neustart wg. Datenverlust
#
# Revision 1.1.1.1 2001/08/25 16:21:48 kueller
# AddOns fuer autofs
#
#
initautomount()
{
MOUNTSOURCE=$1
AUTOMOUNTSOURCE=$2
sed -e '/^#/d' |\
sed -e '/^ *$/d' >/tmp/autofs
exec 3</tmp/autofs
read <&3 MOUNTPOINT FILE
while [ "$MOUNTPOINT" ]; do
automount -t $TIMEOUT $MOUNTPOINT $AUTOMOUNTSOURCE,sun $FILE
status_message "automount for $MOUNTPOINT ($MOUNTSOURCE)"
read <&3 MOUNTPOINT FILE
done
exec 3>&-
rm /tmp/autofs
}