Compare commits
	
		
			16 Commits
		
	
	
		
			openrc-0.8
			...
			openrc-0.8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 2d14b172fa | ||
|   | 03cd55aa19 | ||
|   | 85827d474c | ||
|   | 8e925368b7 | ||
|   | 15660dbbfc | ||
|   | 07db27d220 | ||
|   | 16f7e90c6c | ||
|   | c7c278dfd4 | ||
|   | 73c862b792 | ||
|   | 46e67badd2 | ||
|   | 67640d2d97 | ||
|   | 8a45d5e24e | ||
|   | 6e1239795f | ||
|   | 7c1a2defb6 | ||
|   | 1d63e85794 | ||
|   | 25049d3e80 | 
| @@ -1,3 +1,3 @@ | ||||
| NAME=		openrc | ||||
| VERSION=	0.8.0 | ||||
| VERSION=	0.8.1 | ||||
| PKG=		${NAME}-${VERSION} | ||||
|   | ||||
| @@ -67,10 +67,12 @@ | ||||
| # If a specified module fails (like dhcp - see below), you can specify a | ||||
| # fallback like so | ||||
| #fallback_eth0="192.168.0.2 netmask 255.255.255.0" | ||||
| #fallback_route_eth0="default via 192.168.0.1" | ||||
| #fallback_routes_eth0="default via 192.168.0.1" | ||||
|  | ||||
| # NOTE: fallback entry must match the entry location in config_eth0 | ||||
| # As such you can only have one fallback route. | ||||
| # Also, if you do not set a fallback_routes entry for an interface, the | ||||
| # routes entry will be used if that is set. | ||||
|  | ||||
| # Some users may need to alter the MTU - here's how | ||||
| #mtu_eth0="1500" | ||||
| @@ -357,6 +359,15 @@ | ||||
| # manager like resolvconf-gentoo to manage this file for you. All packages | ||||
| # that baselayout supports use resolvconf-gentoo if installed. | ||||
|  | ||||
| # If you run any services on net.lo which need localmount, either the | ||||
| # services or net.lo should explicitly bring in localmount. | ||||
| # If you do not do this, openrc will try to bring up net.lo as soon as | ||||
| # possible, which may be too early for your services. | ||||
| # If you use network file systems for your core system this may | ||||
| # interfere. | ||||
| # Also, you may need this if 127.0.0.1 is in your /etc/resolv.conf. | ||||
| #rc_net_lo0_need="localmount" | ||||
|  | ||||
| #----------------------------------------------------------------------------- | ||||
| # Cable in/out detection | ||||
| # Sometimes the cable is in, others it's out. Obviously you don't want to | ||||
|   | ||||
| @@ -94,10 +94,12 @@ | ||||
| # If a specified module fails (like dhcp - see below), you can specify a | ||||
| # fallback like so | ||||
| #fallback_eth0="192.168.0.2/24" | ||||
| #fallback_route_eth0="default via 192.168.0.1" | ||||
| #fallback_routes_eth0="default via 192.168.0.1" | ||||
|  | ||||
| # NOTE: fallback entry must match the entry location in config_eth0 | ||||
| # As such you can only have one fallback route. | ||||
| # Also, if you do not set a fallback_routes entry for an interface, the | ||||
| # routes entry will be used if that is set. | ||||
|  | ||||
| # Some users may need to alter the MTU - here's how | ||||
| #mtu_eth0="1500" | ||||
| @@ -540,11 +542,21 @@ | ||||
|  | ||||
| # 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 | ||||
| # will be used. This is the replacement for the old 'vconfig set_name_type' | ||||
| # functionality. | ||||
| #vlan1_name="vlan1" | ||||
| #vlan2_name="eth0.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" | ||||
|  | ||||
| # Set the vlan flags | ||||
| #vlan1_flags="reorder_hdr off gvrp on loose_binding on" | ||||
|  | ||||
| # Configure in/egress maps | ||||
| #vlan1_ingress="2:6 3:5" | ||||
| #vlan1_egress="1:2" | ||||
| @@ -950,6 +962,15 @@ | ||||
| # manager like resolvconf-gentoo to manage this file for you. All packages | ||||
| # that baselayout supports use resolvconf-gentoo if installed. | ||||
|  | ||||
| # If you run any services on net.lo which need localmount, either the | ||||
| # services or net.lo should explicitly bring in localmount. | ||||
| # If you do not do this, openrc will try to bring up net.lo as soon as | ||||
| # possible, which may be too early for your services. | ||||
| # If you use network file systems for your core system this may | ||||
| # interfere. | ||||
| # Also, you may need this if 127.0.0.1 is in your /etc/resolv.conf. | ||||
| #rc_net_lo_need="localmount" | ||||
|  | ||||
| #----------------------------------------------------------------------------- | ||||
| # Cable in/out detection | ||||
| # Sometimes the cable is in, others it's out. Obviously you don't want to | ||||
|   | ||||
| @@ -7,7 +7,7 @@ depend() | ||||
| 	need localmount | ||||
| 	before logger | ||||
| 	after clock sysctl | ||||
| 	keyword -prefix | ||||
| 	keyword -prefix -timeout | ||||
| } | ||||
|  | ||||
| dir_writeable() | ||||
| @@ -26,14 +26,15 @@ cleanup_tmp_dir() | ||||
| 	fi | ||||
| 	dir_writeable "$dir" || return 1 | ||||
| 	chmod a+rwt "$dir" 2> /dev/null | ||||
| 	cd "$dir" | ||||
| 	cd "$dir" || return 1 | ||||
| 	if yesno $wipe_tmp; then | ||||
| 		ebegin "Wiping $dir directory" | ||||
| 		local startopts="-x . -depth" | ||||
| 		[ "$RC_UNAME" = Linux ] && startopts=". -xdev -depth" | ||||
|  | ||||
| 		# Faster than find | ||||
| 		rm -rf -- [^ajlq\.]* | ||||
| 		# Faster than raw find | ||||
| 		if ! rm -rf -- [^ajlq\.]* 2>/dev/null ; then | ||||
| 			# Blah, too many files | ||||
| 			find . -maxdepth 1 -name '[^ajlq\.]*' -exec rm -rf -- {} + | ||||
| 		fi | ||||
|  | ||||
| 		# pam_mktemp creates a .private directory within which | ||||
| 		# each user gets a private directory with immutable | ||||
| @@ -41,27 +42,23 @@ cleanup_tmp_dir() | ||||
| 		# remove it. | ||||
| 		[ -d /tmp/.private ] && chattr -R -a /tmp/.private 2> /dev/null | ||||
|  | ||||
| 		find $startopts ! -name . \ | ||||
| 			! -path "./lost+found" \ | ||||
| 			! -path "./lost+found/*" \ | ||||
| 			! -path "./quota.user" \ | ||||
| 			! -path "./quota.user/*" \ | ||||
| 			! -path "./aquota.user" \ | ||||
| 			! -path "./aquota.user/*" \ | ||||
| 			! -path "./quota.group" \ | ||||
| 			! -path "./quota.group/*" \ | ||||
| 			! -path "./aquota.group" \ | ||||
| 			! -path "./aquota.group/*" \ | ||||
| 			! -path "./journal" \ | ||||
| 			! -path "./journal/*" \ | ||||
| 			-exec rm -rf {} \; | ||||
| 		# Prune the paths that are left | ||||
| 		find . -maxdepth 1 \ | ||||
| 			! -name . \ | ||||
| 			! -name lost+found \ | ||||
| 			! -name quota.user \ | ||||
| 			! -name aquota.user \ | ||||
| 			! -name quota.group \ | ||||
| 			! -name aquota.group \ | ||||
| 			! -name journal \ | ||||
| 			-exec rm -rf -- {} + | ||||
| 		eend 0 | ||||
| 	else | ||||
| 		ebegin "Cleaning $dir directory" | ||||
| 		rm -rf -- "$dir"/.X*-lock "$dir"/esrv* "$dir"/kio* \ | ||||
| 			"$dir"/jpsock.* "$dir"/.fam* "$dir"/.esd* \ | ||||
| 			"$dir"/orbit-* "$dir"/ssh-* "$dir"/ksocket-* \ | ||||
| 			"$dir"/.*-unix | ||||
| 		rm -rf -- .X*-lock esrv* kio* \ | ||||
| 			jpsock.* .fam* .esd* \ | ||||
| 			orbit-* ssh-* ksocket-* \ | ||||
| 			.*-unix | ||||
| 		eend 0 | ||||
| 	fi | ||||
| } | ||||
|   | ||||
| @@ -18,14 +18,12 @@ depend() | ||||
| 	local IFACE=${RC_SVCNAME#*.} | ||||
| 	local IFVAR=$(shell_var "${IFACE}") | ||||
|  | ||||
| 	need localmount | ||||
| 	after bootmisc | ||||
| 	provide net | ||||
| 	keyword -jail -prefix -vserver | ||||
|  | ||||
| 	case "${IFACE}" in | ||||
| 		lo|lo0);; | ||||
| 		*) after net.lo net.lo0;; | ||||
| 		lo|lo0) before mtab ; need root ;; | ||||
| 		*) after bootmisc net.lo net.lo0 ; need localmount ;; | ||||
| 	esac | ||||
|  | ||||
| 	if [ "$(command -v "depend_${IFVAR}")" = "depend_${IFVAR}" ]; then | ||||
| @@ -476,7 +474,7 @@ interface_down() | ||||
|  | ||||
| start() | ||||
| { | ||||
| 	local IFACE=${RC_SVCNAME#*.} oneworked=false module= | ||||
| 	local IFACE=${RC_SVCNAME#*.} oneworked=false fallback=false module= | ||||
| 	local IFVAR=$(shell_var "${IFACE}") cmd= our_metric= | ||||
| 	local metric=0 | ||||
|  | ||||
| @@ -563,6 +561,7 @@ start() | ||||
| 		else | ||||
| 			eval config=\$fallback_${config_index} | ||||
| 			if [ -n "${config}" ]; then | ||||
| 				fallback=true | ||||
| 				eoutdent | ||||
| 				ewarn "Trying fallback configuration ${config}" | ||||
| 				eindent | ||||
| @@ -585,8 +584,13 @@ start() | ||||
| 		return 1 | ||||
| 	fi | ||||
|  | ||||
| 	local hidefirstroute=false first=true | ||||
| 	local routes="$(_get_array "routes_${IFVAR}")" | ||||
| 	local hidefirstroute=false first=true routes= | ||||
| 	if ${fallback}; then | ||||
| 		routes="$(_get_array "fallback_routes_${IFVAR}")" | ||||
| 	fi | ||||
| 	if [ -z "${routes}" ]; then | ||||
| 		routes="$(_get_array "routes_${IFVAR}")" | ||||
| 	fi | ||||
| 	if [ "${IFACE}" = "lo" -o "${IFACE}" = "lo0" ]; then | ||||
| 		if [ "${config_0}" != "null" ]; then | ||||
| 			routes="127.0.0.0/8 via 127.0.0.1 | ||||
|   | ||||
| @@ -81,7 +81,7 @@ do_routes() | ||||
| 					*) family=;; | ||||
| 					esac | ||||
| 				fi | ||||
| 				route $famly $xtra $2 -$args | ||||
| 				route $family $xtra $2 -$args | ||||
| 				;; | ||||
| 			esac | ||||
| 			veend $? | ||||
|   | ||||
| @@ -10,6 +10,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} | ||||
| depend() | ||||
| { | ||||
| 	keyword -openvz -prefix -uml -vserver -xenu | ||||
| 	need root | ||||
| } | ||||
|  | ||||
| start() | ||||
|   | ||||
| @@ -148,7 +148,8 @@ have this keyword. | ||||
| Don't stop this service when changing runlevels, even if not present. | ||||
| This includes shutting the system down. | ||||
| .It Dv -timeout | ||||
| Do not time out waiting for that service. | ||||
| Other services should wait indefinitely for this service to start. Use | ||||
| this keyword if your service may take longer than 60 seconds to start. | ||||
| .It Dv -jail | ||||
| When in a jail, exclude this service from any dependencies. The service can | ||||
| still be run directly. Set via  | ||||
|   | ||||
| @@ -31,8 +31,6 @@ lib${LIB}.a:	${OBJS} ${STATICOBJS} | ||||
|  | ||||
| ${SHLIB_NAME}: ${VERSION_MAP} | ||||
| LDFLAGS+=	-Wl,--version-script=${VERSION_MAP} | ||||
| # We need to ensure we use libraries in /lib | ||||
| LDFLAGS+=	-L/${LIBNAME} -Wl,-rpath=/${LIBNAME} | ||||
|  | ||||
| ${SHLIB_NAME}:	${SOBJS} | ||||
| 	@${ECHO} building shared library $@ | ||||
|   | ||||
| @@ -25,7 +25,7 @@ ethtool_pre_start() { | ||||
| 	eindent | ||||
| 	for opt in ${order} ; do | ||||
| 		local args | ||||
| 		eval args=\$ethtool_${opt//-/_}_${IFVAR} | ||||
| 		eval args=\$ethtool_$(echo $opt | tr - _)_${IFVAR} | ||||
|  | ||||
| 		# Skip everything if no arguments | ||||
| 		[ -z "${args}" ] && continue | ||||
| @@ -37,7 +37,7 @@ ethtool_pre_start() { | ||||
| 			IFS="${OIFS}" | ||||
| 			local args_pretty="$(_trim "${p}")" | ||||
| 			# Do nothing if empty | ||||
| 			[ -z "${args_prety}" ] && continue | ||||
| 			[ -z "${args_pretty}" ] && continue | ||||
| 			args_pretty="--${opt} $IFACE ${args_pretty}" | ||||
| 			args="--${opt} $IFACE ${args}" | ||||
| 			ebegin "ethtool ${args_pretty}" | ||||
|   | ||||
| @@ -65,27 +65,21 @@ mount_svcdir() | ||||
| # By default VServer already has /proc mounted, but OpenVZ does not! | ||||
| # However, some of our users have an old proc image in /proc | ||||
| # NFC how they managed that, but the end result means we have to test if | ||||
| # /proc actually works or not. We to this by comparing two reads of | ||||
| # /proc/self/stat. They will not match, because at least the minor fault count | ||||
| # field (field 10) should have changed. | ||||
| # | ||||
| # We can use any file here that fills the following requirements: | ||||
| # - changes between sequential reads | ||||
| # - is world-readable (not blocked in hardened kernel) | ||||
| # - Is only a single line (ergo entire check is doable with no forks) | ||||
| # /proc actually works or not. We do this by comparing two reads of | ||||
| # /proc/self/environ for which we have set the variable VAR to two | ||||
| # different values. If the comparison comes back equal, we know that | ||||
| # /proc is not working. | ||||
| mountproc=true | ||||
| f=/proc/self/stat | ||||
| f=/proc/self/environ | ||||
| if [ -e $f ]; then | ||||
| 	exec 9<$f ; read a <&9 ; exec 9<&- | ||||
| 	exec 9<$f ; read b <&9 ; exec 9<&- | ||||
| 	if [ "$a" = "$b" ]; then | ||||
| 	if [ "$(VAR=a cat $f)" = "$(VAR=b cat $f)" ]; then | ||||
| 		eerror "You have cruft in /proc that should be deleted" | ||||
| 	else | ||||
| 		einfo "/proc is already mounted, skipping" | ||||
| 		mountproc=false | ||||
| 	fi | ||||
| fi | ||||
| unset a b f | ||||
| unset f | ||||
|  | ||||
| if $mountproc; then | ||||
| 	procfs="proc" | ||||
|   | ||||
| @@ -924,7 +924,7 @@ rc_deptree_update(void) | ||||
| 					if (strcmp(deptype->type, "ineed") == 0) { | ||||
| 						fprintf (stderr, | ||||
| 							 "Service `%s' needs non" | ||||
| 							 " existant service `%s'\n", | ||||
| 							 " existent service `%s'\n", | ||||
| 							 depinfo->service, s->value); | ||||
| 						dt = get_deptype(depinfo, "broken"); | ||||
| 						if (!dt) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user