diff --git a/etc/init/autofs b/etc/init/autofs deleted file mode 100644 index 613f718..0000000 --- a/etc/init/autofs +++ /dev/null @@ -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 diff --git a/etc/init/autofs-nis b/etc/init/autofs-nis deleted file mode 100644 index 2164ed3..0000000 --- a/etc/init/autofs-nis +++ /dev/null @@ -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 diff --git a/etc/init/autofs-nis.conf b/etc/init/autofs-nis.conf new file mode 100644 index 0000000..9a62feb --- /dev/null +++ b/etc/init/autofs-nis.conf @@ -0,0 +1,25 @@ +description "Startup autofs System for nis configuration files" +author "Harald Kueller " +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 diff --git a/etc/init/autofs.conf b/etc/init/autofs.conf new file mode 100644 index 0000000..2298bf1 --- /dev/null +++ b/etc/init/autofs.conf @@ -0,0 +1,27 @@ +description "Startup autofs System for local configuration files" +author "Harald Kueller " +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 diff --git a/etc/init/autofs_function b/etc/init/autofs_function deleted file mode 100644 index d7e8f6b..0000000 --- a/etc/init/autofs_function +++ /dev/null @@ -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&- - rm /tmp/autofs -} -