Compare commits
	
		
			2 Commits
		
	
	
		
			0.38.x
			...
			mount-serv
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 7c9f1add21 | ||
|   | a643e918dd | 
| @@ -1,7 +1,7 @@ | |||||||
| include ../mk/net.mk | include ../mk/net.mk | ||||||
|  |  | ||||||
| DIR=	${CONFDIR} | DIR=	${CONFDIR} | ||||||
| CONF=	bootmisc fsck hostname localmount netmount urandom tmpfiles \ | CONF=	bootmisc fsck hostname localmount mount netmount urandom tmpfiles \ | ||||||
| 		${CONF-${OS}} | 		${CONF-${OS}} | ||||||
|  |  | ||||||
| ifeq (${MKNET},yes) | ifeq (${MKNET},yes) | ||||||
|   | |||||||
							
								
								
									
										23
									
								
								conf.d/mount
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								conf.d/mount
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | # The mount service is a multiplexed service. This means you must have | ||||||
|  | # symbolic links to it in your init.d directory for each file system you | ||||||
|  | # want to mount. I recommend naming those symbolic links the same as the | ||||||
|  | # paths to the file systems they mount, removing the leading slash and | ||||||
|  | # substituting _ for the remaining slashes, for example: | ||||||
|  | # | ||||||
|  | # cd /etc/init.d | ||||||
|  | # ln -s mount mount.usr | ||||||
|  | # ln -s mount mount.usr_local | ||||||
|  | # | ||||||
|  | # Set up a symbolic link like this for each file system you wish to | ||||||
|  | # mount, then add the symbolic link to the appropriate runlevel. Once | ||||||
|  | # that is done, add the appropriate definitions for the file system to | ||||||
|  | # this file. | ||||||
|  | # | ||||||
|  | #You will need to define the mountpoint and any dependencies for each | ||||||
|  | #filesystem as shown here. | ||||||
|  | # | ||||||
|  | #If the mountpoint does not match an entry in fstab, the mount will be | ||||||
|  | #ignored. | ||||||
|  | # | ||||||
|  | #mount_usr_mountpoint="/usr" | ||||||
|  | # | ||||||
| @@ -10,6 +10,6 @@ name="Avahi DNS Configuration Daemon" | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	use dns | 	use dns | ||||||
| 	need localmount dbus | 	need mount.usr mount.var dbus | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| } | } | ||||||
|   | |||||||
| @@ -10,6 +10,6 @@ name="Avahi Service Advertisement Daemon" | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	use dns | 	use dns | ||||||
| 	need localmount dbus | 	need mount.usr mount.var dbus | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| } | } | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ name="Message Bus Daemon" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount net | 	need mount.usr mount.var net | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ name="DHCP Client Daemon" | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	provide net | 	provide net | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	use logger | 	use logger | ||||||
| 	after bootmisc modules | 	after bootmisc modules | ||||||
| 	before dns | 	before dns | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ extra_started_commands="reload" | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	provide dns | 	provide dns | ||||||
| 	need localmount net | 	need mount.usr mount.var net | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ esac | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	provide dns | 	provide dns | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ name="Network Time Protocol Daemon" | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	use dns | 	use dns | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	after bootmisc ntp-client | 	after bootmisc ntp-client | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -31,7 +31,7 @@ fi | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount net | 	need mount.usr mount.var net | ||||||
| 	use dns | 	use dns | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| } | } | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ name="WPA Supplicant Daemon" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	use logger | 	use logger | ||||||
| 	after bootmisc modules | 	after bootmisc modules | ||||||
| 	before dns dhcpcd net | 	before dns dhcpcd net | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								init.d/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								init.d/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -4,6 +4,7 @@ hostname | |||||||
| local | local | ||||||
| localmount | localmount | ||||||
| loopback | loopback | ||||||
|  | mount | ||||||
| moused | moused | ||||||
| netmount | netmount | ||||||
| network | network | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ include ../mk/net.mk | |||||||
|  |  | ||||||
| DIR=	${INITDIR} | DIR=	${INITDIR} | ||||||
| SRCS=	bootmisc.in fsck.in hostname.in local.in localmount.in loopback.in \ | SRCS=	bootmisc.in fsck.in hostname.in local.in localmount.in loopback.in \ | ||||||
| 	netmount.in osclock.in root.in savecache.in swap.in swapfiles.in \ | 	mount.in netmount.in osclock.in root.in savecache.in swap.in swapfiles.in \ | ||||||
| 	tmpfiles.setup.in swclock.in sysctl.in urandom.in s6-svscan.in ${SRCS-${OS}} | 	tmpfiles.setup.in swclock.in sysctl.in urandom.in s6-svscan.in ${SRCS-${OS}} | ||||||
| BIN=	${OBJS} | BIN=	${OBJS} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	before logger | 	before logger | ||||||
| 	after clock root sysctl | 	after clock root sysctl | ||||||
| 	keyword -prefix -timeout | 	keyword -prefix -timeout | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ description="Sets a font for the consoles." | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount termencoding | 	need mount.usr mount.var termencoding | ||||||
| 	after hotplug bootmisc | 	after hotplug bootmisc | ||||||
| 	keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc | 	keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc | ||||||
| } | } | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ command_args=$devd_args | |||||||
| name="Device State Change Daemon" | name="Device State Change Daemon" | ||||||
|  |  | ||||||
| depend() { | depend() { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| 	before net.lo0 | 	before net.lo0 | ||||||
| 	keyword -jail -prefix | 	keyword -jail -prefix | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ description="Creates the dev database" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| } | } | ||||||
|  |  | ||||||
| start() | start() | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ description="Applies a keymap for the consoles." | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount termencoding | 	need mount.usr mount.var termencoding | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| 	keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc | 	keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc | ||||||
| } | } | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ extra_commands="restore" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -jail -prefix | 	keyword -jail -prefix | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										118
									
								
								init.d/mount.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										118
									
								
								init.d/mount.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,118 @@ | |||||||
|  | #!@SBINDIR@/openrc-run | ||||||
|  | # Copyright (c) 2015 William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | # Released under the 2-clause BSD license. | ||||||
|  |  | ||||||
|  | description="Mount a file system defined in @SYSCONFDIR@/fstab" | ||||||
|  | extra_commands="generate" | ||||||
|  |  | ||||||
|  | depend() | ||||||
|  | { | ||||||
|  | 	need fsck | ||||||
|  | 	use modules mtab | ||||||
|  | 	after modules | ||||||
|  | 	keyword -jail -prefix -vserver -lxc | ||||||
|  | } | ||||||
|  |  | ||||||
|  | . "$RC_LIBEXECDIR"/sh/rc-mount.sh | ||||||
|  |  | ||||||
|  | start_pre() | ||||||
|  | { | ||||||
|  | 	# Do not start this service as "mount" | ||||||
|  | 	if [ "$rc_svcname" = mount ]; then | ||||||
|  | 		eerror "The mount service should not be started directly" | ||||||
|  | 		return 1 | ||||||
|  | 	fi | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
|  |  | ||||||
|  | start() | ||||||
|  | { | ||||||
|  | 	if [ "$rc_svcname" = mount-generate-symlinks ]; then | ||||||
|  | 		generate | ||||||
|  | 		return $? | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	local mountname=${rc_svcname#*.} | ||||||
|  | 	local fspath=${mount_${mountname}_mountpoint} | ||||||
|  |  | ||||||
|  | 	# for now, make sure fspath is in fstab | ||||||
|  | 	if [ ! fstabinfo -q $fspath ]; then | ||||||
|  | 		einfo "$rc_svcname: $fspath is not in @SYSCONFDIR@/fstab" | ||||||
|  | 		return 0 | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	# Is the file system mounted? | ||||||
|  | 	if mountinfo -q $fspath; then | ||||||
|  | 		action=remount | ||||||
|  | 		msg=Remounting | ||||||
|  | 	else | ||||||
|  | 		action=mount | ||||||
|  | 		msg=Mounting | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	ebegin "$msg $fspath according to @SYSCONFDIR@/fstab" | ||||||
|  | 	fstabinfo --$action $fspath | ||||||
|  | 	eend $? "$fspath failed to $action" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | stop_pre() | ||||||
|  | { | ||||||
|  | 	# Do not stop this service as "mount" | ||||||
|  | 	if [ "$rc_svcname" = mount ]; then | ||||||
|  | 		eerror "The mount service should not be stopped directly" | ||||||
|  | 		return 1 | ||||||
|  | 	fi | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
|  |  | ||||||
|  | stop() | ||||||
|  | { | ||||||
|  | 	yesno $RC_GOINGDOWN || return 0 | ||||||
|  | 	local mountname=${rc_svcname#*.} | ||||||
|  | 	local fspath=${mount_${mountname}_mountpoint} | ||||||
|  |  | ||||||
|  | 	# make sure fspath is in fstab | ||||||
|  | 	if ! fstabinfo -q $fspath; then | ||||||
|  | 		einfo "$rc_svcname: $fspath is not in @SYSCONFDIR@/fstab" | ||||||
|  | 		return 0 | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	# Is the file system mounted? | ||||||
|  | 	mountinfo -q $fspath || return 0 | ||||||
|  |  | ||||||
|  | 	# Flush all pending disk writes now | ||||||
|  | 	sync | ||||||
|  |  | ||||||
|  | 	ebegin "Unmounting $fspath" | ||||||
|  | 	do_unmount umount $fspath | ||||||
|  | 	eend $? "Unable to umount $fspath" | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
|  |  | ||||||
|  | generate() | ||||||
|  | { | ||||||
|  | 	local fslist="$(fstabinfo)" | ||||||
|  | 	local fs fsopts rc=0 | ||||||
|  | 	local svcpath=${RC_SVCNAME%/*} | ||||||
|  | 	ebegin "Generating mount symlinks" | ||||||
|  | 	for fs in $fslist; do | ||||||
|  | 		case $fs in | ||||||
|  | 		/) ;; | ||||||
|  | 		/*) | ||||||
|  | 			fsopts="$(fstabinfo -o $fs)" | ||||||
|  | 			case "$fsopts" in | ||||||
|  | 			*noauto*) ;; | ||||||
|  | 			*) | ||||||
|  | 				local name="${fs#/}" | ||||||
|  | 				name="$(echo $name | sed 's#/#.#g')" | ||||||
|  | 				einfo ln -snf mount "${svcpath}/${name}" | ||||||
|  | 				rc=$? | ||||||
|  | 				[ $rc -ne 0 ] && break | ||||||
|  | 			*) ;; | ||||||
|  | 			esac | ||||||
|  | 		*) ;; | ||||||
|  | 		esac | ||||||
|  | 	done | ||||||
|  | 	eend $rc "Failed to generate symlinks for all mounts" | ||||||
|  | 	return $rc | ||||||
|  | } | ||||||
| @@ -14,7 +14,7 @@ name="Console Mouse Daemon" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| 	keyword -jail -prefix | 	keyword -jail -prefix | ||||||
| } | } | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ __nl=" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| 	if [ -n "$(interfaces)" ]; then | 	if [ -n "$(interfaces)" ]; then | ||||||
| 		provide net | 		provide net | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ required_files="/etc/newsyslog.conf" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -prefix | 	keyword -prefix | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ name="Name Service Cache Daemon" | |||||||
| extra_started_commands="flush" | extra_started_commands="flush" | ||||||
|  |  | ||||||
| depend() { | depend() { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	use net dns ldap ypbind | 	use net dns ldap ypbind | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| } | } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -openvz -prefix -systemd-nspawn -vserver -lxc | 	keyword -openvz -prefix -systemd-nspawn -vserver -lxc | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ extra_commands="checkconfig showstatus" | |||||||
| extra_started_commands="reload" | extra_started_commands="reload" | ||||||
|  |  | ||||||
| depend() { | depend() { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -jail -prefix | 	keyword -jail -prefix | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ name="Power Control Daemon" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	use logger | 	use logger | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| 	keyword -jail -prefix | 	keyword -jail -prefix | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ description="Mounts misc filesystems in /proc." | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	use modules devfs | 	use modules devfs | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -openvz -prefix -systemd-nspawn -vserver -lxc | 	keyword -openvz -prefix -systemd-nspawn -vserver -lxc | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ command_background=YES | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| 	need net | 	need net | ||||||
| } | } | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount net | 	need mount.usr mount.var net | ||||||
| 	after * | 	after * | ||||||
| 	before local | 	before local | ||||||
| 	keyword -prefix | 	keyword -prefix | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ name="RPC program number mapper" | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	provide rpc | 	provide rpc | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	use net logger dns | 	use net logger dns | ||||||
| 	before inetd xinetd ntpd ntp-client | 	before inetd xinetd ntpd ntp-client | ||||||
| } | } | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ pidfile=/var/run/s6-svscan.pid | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| } | } | ||||||
|  |  | ||||||
| start_pre() | start_pre() | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ description="Saves a kernel dump." | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need dumpon localmount | 	need dumpon mount.usr mount.var | ||||||
| 	before encswap | 	before encswap | ||||||
| 	keyword -jail -prefix | 	keyword -jail -prefix | ||||||
| } | } | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	before localmount | 	before mount.usr mount.var | ||||||
| 	keyword -jail -openvz -prefix -systemd-nspawn -vserver -lxc | 	keyword -jail -openvz -prefix -systemd-nspawn -vserver -lxc | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -jail -openvz -prefix -systemd-nspawn -vserver -lxc | 	keyword -jail -openvz -prefix -systemd-nspawn -vserver -lxc | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ | |||||||
| # Released under the 2-clause BSD license. | # Released under the 2-clause BSD license. | ||||||
|  |  | ||||||
| depend() { | depend() { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -jail -prefix | 	keyword -jail -prefix | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ depend() | |||||||
| { | { | ||||||
| 	provide logger | 	provide logger | ||||||
| 	use net newsyslog | 	use net newsyslog | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	after bootmisc | 	after bootmisc | ||||||
| 	keyword -prefix | 	keyword -prefix | ||||||
| } | } | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ description="Set up tmpfiles.d entries" | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| } | } | ||||||
|  |  | ||||||
| start() | start() | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ description="Initializes the random number generator." | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -jail -lxc -openvz -prefix -systemd-nspawn | 	keyword -jail -lxc -openvz -prefix -systemd-nspawn | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	need localmount | 	need mount.usr mount.var | ||||||
| 	keyword -prefix | 	keyword -prefix | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -487,8 +487,8 @@ _need_dbus() | |||||||
|  |  | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
|     # We write a pidfile and to /var/cache, so we need localmount. |     # We write a pidfile and to /var/cache, so we need mount.var. | ||||||
|     need localmount |     need mount.var | ||||||
|     # We can optionally use the network, but it's not essential. |     # We can optionally use the network, but it's not essential. | ||||||
|     use net |     use net | ||||||
|     # We should be after bootmisc so that /var/run is cleaned before |     # We should be after bootmisc so that /var/run is cleaned before | ||||||
|   | |||||||
							
								
								
									
										46
									
								
								mount-service.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								mount-service.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | |||||||
|  | # New Mount Service | ||||||
|  |  | ||||||
|  | This is definitely considered testing code, so if you use it on your | ||||||
|  | system and it breaks, you have been warned. | ||||||
|  |  | ||||||
|  | This document will evolve as the testing proceeds and will be removed | ||||||
|  | once the script goes mainline. | ||||||
|  |  | ||||||
|  | Since this is on a topic branch, this branch will be subject to | ||||||
|  | rebasing, merging commits, etc. When it goes to master, everything here | ||||||
|  | will be in one commit. | ||||||
|  |  | ||||||
|  | The goal of this is to replace the localmount and metmount services with | ||||||
|  | a single mount service which will be multiplexed so that there is one | ||||||
|  | service for each file system that will be mounted. | ||||||
|  |  | ||||||
|  | - rc-service mount generate | ||||||
|  |  | ||||||
|  | scans your fstab and attempts to generate symbolic links in /etc/init.d | ||||||
|  | for each file system you want to mount. | ||||||
|  |  | ||||||
|  | Then you must edit /etc/conf.d/mount to list all of your file systems | ||||||
|  | and the dependencies they have by using | ||||||
|  | rc_mount_foo_before/after/need/use settings. | ||||||
|  |  | ||||||
|  | rc-service mount.foo start | ||||||
|  |  | ||||||
|  | tries to mount a file system and | ||||||
|  |  | ||||||
|  | rc-service mount.foo stop | ||||||
|  |  | ||||||
|  | tries to unmount it if your system is going down. | ||||||
|  |  | ||||||
|  | I'm considering automating the generation of symlinks into the boot | ||||||
|  | process, but I'm not sure yet whether this is a good idea. | ||||||
|  |  | ||||||
|  | I haven't decided yet exactly how I want to handle the transition from | ||||||
|  | localmount/netmount to this new mount service yet, so you will | ||||||
|  | definitely not have a clean boot if you try to boot with this. | ||||||
|  |  | ||||||
|  | Another question is whether I want to try automating adding the mount | ||||||
|  | services to runlevels; I think no, but let me know if you feel | ||||||
|  | differently. | ||||||
|  |  | ||||||
|  | Any suggestions would be helpful. | ||||||
|  |  | ||||||
| @@ -939,9 +939,9 @@ svc_stop_real(void) | |||||||
| { | { | ||||||
| 	bool stopped; | 	bool stopped; | ||||||
|  |  | ||||||
| 	/* If we're stopping localmount, set LC_ALL=C so that | 	/* If we're stopping mount.*, set LC_ALL=C so that | ||||||
| 	 * bash doesn't load anything blocking the unmounting of /usr */ | 	 * bash doesn't load anything blocking the unmounting of /usr */ | ||||||
| 	if (strcmp(applet, "localmount") == 0) | 	if (strncmp(applet, "mount.", 6) == 0) | ||||||
| 		setenv("LC_ALL", "C", 1); | 		setenv("LC_ALL", "C", 1); | ||||||
|  |  | ||||||
| 	if (ibsave) | 	if (ibsave) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user