Compare commits
	
		
			23 Commits
		
	
	
		
			0.34.7
			...
			openrc-0.1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 46e871a408 | ||
|   | ed0696443d | ||
|   | 9e18838c83 | ||
|   | f7a3ac2d10 | ||
|   | 604902f6c2 | ||
|   | eb07d1169f | ||
|   | a198ad3d4f | ||
|   | 0e57fade64 | ||
|   | d036b4ad1a | ||
|   | 84c12adb79 | ||
|   | c78d012dd6 | ||
|   | 31dbdf69d2 | ||
|   | c7e14b2c17 | ||
|   | 6ceb62969a | ||
|   | d5ecc9d746 | ||
|   | 6df5176462 | ||
|   | 0c6df86503 | ||
|   | cd2d520fd1 | ||
|   | 0e3860e76f | ||
|   | 670b72b328 | ||
|   | 3ebaa31edb | ||
|   | 0f3813c8cf | ||
|   | 28c13790ff | 
| @@ -1,3 +1,3 @@ | ||||
| NAME=		openrc | ||||
| VERSION=	0.10 | ||||
| VERSION=	0.10.5 | ||||
| PKG=		${NAME}-${VERSION} | ||||
|   | ||||
| @@ -1,9 +1,10 @@ | ||||
| # The consolefont service is not activated by default. If you need to | ||||
| # use it, you should run "rc-update add consolefont boot" as root. | ||||
| # | ||||
| # consolefont specifies the default font that you'd like Linux to use on the | ||||
| # console.  You can find a good selection of fonts in /usr/share/consolefonts; | ||||
| # you shouldn't specify the trailing ".psf.gz", just the font name below. | ||||
| # To use the default console font, comment out the CONSOLEFONT setting below. | ||||
| # This setting is used by the /etc/init.d/consolefont script (NOTE: if you do | ||||
| # not want to use it, run "rc-update del consolefont boot" as root). | ||||
| consolefont="default8x16" | ||||
|  | ||||
| # consoletranslation is the charset map file to use.  Leave commented to use | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| # Sets the level at which logging of messages is done to the | ||||
| # console.  See dmesg(8) for more info. | ||||
| # console.  See dmesg(1) for more info. | ||||
| dmesg_level="1" | ||||
|   | ||||
| @@ -34,7 +34,7 @@ | ||||
| # In other words, you probably should DO NOTHING HERE... | ||||
|  | ||||
| # Prefer ifconfig over iproute2 | ||||
| #modules="ifconfig" | ||||
| #modules="!iproute2" | ||||
|  | ||||
| # You can also specify other modules for an interface | ||||
| # In this case we prefer udhcpc over dhcpcd | ||||
| @@ -57,7 +57,7 @@ | ||||
|  | ||||
| # If you don't specify an interface then we prefer iproute2 if it's installed | ||||
| # To prefer ifconfig over iproute2 | ||||
| #modules="ifconfig" | ||||
| #modules="!iproute2" | ||||
|  | ||||
| # For a static configuration, use something like this | ||||
| # (They all do exactly the same thing btw) | ||||
| @@ -552,26 +552,34 @@ | ||||
| # You can also configure the VLAN - see for ip man page for more details | ||||
| # To change the vlan interface name. If not set, the standard "iface.vlanid" | ||||
| # will be used. This is the replacement for the old 'vconfig set_name_type' | ||||
| # functionality. | ||||
| # functionality. If you previously relied on the DEV_PLUS_VID or | ||||
| # DEV_PLUS_VID_NO_PAD options to have different VLANs with same ID value, on | ||||
| # different interfaces, please note that you need to use both the interface and | ||||
| # vlan number in the numbering. This applies for all of the options: name, | ||||
| # txqueuelen, mac, broadcast, mtu, ingress, egress, flags | ||||
| #vlan1_name="vlan1" | ||||
| #vlan2_name="eth0.2" | ||||
| #eth0_vlan2_name="eth0.2" | ||||
| #eth1_vlan2_name="eth1.2" | ||||
|  | ||||
| # The following shows the old set_name_type setting and what new option to set: | ||||
| # Using eth9 & VLAN VID 26 as an example. | ||||
| # VLAN_PLUS_VID         vlan26_name="vlan0026" | ||||
| # VLAN_PLUS_VID_NO_PAD  vlan26_name="vlan26" | ||||
| # DEV_PLUS_VID          vlan26_name="eth9.0026" | ||||
| # DEV_PLUS_VID_NO_PAD   vlan26_name="eth9.26" | ||||
| # DEV_PLUS_VID          eth9_vlan26_name="eth9.0026" | ||||
| # DEV_PLUS_VID_NO_PAD   eth9_vlan26_name="eth9.26" | ||||
|  | ||||
| # Set the vlan flags | ||||
| #vlan1_flags="reorder_hdr off gvrp on loose_binding on" | ||||
| #eth0_vlan1_flags="reorder_hdr off gvrp on loose_binding on" | ||||
|  | ||||
| # Configure in/egress maps | ||||
| #vlan1_ingress="2:6 3:5" | ||||
| #vlan1_egress="1:2" | ||||
| #eth0_vlan1_egress="1:2" | ||||
|  | ||||
| #config_vlan1="172.16.3.1/23" | ||||
| #config_vlan2="172.16.2.1/23" | ||||
| #config_vlan1="172.16.2.1/24" | ||||
| #config_vlan2="172.16.3.1/24" | ||||
| #config_eth0_1="172.16.4.1/24" | ||||
| #config_eth1_1="172.16.5.1/24" | ||||
|  | ||||
| # NOTE: Vlans can be configured with a . in their interface names | ||||
| # When configuring vlans with this name type, you need to replace . with a _ | ||||
|   | ||||
| @@ -12,6 +12,8 @@ depend() | ||||
|  | ||||
| start() | ||||
| { | ||||
| 	local ret=0 | ||||
|  | ||||
| 	# Flush all pending disk writes now | ||||
| 	sync; sync | ||||
|  | ||||
| @@ -39,6 +41,9 @@ start() | ||||
| 	do_unmount "umount -r" \ | ||||
| 		--skip-point-regex "$m" \ | ||||
| 		"${fs:+--skip-fstype-regex}" $fs --nonetdev | ||||
| 	ret=$? | ||||
|  | ||||
| 	eoutdent | ||||
| 	eend $? | ||||
|  | ||||
| 	eend $ret | ||||
| } | ||||
|   | ||||
| @@ -2,62 +2,27 @@ | ||||
| # Copyright (c) 2007-2009 Roy Marples <roy@marples.name> | ||||
| # Released under the 2-clause BSD license. | ||||
|  | ||||
| description="Mounts network shares according to /etc/fstab." | ||||
|  | ||||
| need_portmap() | ||||
| { | ||||
| 	local opts= | ||||
| 	local IFS=" | ||||
| " | ||||
| 	set -- $(fstabinfo --options --fstype nfs,nfs4) | ||||
| 	for opts; do | ||||
| 		case ,$opts, in | ||||
| 			*,noauto,*|*,nolock,*);; | ||||
| 			*) return 0;; | ||||
| 		esac | ||||
| 	done | ||||
| 	return 1 | ||||
| } | ||||
| description="Mounts network shares, other than NFS, according to /etc/fstab." | ||||
| # We skip all NFS shares in this script because they require extra | ||||
| # daemons to be running on the client in order to work correctly. | ||||
| # It is best to allow nfs-utils to handle all nfs shares. | ||||
|  | ||||
| depend() | ||||
| { | ||||
| 	# Only have portmap as a dependency if there is a nfs mount in fstab | ||||
| 	# that is set to mount at boot | ||||
| 	local pmap= | ||||
| 	if need_portmap; then | ||||
| 		pmap="rpc.statd" | ||||
| 		[ -x @SYSCONFDIR@/init.d/rpcbind ] \ | ||||
| 			&& pmap="$pmap rpcbind" \ | ||||
| 			|| pmap="$pmap portmap" | ||||
| 	fi | ||||
|  | ||||
| 	config /etc/fstab | ||||
| 	need net $pmap | ||||
| 	need net | ||||
| 	use afc-client amd autofs openvpn | ||||
| 	use dns nfs nfsmount portmap rpcbind rpc.statd rpc.lockd | ||||
| 	use dns | ||||
| 	keyword -jail -vserver | ||||
| } | ||||
|  | ||||
| start() | ||||
| { | ||||
| 	local myneed= myuse= pmap="portmap" nfsmounts= | ||||
| 	[ -x @SYSCONFDIR@/init.d/rpcbind ] && pmap="rpcbind" | ||||
|  | ||||
| 	local x= fs= rc= | ||||
| 	for x in $net_fs_list $extra_net_fs_list; do | ||||
| 		case "$x" in | ||||
| 			nfs|nfs4) | ||||
| 			# If the nfsmount script took care of the nfs | ||||
| 			# filesystems, then there's no point in trying | ||||
| 			# them twice | ||||
| 			service_started nfsmount && continue | ||||
|  | ||||
| 			# Only try to mount NFS filesystems if portmap was | ||||
| 			# started. This is to fix "hang" problems for new | ||||
| 			# users who do not add portmap to the default runlevel. | ||||
| 			if need_portmap && ! service_started "$pmap"; then | ||||
| 				continue | ||||
| 			fi | ||||
| 			continue | ||||
| 			;; | ||||
| 		esac | ||||
| 		fs="$fs${fs:+,}$x" | ||||
| @@ -82,7 +47,14 @@ stop() | ||||
| 	. "$RC_LIBEXECDIR"/sh/rc-mount.sh | ||||
|  | ||||
| 	for x in $net_fs_list $extra_net_fs_list; do | ||||
| 		fs="$fs${fs:+,}$x" | ||||
| 		case "$x" in | ||||
| 			nfs|nfs4) | ||||
| 				continue | ||||
| 				;; | ||||
| 			*) | ||||
| 				fs="$fs${fs:+,}$x" | ||||
| 				;; | ||||
| 		esac | ||||
| 	done | ||||
| 	if [ -n "$fs" ]; then | ||||
| 		umount -at $fs || eerror "Failed to simply unmount filesystems" | ||||
| @@ -91,7 +63,14 @@ stop() | ||||
| 	eindent | ||||
| 	fs= | ||||
| 	for x in $net_fs_list $extra_net_fs_list; do | ||||
| 		fs="$fs${fs:+|}$x" | ||||
| 		case "$x" in | ||||
| 			nfs|nfs4) | ||||
| 				continue | ||||
| 				;; | ||||
| 			*) | ||||
| 				fs="$fs${fs:+|}$x" | ||||
| 				;; | ||||
| 		esac | ||||
| 	done | ||||
| 	[ -n "$fs" ] && fs="^($fs)$" | ||||
| 	do_unmount umount ${fs:+--fstype-regex} $fs --netdev | ||||
|   | ||||
| @@ -12,7 +12,10 @@ depend() | ||||
| { | ||||
| 	need localmount | ||||
| 	after bootmisc | ||||
| 	provide net | ||||
| 	provide lo | ||||
| 	if [ -n "$(interfaces)" ]; then | ||||
| 		provide net | ||||
| 	fi | ||||
| 	keyword -jail -vserver | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -13,6 +13,14 @@ start() | ||||
| 			return 1 | ||||
| 		fi | ||||
| 	fi | ||||
| 	if ! checkpath -W "$RC_LIBEXECDIR"; then | ||||
| 		ewarn "WARNING: ${RC_LIBEXECDIR} is not writable!" | ||||
| 		if ! yesno "${RC_GOINGDOWN}"; then | ||||
| 			ewarn "Unable to save deptree cache" | ||||
| 			return 1 | ||||
| 		fi | ||||
| 		return 0 | ||||
| 	fi | ||||
| 	ebegin "Saving dependency cache" | ||||
| 	local rc= | ||||
| 	if [ ! -d "$RC_LIBEXECDIR"/cache ]; then | ||||
|   | ||||
| @@ -31,14 +31,16 @@ stop() | ||||
|  | ||||
| 	case "$RC_UNAME" in | ||||
| 		Linux) | ||||
| 			while read filename type rest; do | ||||
| 				case "$type" in | ||||
| 					file) swapoff $filename >/dev/null;; | ||||
| 				esac | ||||
| 				case "$filename" in | ||||
| 					/dev/loop*) swapoff $filename >/dev/null;; | ||||
| 				esac | ||||
| 			done < /proc/swaps | ||||
| 			if [ -e /proc/swaps ]; then | ||||
| 				while read filename type rest; do | ||||
| 					case "$type" in | ||||
| 						file) swapoff $filename >/dev/null;; | ||||
| 					esac | ||||
| 					case "$filename" in | ||||
| 						/dev/loop*) swapoff $filename >/dev/null;; | ||||
| 					esac | ||||
| 				done < /proc/swaps | ||||
| 			fi | ||||
| 			;; | ||||
| 	esac | ||||
| 	eend 0 | ||||
|   | ||||
| @@ -9,7 +9,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} | ||||
|  | ||||
| depend() | ||||
| { | ||||
| 	keyword -openvz -uml -vserver -xenu | ||||
| 	keyword -lxc -openvz -uml -vserver -xenu | ||||
| 	use root | ||||
| 	after bootmisc | ||||
| } | ||||
|   | ||||
| @@ -212,7 +212,7 @@ _delete_addresses() | ||||
|  | ||||
| _has_carrier() | ||||
| { | ||||
| 	return 0 | ||||
| 	LC_ALL=C ip link show dev "${IFACE}" | grep -q "LOWER_UP" | ||||
| } | ||||
|  | ||||
| _tunnel() | ||||
| @@ -287,7 +287,7 @@ iproute2_pre_start() | ||||
| _iproute2_ipv6_tentative() | ||||
| { | ||||
| 	# Only check tentative when we have a carrier. | ||||
| 	LC_ALL=C ip link show dev "${IFACE}" | grep -q "NO-CARRIER" && return 1 | ||||
| 	_has_carrier || return 1 | ||||
| 	LC_ALL=C ip addr show dev "${IFACE}" | \ | ||||
| 		grep -q "^[[:space:]]*inet6 .* tentative" | ||||
| } | ||||
|   | ||||
| @@ -61,12 +61,12 @@ udhcpc_start() | ||||
| 	esac | ||||
|  | ||||
| 	case " ${args} " in | ||||
| 		*" --hosname="*|*" -h "*|*" -H "*);; | ||||
| 		*" --hostname="*|*" -h "*|*" -H "*);; | ||||
| 		*) | ||||
| 			if ${sendhost}; then | ||||
| 				local hname="$(hostname)" | ||||
| 				if [ "${hname}" != "(none)" ] && [ "${hname}" != "localhost" ]; then | ||||
| 					args="${args} --hostname='${hname}'" | ||||
| 					args="${args} -x hostname:'${hname}'" | ||||
| 				fi | ||||
| 			fi | ||||
| 			;; | ||||
|   | ||||
							
								
								
									
										31
									
								
								net/vlan.sh
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								net/vlan.sh
									
									
									
									
									
								
							| @@ -66,26 +66,41 @@ vlan_post_start() | ||||
| 		einfo "Adding VLAN ${vlan} to ${IFACE}" | ||||
| 		# We need to gather all interface configuration options | ||||
| 		# 1) naming. Default to the standard "${IFACE}.${vlan}" but it can be anything | ||||
| 		eval vname=\$vlan${vlan}_name | ||||
| 		eval vname=\$${IFACE}_vlan${vlan}_name | ||||
| 		[ -z "${vname}" ] && eval vname=\$vlan${vlan}_name | ||||
| 		[ -z "${vname}" ] && vname="${IFACE}.${vlan}" | ||||
| 		# 2) flags | ||||
| 		eval vflags=\$vlan${vlan}_flags | ||||
| 		eval vflags=\$${IFACE}_vlan${vlan}_flags | ||||
| 		[ -z "${vname}" ] && eval vflags=\$vlan${vlan}_flags | ||||
| 		# 3) ingress/egress map | ||||
| 		eval vingress=\$vlan${vlan}_ingress | ||||
| 		eval vingress=\$${IFACE}_vlan${vlan}_ingress | ||||
| 		[ -z "${vingress}" ] && eval vingress=\$vlan${vlan}_ingress | ||||
| 		[ -z "${vingress}" ] || vingress="ingress-qos-map ${vingress}" | ||||
| 		eval vegress=\$vlan${vlan}_egress | ||||
| 		eval vegress=\$${IFACE}_vlan${vlan}_egress | ||||
| 		[ -z "${vegress}" ] && eval vegress=\$vlan${vlan}_egress | ||||
| 		[ -z "${vegress}" ] || vegress="egress-qos-map ${vegress}" | ||||
|  | ||||
| 		# txqueue | ||||
| 		local txqueuelen= | ||||
| 		eval txqueuelen=\$txqueuelen_vlan${vlan} | ||||
| 		eval txqueuelen=\$txqueuelen_${IFACE}_vlan${vlan} | ||||
| 		[ -z "${txqueuelen}" ] && eval txqueuelen=\$txqueuelen_vlan${vlan} | ||||
| 		# mac | ||||
| 		local mac= | ||||
| 		eval mac=\$mac_vlan${vlan} | ||||
| 		eval mac=\$mac_${IFACE}_vlan${vlan} | ||||
| 		[ -z "${mac}" ] && eval mac=\$mac_vlan${vlan} | ||||
| 		# broadcast | ||||
| 		local broadcast= | ||||
| 		eval broadcast=\$broadcast_vlan${vlan} | ||||
| 		eval broadcast=\$broadcast_${IFACE}_vlan${vlan} | ||||
| 		[ -z "${broadcast}" ] && eval broadcast=\$broadcast_vlan${vlan} | ||||
| 		# mtu | ||||
| 		local mtu= | ||||
| 		eval mtu=\$mtu_vlan${vlan} | ||||
| 		eval mtu=\$mtu_${IFACE}_vlan${vlan} | ||||
| 		[ -z "${mtu}" ] && eval mtu=\$mtu_vlan${vlan} | ||||
|  | ||||
| 		# combine it all | ||||
| 		local opts="${txqueuelen:+txqueuelen} ${txqueuelen} ${mac:+address} ${mac} ${broadcast:+broadcast} ${broadcast} ${mtu:+mtu} ${mtu}" | ||||
|  | ||||
| 		veinfo "ip link add link \"${IFACE}\" name \"${vname}\" ${opts} type vlan id \"${vlan}\" ${vflags} ${vingress} ${vegress}" | ||||
| 		e="$(ip link add link "${IFACE}" name "${vname}" ${opts} type vlan id "${vlan}" ${vflags} ${vingress} ${vegress} 2>&1 1>/dev/null)" | ||||
| 		if [ -n "${e}" ]; then | ||||
| 			eend 1 "${e}" | ||||
|   | ||||
| @@ -37,14 +37,23 @@ fi | ||||
|  | ||||
| # /run is a new directory for storing volatile runtime data. | ||||
| # Read more about /run at https://lwn.net/Articles/436012 | ||||
| sys="$(rc --sys)" | ||||
|  | ||||
| if [ ! -d /run ]; then | ||||
| 	eerror "The /run directory does not exist. Unable to continue." | ||||
| 	return 1 | ||||
| 	if [ "$sys" = VSERVER ]; then | ||||
| 		if [ -e /run ]; then | ||||
| 		rm -rf /run | ||||
| 		fi | ||||
| 		mkdir /run | ||||
| 	else | ||||
| 		eerror "The /run directory does not exist. Unable to continue." | ||||
| 		return 1 | ||||
| 	fi | ||||
| fi | ||||
|  | ||||
| if mountinfo -q /run; then | ||||
| 	einfo "/run is already mounted, skipping" | ||||
| else | ||||
| if [ "$sys" = VSERVER ]; then | ||||
| 	rm -rf /run/* | ||||
| elif ! mountinfo -q /run; then | ||||
| 	ebegin "Mounting /run" | ||||
| 	rc=0 | ||||
| 	if ! fstabinfo --mount /run; then | ||||
|   | ||||
| @@ -268,10 +268,10 @@ for FILE in $tmpfiles_d ; do | ||||
| 		age=$6 | ||||
| 		arg=$7 | ||||
|  | ||||
| 		[ ${4} = '-' ] && uid=0 | ||||
| 		[ ${5} = '-' ] && gid=0 | ||||
| 		[ ${6} = '-' ] && age=0 | ||||
| 		[ ${7} = '-' ] && arg='' | ||||
| 		[ "${4}" = '-' -o "${4}" = '' ] && uid=0 | ||||
| 		[ "${5}" = '-' -o "${5}" = '' ] && gid=0 | ||||
| 		[ "${6}" = '-' -o "${6}" = '' ] && age=0 | ||||
| 		[ "${7}" = '-' -o "${7}" = '' ] && arg='' | ||||
| 		set -- "$path" "$mode" "$uid" "$gid" "$age" "$arg" | ||||
|  | ||||
| 		[ "$VERBOSE" -eq "1" ] && echo _$cmd "$@" | ||||
|   | ||||
| @@ -393,8 +393,7 @@ mountinfo(int argc, char **argv) | ||||
| 	bool quiet; | ||||
| 	char *this_path; | ||||
|  | ||||
| 	/* Ensure that we are only quiet when explicitly told to be */ | ||||
| 	unsetenv("EINFO_QUIET"); | ||||
| 	quiet = rc_yesno(getenv("EINFO_QUIET")); | ||||
|  | ||||
| #define DO_REG(_var)							      \ | ||||
| 	if (_var) free(_var);						      \ | ||||
| @@ -475,7 +474,6 @@ mountinfo(int argc, char **argv) | ||||
| 	REG_FREE(args.skip_options_regex); | ||||
|  | ||||
| 	result = EXIT_FAILURE; | ||||
| 	quiet = rc_yesno(getenv("EINFO_QUIET")); | ||||
|  | ||||
| 	/* We should report the mounts in reverse order to ease unmounting */ | ||||
| 	TAILQ_FOREACH_REVERSE(s, nodes, rc_stringlist, entries) { | ||||
|   | ||||
| @@ -343,7 +343,7 @@ do_mark_service(int argc, char **argv) | ||||
| 	if (service == NULL || *service == '\0') | ||||
| 		eerrorx("%s: no service specified", applet); | ||||
|  | ||||
| 	if (strncmp(applet, "mark_", 5) && | ||||
| 	if (!strncmp(applet, "mark_", 5) && | ||||
| 	    (bit = lookup_service_state(applet + 5))) | ||||
| 		ok = rc_service_mark(service, bit); | ||||
| 	else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user