netfs: added initscript script which mounts network shares defined in /etc/fstab after network

This commit is contained in:
Silvan Calarco 2011-10-21 16:53:58 +02:00
parent 12f2fb6d32
commit b1edfb0fcf
9 changed files with 99 additions and 56 deletions

View File

@ -38,7 +38,7 @@ case "$1" in
# below. All file systems that are added to the variable in the
# form of no<filesystem> 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

35
etc/rc.d/init.d/netfs Executable file
View File

@ -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 <gerard@linuxfromscratch.org>
# Modified by Davide Madrisan <davide.madrisan@gmail.com>
. /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

1
etc/rc.d/rc0.d/K80netfs Symbolic link
View File

@ -0,0 +1 @@
../init.d/netfs

1
etc/rc.d/rc3.d/S92netfs Symbolic link
View File

@ -0,0 +1 @@
../init.d/netfs

1
etc/rc.d/rc4.d/S92netfs Symbolic link
View File

@ -0,0 +1 @@
../init.d/netfs

1
etc/rc.d/rc5.d/S92netfs Symbolic link
View File

@ -0,0 +1 @@
../init.d/netfs

1
etc/rc.d/rc6.d/K80netfs Symbolic link
View File

@ -0,0 +1 @@
../init.d/netfs

View File

@ -1,6 +1,6 @@
# GNU Makefile listing dependencies between services when services are
# started.
# Copyright (c) 2006-2009 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2006-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
# The following services have already been activated at this point:
#
@ -15,20 +15,20 @@ 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 :

View File

@ -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))