From b1edfb0fcfa4ec337b1da1cd5d1f1e0f7c19e324 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 21 Oct 2011 16:53:58 +0200 Subject: [PATCH] netfs: added initscript script which mounts network shares defined in /etc/fstab after network --- etc/rc.d/init.d/mountfs | 4 +-- etc/rc.d/init.d/netfs | 35 +++++++++++++++++++++ etc/rc.d/rc0.d/K80netfs | 1 + etc/rc.d/rc3.d/S92netfs | 1 + etc/rc.d/rc4.d/S92netfs | 1 + etc/rc.d/rc5.d/S92netfs | 1 + etc/rc.d/rc6.d/K80netfs | 1 + var/init/deps.start.mk | 43 +++++++++++++------------- var/init/deps.stop.mk | 68 +++++++++++++++++++++-------------------- 9 files changed, 99 insertions(+), 56 deletions(-) create mode 100755 etc/rc.d/init.d/netfs create mode 120000 etc/rc.d/rc0.d/K80netfs create mode 120000 etc/rc.d/rc3.d/S92netfs create mode 120000 etc/rc.d/rc4.d/S92netfs create mode 120000 etc/rc.d/rc5.d/S92netfs create mode 120000 etc/rc.d/rc6.d/K80netfs diff --git a/etc/rc.d/init.d/mountfs b/etc/rc.d/init.d/mountfs index 491352e..3c3e56b 100755 --- a/etc/rc.d/init.d/mountfs +++ b/etc/rc.d/init.d/mountfs @@ -38,7 +38,7 @@ case "$1" in # below. All file systems that are added to the variable in the # form of no will be skipped. - NO_FS="nonfs,nosmbfs,noproc,nosysfs,nousbdevfs,nodevfs" + NO_FS="nonfs,nonfs4,nosmbfs,nocifs,noproc,nosysfs,nousbdevfs,nodevfs" echo -n "Mounting remaining file systems: " mount -a -t $NO_FS @@ -53,7 +53,7 @@ case "$1" in # [ -f /proc/bus/usb/devices ] && umount /proc/bus/usb >/dev/null 2>&1 # umount -l /proc # umount -l /sys - NO_FS="nonfs,nosmbfs,noproc,nosysfs,nousbdevfs,nodevfs" + NO_FS="nonfs,nonfs4,nosmbfs,nocifs,noproc,nosysfs,nousbdevfs,nodevfs" sync umount -a -f -r -t $NO_FS >/dev/null 2>&1 evaluate_retval diff --git a/etc/rc.d/init.d/netfs b/etc/rc.d/init.d/netfs new file mode 100755 index 0000000..b9ec3ab --- /dev/null +++ b/etc/rc.d/init.d/netfs @@ -0,0 +1,35 @@ +#!/bin/sh +# mountfs - File System Mount Script + +# Based on mountfs script from LFS-3.1 and earlier. +# Rewritten by Gerard Beekmans +# Modified by Davide Madrisan + +. /etc/sysconfig/rc +. $rc_functions + +KERNELMIN=`uname -r | sed -e 's,[^\.]*\.,,' -e 's,\..*,,'` + +case "$1" in + start) + + NET_FS="nfs,smbfs,cifs" + + echo -n "Mounting network file systems: " + mount -a -t $NET_FS + evaluate_retval + echo + ;; + stop) + echo -n "Unmounting currently mounted network file systems: " + NET_FS="nfs,smbfs,cifs" + sync + umount -a -f -r -t $NET_FS >/dev/null 2>&1 + evaluate_retval + echo + ;; + *) + echo "Usage: $0 {start|stop}" + exit 1 + ;; +esac diff --git a/etc/rc.d/rc0.d/K80netfs b/etc/rc.d/rc0.d/K80netfs new file mode 120000 index 0000000..b78f85a --- /dev/null +++ b/etc/rc.d/rc0.d/K80netfs @@ -0,0 +1 @@ +../init.d/netfs \ No newline at end of file diff --git a/etc/rc.d/rc3.d/S92netfs b/etc/rc.d/rc3.d/S92netfs new file mode 120000 index 0000000..b78f85a --- /dev/null +++ b/etc/rc.d/rc3.d/S92netfs @@ -0,0 +1 @@ +../init.d/netfs \ No newline at end of file diff --git a/etc/rc.d/rc4.d/S92netfs b/etc/rc.d/rc4.d/S92netfs new file mode 120000 index 0000000..b78f85a --- /dev/null +++ b/etc/rc.d/rc4.d/S92netfs @@ -0,0 +1 @@ +../init.d/netfs \ No newline at end of file diff --git a/etc/rc.d/rc5.d/S92netfs b/etc/rc.d/rc5.d/S92netfs new file mode 120000 index 0000000..b78f85a --- /dev/null +++ b/etc/rc.d/rc5.d/S92netfs @@ -0,0 +1 @@ +../init.d/netfs \ No newline at end of file diff --git a/etc/rc.d/rc6.d/K80netfs b/etc/rc.d/rc6.d/K80netfs new file mode 120000 index 0000000..b78f85a --- /dev/null +++ b/etc/rc.d/rc6.d/K80netfs @@ -0,0 +1 @@ +../init.d/netfs \ No newline at end of file diff --git a/var/init/deps.start.mk b/var/init/deps.start.mk index 17be8ae..3f361a8 100644 --- a/var/init/deps.start.mk +++ b/var/init/deps.start.mk @@ -1,6 +1,6 @@ # GNU Makefile listing dependencies between services when services are # started. -# Copyright (c) 2006-2009 by Silvan Calarco +# Copyright (c) 2006-2011 by Silvan Calarco # # The following services have already been activated at this point: # @@ -8,27 +8,27 @@ # swap setclock checkfs mountfs cleanfs # acpid : syslog -alsa : sysinit +alsa : sysinit apmd : syslog bluetooth : messagebus consolekit : haldaemon cpufreqd : syslog acpid macbook-tools crond : syslog cups : syslog messagebus -dhcpd : network iptables -drbd : network iptables +dhcpd : network NetworkManager iptables +drbd : network NetworkManager iptables fuse : gpm : syslog haldaemon : messagebus acpid alsa -heartbeat : drbd network iptables -httpd : network iptables -ipsec : network iptables -iptables : network -ipvsadm : network iptables +heartbeat : drbd network NetworkManager iptables +httpd : network NetworkManager iptables +ipsec : network NetworkManager iptables +iptables : network NetworkManager +ipvsadm : network NetworkManager iptables ivman : haldaemon laptop-mode : -lisa : network -lisa4 : network haldaemon +lisa : network NetworkManager +lisa4 : network NetworkManager haldaemon logrotate : macbook-tools : mailman : mysql postfix @@ -37,30 +37,31 @@ messagebus : syslog mrtg : snmpd msysklogd : random mysql : syslog -named : network iptables -nessusd : network iptables +named : network NetworkManager iptables +nessusd : network NetworkManager iptables network : syslog NetworkManager : syslog messagebus +netfs : network NetworkManager samba nfs-lock nfs-lock : nscd : syslog -ntop : network iptables -ntpd : network iptables +ntop : network NetworkManager iptables +ntpd : network NetworkManager iptables openldap : syslog portmap : postfix : syslog mysql postgresql postgresql : syslog random : -samba : network iptables cups -snmpd : network iptables -snort : network -squid : network iptables -sshd : network iptables +samba : network NetworkManager iptables cups +snmpd : network NetworkManager iptables +snort : network NetworkManager +squid : network NetworkManager iptables +sshd : network NetworkManager iptables sysklogd : random sysinit : syslog syslog : syslog-ng msysklogd sysklogd syslog-ng : udev-post : messagebus -xinetd : network iptables +xinetd : network NetworkManager iptables wine : syslog wicd : haldaemon VirtualBox : diff --git a/var/init/deps.stop.mk b/var/init/deps.stop.mk index 9a0db64..f6fb037 100644 --- a/var/init/deps.stop.mk +++ b/var/init/deps.stop.mk @@ -3,43 +3,45 @@ # # rc[1-5].d dependencies acpid : sendsignals -alsa : splash -consolekit : splash +alsa : +consolekit : cpufreqd : sendsignals -crond : splash -cups : splash -drbd : splash heartbeat -gpm : splash -haldaemon : splash wicd -heartbeat : splash -httpd : splash +crond : +cups : +drbd : heartbeat +gpm : +haldaemon : wicd +heartbeat : +httpd : iptables : sendsignals -lisa : splash -lisa4 : splash -localnet : splash network -logrotate : splash -mountfs : splash sendsignals swap create_final_log -mrtg : splash -mysql : splash -named : splash -nessusd : splash -network : splash mountfs vmware heartbeat drbd -nscd : splash -ntpd : splash -openldap : splash -postgresql : splash -random : splash -samba : splash -snort : splash +lisa : +lisa4 : +localnet : network NetworkManager +logrotate : +mountfs : sendsignals network NetworkManager swap create_final_log +mrtg : +mysql : +named : +nessusd : +network : netfs vmware heartbeat drbd +NetworkManager : netfs vmware heatbeat drbd +netfs : samba +nscd : +ntpd : +openldap : +postgresql : +random : +samba : +snort : splash : -sshd : splash +sshd : swap : sendsignals -udev : splash mountfs -virtualbox : splash -vmware : splash -wine : splash -xinetd : splash -wicd : splash +udev : mountfs +virtualbox : +vmware : +wine : +xinetd : +wicd : # services to be started last sysklogd : $(filter-out sysklogd udev mountfs sendsignals create_final_log swap reboot halt,$(ALL_RUNLEVEL)) sendsignals : $(filter-out sendsignals acpid iptables localnet network udev mountfs network cpufreqd swap reboot halt,$(ALL_RUNLEVEL))