Compare commits
	
		
			35 Commits
		
	
	
		
			0.45.2
			...
			openrc-0.1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 0884271bdd | ||
|   | f837107ca5 | ||
|   | 9c4582fbd7 | ||
|   | ccb068c484 | ||
|   | 603a308c6a | ||
|   | fba6bbb4b6 | ||
|   | ded282f163 | ||
|   | 38ae822077 | ||
|   | 611ed42044 | ||
|   | 3f719bbb8b | ||
|   | e37b84a37d | ||
|   | 9fdee75936 | ||
|   | dd261a2a54 | ||
|   | b36ef234be | ||
|   | a2c3660b87 | ||
|   | e473ab968c | ||
|   | b8a5a1a309 | ||
|   | 8046427d7f | ||
|   | c73173ae53 | ||
|   | 2964fc47f1 | ||
|   | 0396f0ea7c | ||
|   | 78a25883f3 | ||
|   | 18dc0efa52 | ||
|   | f53645b7c7 | ||
|   | a75a9940b0 | ||
|   | e27f0acc60 | ||
|   | 5c8ba80ea7 | ||
|   | e8ad6d2423 | ||
|   | aa34435cc8 | ||
|   | 68f8e8aac2 | ||
|   | ee54bfef05 | ||
|   | 7279b469ec | ||
|   | 8482008559 | ||
|   | 463d4ef00a | ||
|   | b5629d4ea0 | 
| @@ -1,3 +1,3 @@ | |||||||
| NAME=		openrc | NAME=		openrc | ||||||
| VERSION=	0.11 | VERSION=	0.11.8 | ||||||
| PKG=		${NAME}-${VERSION} | PKG=		${NAME}-${VERSION} | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| DIR=	${CONFDIR} | DIR=	${CONFDIR} | ||||||
| CONF=	bootmisc fsck hostname localmount urandom tmpfilesd ${CONF-${OS}} | CONF=	bootmisc fsck hostname localmount netmount urandom tmpfiles \ | ||||||
|  | 		${CONF-${OS}} | ||||||
|  |  | ||||||
| ifeq (${MKNET},) | ifeq (${MKNET},) | ||||||
| CONF+= network staticroute | CONF+= network staticroute | ||||||
|   | |||||||
							
								
								
									
										40
									
								
								conf.d/netmount
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								conf.d/netmount
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | |||||||
|  | # You will need to set the dependencies in the netmount script to match | ||||||
|  | # the network configuration tools you are using. This should be done in | ||||||
|  | # this file by following the examples below, and not by changing the | ||||||
|  | # service script itself. | ||||||
|  | # | ||||||
|  | # Each of these examples is meant to be used separately. So, for | ||||||
|  | # example, do not set rc_need to something like "net.eth0 dhcpcd". | ||||||
|  | # | ||||||
|  | # If you are using newnet and configuring your interfaces with static | ||||||
|  | # addresses with the network script, you  should use this setting. | ||||||
|  | # | ||||||
|  | #rc_need="network" | ||||||
|  | # | ||||||
|  | # If you are using oldnet, you must list the specific net.* services you | ||||||
|  | # need. | ||||||
|  | # | ||||||
|  | # This example assumes all of your netmounts can be reached on | ||||||
|  | # eth0. | ||||||
|  | # | ||||||
|  | #rc_need="net.eth0" | ||||||
|  | # | ||||||
|  | # This example assumes some of your netmounts are on eth1 and some | ||||||
|  | # are on eth2. | ||||||
|  | # | ||||||
|  | #rc_need="net.eth1 net.eth2" | ||||||
|  | # | ||||||
|  | # If you are using a dynamic network management tool like | ||||||
|  | # networkmanager, dhcpcd in standalone mode, wicd, badvpn-ncd, etc, to | ||||||
|  | # manage the network interfaces with the routes to your netmounts, you | ||||||
|  | # should list that tool. | ||||||
|  | # | ||||||
|  | #rc_need="networkmanager" | ||||||
|  | #rc_need="dhcpcd" | ||||||
|  | #rc_need="wicd" | ||||||
|  | # | ||||||
|  | # The default setting is designed to be backward compatible with our | ||||||
|  | # current setup, but you are highly discouraged from using this. In | ||||||
|  | # other words, please change it to be more suited to your system. | ||||||
|  | # | ||||||
|  | rc_need="net" | ||||||
| @@ -80,9 +80,9 @@ | |||||||
| # Most drivers that report carrier status function correctly, but some do not | # Most drivers that report carrier status function correctly, but some do not | ||||||
| # One of these faulty drivers is for the Intel e1000 network card, but only | # One of these faulty drivers is for the Intel e1000 network card, but only | ||||||
| # at boot time. To get around this you may alter the carrier_timeout value for | # at boot time. To get around this you may alter the carrier_timeout value for | ||||||
| # the interface. -1 is disable, 0 is infinite and any other number of seconds | # the interface. 0 is disable and any other number of seconds is how | ||||||
| # is how long we wait for carrier. The current default is 3 seconds | # long we wait for carrier. The current default is disabled. | ||||||
| #carrier_timeout_eth0=-1 | #carrier_timeout_eth0=0 | ||||||
|  |  | ||||||
| # You may wish to disable the interface being brought down when stopping. | # You may wish to disable the interface being brought down when stopping. | ||||||
| # This is only of use for WakeOnLan. | # This is only of use for WakeOnLan. | ||||||
|   | |||||||
| @@ -126,6 +126,13 @@ | |||||||
| # tables you may have to set a global metric as the due to a simple read of | # tables you may have to set a global metric as the due to a simple read of | ||||||
| # the routing table taking over a minute at a time. | # the routing table taking over a minute at a time. | ||||||
|  |  | ||||||
|  | # Most drivers that report carrier status function correctly, but some do not | ||||||
|  | # One of these faulty drivers is for the Intel e1000 network card, but only | ||||||
|  | # at boot time. To get around this you may alter the carrier_timeout value for | ||||||
|  | # the interface. 0 is disable and any other number of seconds is how | ||||||
|  | # long we wait for carrier. The current default is disabled. | ||||||
|  | #carrier_timeout_eth0=0 | ||||||
|  |  | ||||||
| # You may wish to disable the interface being brought down when stopping. | # You may wish to disable the interface being brought down when stopping. | ||||||
| # This is only of use for WakeOnLan. | # This is only of use for WakeOnLan. | ||||||
| #ifdown_eth0="NO" | #ifdown_eth0="NO" | ||||||
| @@ -1130,6 +1137,13 @@ | |||||||
| # Hypothetical network card that requires a change-eeprom toggle to enable flashing | # Hypothetical network card that requires a change-eeprom toggle to enable flashing | ||||||
| #ethtool_order_eth0="change-eeprom flash change pause coalesce ring offload nfc rxfh-indir ntuple" | #ethtool_order_eth0="change-eeprom flash change pause coalesce ring offload nfc rxfh-indir ntuple" | ||||||
|  |  | ||||||
|  | #----------------------------------------------------------------------------- | ||||||
|  | # Firewalld support | ||||||
|  | # If you are using the firewalld daemon to configure your firewall | ||||||
|  | # settings and you have specific zones you want to apply to your | ||||||
|  | # interfaces, you can do this here. | ||||||
|  | #firewalld_zone_eth0="myzone" | ||||||
|  |  | ||||||
| ############################################################################## | ############################################################################## | ||||||
| # ADVANCED CONFIGURATION | # ADVANCED CONFIGURATION | ||||||
| # | # | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ | |||||||
| rc_tty_number=12 | rc_tty_number=12 | ||||||
|  |  | ||||||
| # If you have cgroups turned on in your kernel, this switch controls | # If you have cgroups turned on in your kernel, this switch controls | ||||||
| # whether or not a group for each controler is mounted under | # whether or not a group for each controller is mounted under | ||||||
| # /sys/fs/cgroup. | # /sys/fs/cgroup. | ||||||
| # Support for process management by cgroups is planned in the future, | # Support for process management by cgroups is planned in the future, | ||||||
| # so if you turn this off, be aware that you may not be able to use that | # so if you turn this off, be aware that you may not be able to use that | ||||||
|   | |||||||
| @@ -94,6 +94,10 @@ | |||||||
| # These variables are documented here, but should be configured in | # These variables are documented here, but should be configured in | ||||||
| # /etc/conf.d/foo for service foo and NOT enabled here unless you | # /etc/conf.d/foo for service foo and NOT enabled here unless you | ||||||
| # really want them to work on a global basis. | # really want them to work on a global basis. | ||||||
|  | # If your service has characters in its name which are not legal in | ||||||
|  | # shell variable names and you configure the variables for it in this | ||||||
|  | # file, those characters should be replaced with underscores in the | ||||||
|  | # variable names as shown below. | ||||||
|  |  | ||||||
| # Some daemons are started and stopped via start-stop-daemon. | # Some daemons are started and stopped via start-stop-daemon. | ||||||
| # We can set some things on a per service basis, like the nicelevel. | # We can set some things on a per service basis, like the nicelevel. | ||||||
| @@ -116,6 +120,13 @@ | |||||||
| #rc_foo_need="openvpn" | #rc_foo_need="openvpn" | ||||||
| #rc_foo_after="clock" | #rc_foo_after="clock" | ||||||
|  |  | ||||||
|  | # Below is an example for service foo-bar. Note that the '-' is illegal | ||||||
|  | # in a shell variable name, so we convert it to an underscore. | ||||||
|  | # example for service foo-bar. | ||||||
|  | #rc_foo_bar_config="/etc/foo-bar" | ||||||
|  | #rc_foo_bar_need="openvpn" | ||||||
|  | #rc_foo_bar_after="clock" | ||||||
|  |  | ||||||
| # You can also remove dependencies. | # You can also remove dependencies. | ||||||
| # This is mainly used for saying which servies do NOT provide net. | # This is mainly used for saying which servies do NOT provide net. | ||||||
| #rc_net_tap0_provide="!net" | #rc_net_tap0_provide="!net" | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								init.d/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								init.d/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -41,5 +41,4 @@ syslogd | |||||||
| termencoding | termencoding | ||||||
| ttys | ttys | ||||||
| wscons | wscons | ||||||
| tmpfilesd.boot | tmpfiles.setup | ||||||
| tmpfilesd.sysinit |  | ||||||
|   | |||||||
| @@ -1,8 +1,7 @@ | |||||||
| DIR=	${INITDIR} | DIR=	${INITDIR} | ||||||
| SRCS=	bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \ | SRCS=	bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \ | ||||||
| 	root.in savecache.in swap.in swapfiles.in \ | 	root.in savecache.in swap.in swapfiles.in \ | ||||||
| 	tmpfilesd.boot.in tmpfilesd.sysinit.in \ | 	tmpfiles.setup.in swclock.in sysctl.in urandom.in ${SRCS-${OS}} | ||||||
| 	swclock.in sysctl.in urandom.in ${SRCS-${OS}} |  | ||||||
| BIN=	${OBJS} | BIN=	${OBJS} | ||||||
|  |  | ||||||
| # Build our old net foo or not | # Build our old net foo or not | ||||||
|   | |||||||
| @@ -5,8 +5,8 @@ | |||||||
| description="Mount system critical filesystems in /dev." | description="Mount system critical filesystems in /dev." | ||||||
|  |  | ||||||
| depend() { | depend() { | ||||||
| 	use dev-mount udev-mount | 	use dev-mount | ||||||
| 	before udev mdev | 	before dev | ||||||
| 	keyword -prefix -vserver | 	keyword -prefix -vserver | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -22,6 +22,9 @@ start() | |||||||
|  |  | ||||||
| 	if [ "$RC_UNAME" = Linux ]; then | 	if [ "$RC_UNAME" = Linux ]; then | ||||||
| 		no_netdev="-O no_netdev" | 		no_netdev="-O no_netdev" | ||||||
|  | 		if mountinfo -q /usr; then | ||||||
|  | 			touch $RC_SVCDIR/usr_premounted | ||||||
|  | 		fi | ||||||
| 	fi | 	fi | ||||||
| 	ebegin "Mounting local filesystems" | 	ebegin "Mounting local filesystems" | ||||||
| 	mount -at "$types" $no_netdev | 	mount -at "$types" $no_netdev | ||||||
| @@ -48,7 +51,10 @@ stop() | |||||||
| 	done | 	done | ||||||
|  |  | ||||||
| 	if [ "$RC_UNAME" = Linux ]; then | 	if [ "$RC_UNAME" = Linux ]; then | ||||||
| 		no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*|/usr" | 		no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*" | ||||||
|  | 		if [ -e $rc_svcdir/usr_premounted ]; then | ||||||
|  | 			no_umounts_r="$no_umounts_r|/usr" | ||||||
|  | 		fi | ||||||
| 	fi | 	fi | ||||||
| 	no_umounts_r="^($no_umounts_r)$" | 	no_umounts_r="^($no_umounts_r)$" | ||||||
|  |  | ||||||
|   | |||||||
| @@ -108,7 +108,7 @@ _wait_for_carrier() | |||||||
| 	_has_carrier  && return 0 | 	_has_carrier  && return 0 | ||||||
|  |  | ||||||
| 	eval timeout=\$carrier_timeout_${IFVAR} | 	eval timeout=\$carrier_timeout_${IFVAR} | ||||||
| 	timeout=${timeout:-${carrier_timeout:-5}} | 	timeout=${timeout:-${carrier_timeout:-0}} | ||||||
|  |  | ||||||
| 	# Incase users don't want this nice feature ... | 	# Incase users don't want this nice feature ... | ||||||
| 	[ ${timeout} -le 0 ] && return 0 | 	[ ${timeout} -le 0 ] && return 0 | ||||||
|   | |||||||
| @@ -10,7 +10,6 @@ description="Mounts network shares, other than NFS, according to /etc/fstab." | |||||||
| depend() | depend() | ||||||
| { | { | ||||||
| 	config /etc/fstab | 	config /etc/fstab | ||||||
| 	need net |  | ||||||
| 	use afc-client amd autofs openvpn | 	use afc-client amd autofs openvpn | ||||||
| 	use dns | 	use dns | ||||||
| 	keyword -jail -prefix -vserver | 	keyword -jail -prefix -vserver | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| # Copyright 1999-2012 Gentoo Foundation | # Copyright 1999-2012 Gentoo Foundation | ||||||
| # Released under the 2-clause BSD license. | # Released under the 2-clause BSD license. | ||||||
| 
 | 
 | ||||||
| description="Create tmpfiles.d entries (boot)" | description="set up tmpfiles.d entries" | ||||||
| 
 | 
 | ||||||
| depend() | depend() | ||||||
| { | { | ||||||
| @@ -11,8 +11,8 @@ depend() | |||||||
| 
 | 
 | ||||||
| start() | start() | ||||||
| { | { | ||||||
| 	ebegin "${description/Create/Creating}" | 	ebegin "setting up tmpfiles.d entries" | ||||||
| 	@LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts} | 	@LIBEXECDIR@/sh/tmpfiles.sh --create --remove ${tmpfiles_opts} | ||||||
| 	eend $? | 	eend $? | ||||||
| 	return 0 | 	return 0 | ||||||
| } | } | ||||||
| @@ -1,20 +0,0 @@ | |||||||
| #!@PREFIX@/sbin/runscript |  | ||||||
| # Copyright 1999-2012 Gentoo Foundation |  | ||||||
| # Released under the 2-clause BSD license. |  | ||||||
|  |  | ||||||
| description="Create tmpfiles.d entries (sysinit)" |  | ||||||
|  |  | ||||||
| depend() |  | ||||||
| { |  | ||||||
| 	# Convert to 'need dev' when the new udev is ready, for OpenRC 0.11 |  | ||||||
| 	#need dev-mount |  | ||||||
| 	need dev |  | ||||||
| } |  | ||||||
|  |  | ||||||
| start() |  | ||||||
| { |  | ||||||
| 	ebegin "${description/Create/Creating}" |  | ||||||
| 	@LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts} |  | ||||||
| 	eend $? |  | ||||||
| 	return 0 |  | ||||||
| } |  | ||||||
| @@ -46,7 +46,7 @@ Show all runlevels and their services. | |||||||
| List all services that have crashed. | List all services that have crashed. | ||||||
| .It Fl l , -list | .It Fl l , -list | ||||||
| List all defined runlevels. | List all defined runlevels. | ||||||
| .It fl r , -runlevel | .It Fl r , -runlevel | ||||||
| Print the current runlevel name. | Print the current runlevel name. | ||||||
| .It Fl s , -servicelist | .It Fl s , -servicelist | ||||||
| Show all services. | Show all services. | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ SRCS-Linux=	iwconfig.sh.in | |||||||
| INC-Linux=	adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \ | INC-Linux=	adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \ | ||||||
| 		ccwgroup.sh clip.sh ethtool.sh iproute2.sh ifplugd.sh ip6to4.sh \ | 		ccwgroup.sh clip.sh ethtool.sh iproute2.sh ifplugd.sh ip6to4.sh \ | ||||||
| 		ipppd.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh udhcpc.sh \ | 		ipppd.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh udhcpc.sh \ | ||||||
| 		vlan.sh macvlan.sh ip6rd.sh | 		vlan.sh macvlan.sh ip6rd.sh firewalld.sh | ||||||
|  |  | ||||||
| SRCS-NetBSD= | SRCS-NetBSD= | ||||||
| INC-NetBSD=	ifwatchd.sh | INC-NetBSD=	ifwatchd.sh | ||||||
|   | |||||||
							
								
								
									
										38
									
								
								net/firewalld.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								net/firewalld.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | |||||||
|  | # Copyright (c) 2012 Doug Goldstein <cardoe@cardoe.com> | ||||||
|  | # Released under the 2-clause BSD license. | ||||||
|  |  | ||||||
|  | firewalld_depend() | ||||||
|  | { | ||||||
|  | 	after interface | ||||||
|  | 	before dhcp | ||||||
|  | 	program firewall-cmd | ||||||
|  | 	[ "$IFACE" != "lo" ] && need firewalld | ||||||
|  | } | ||||||
|  |  | ||||||
|  | _config_vars="$_config_vars firewalld_zone" | ||||||
|  |  | ||||||
|  | firewalld_post_start() | ||||||
|  | { | ||||||
|  | 	local firewalld_zone= | ||||||
|  | 	eval firewalld_zone=\$firewalld_zone_${IFVAR} | ||||||
|  |  | ||||||
|  | 	_exists || return 0 | ||||||
|  |  | ||||||
|  | 	if [ "${IFACE}" != "lo" ]; then | ||||||
|  | 		firewall-cmd --zone="${firewalld_zone}" \ | ||||||
|  | 			--change-interface="${IFACE}" > /dev/null 2>&1 | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
|  |  | ||||||
|  | firewalld_pre_stop() | ||||||
|  | { | ||||||
|  | 	_exists || return 0 | ||||||
|  |  | ||||||
|  | 	if [ "${IFACE}" != "lo" ]; then | ||||||
|  | 		firewall-cmd --remove-interface="${IFACE}" > /dev/null 2>&1 | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
| @@ -38,9 +38,9 @@ BOOT-FreeBSD+=	hostid newsyslog savecore syslogd | |||||||
| # FreeBSD specific stuff | # FreeBSD specific stuff | ||||||
| BOOT-FreeBSD+=	adjkerntz dumpon syscons | BOOT-FreeBSD+=	adjkerntz dumpon syscons | ||||||
|  |  | ||||||
| BOOT-Linux+=	hwclock keymaps modules mtab procfs termencoding tmpfilesd.boot | BOOT-Linux+=	hwclock keymaps modules mtab procfs termencoding tmpfiles.setup | ||||||
| SHUTDOWN-Linux=	killprocs mount-ro | SHUTDOWN-Linux=	killprocs mount-ro | ||||||
| SYSINIT-Linux=	devfs dmesg sysfs tmpfilesd.sysinit | SYSINIT-Linux=	devfs dmesg sysfs | ||||||
|  |  | ||||||
| # Generic BSD stuff | # Generic BSD stuff | ||||||
| BOOT-NetBSD+=	hostid newsyslog savecore syslogd | BOOT-NetBSD+=	hostid newsyslog savecore syslogd | ||||||
|   | |||||||
| @@ -51,6 +51,10 @@ if [ ! -d /run ]; then | |||||||
| 	fi | 	fi | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | if [ -L /run/openrc ]; then | ||||||
|  | 	rm /run/openrc | ||||||
|  | fi | ||||||
|  |  | ||||||
| if [ "$sys" = VSERVER ]; then | if [ "$sys" = VSERVER ]; then | ||||||
| 	rm -rf /run/* | 	rm -rf /run/* | ||||||
| elif ! mountinfo -q /run; then | elif ! mountinfo -q /run; then | ||||||
|   | |||||||
| @@ -9,41 +9,21 @@ if ! mountinfo -q -f tmpfs "@LIBEXECDIR@/init.d"; then | |||||||
| 	exit 0 | 	exit 0 | ||||||
| fi | fi | ||||||
|  |  | ||||||
| if [ ! -d "@PREFIX@/run" ]; then | if [ ! -d /run ]; then | ||||||
| 	eerror "'@PREFIX@/run' is not a directory." | 	eerror "/run is not a directory." | ||||||
| 	eerror "This means the OpenRC dependency data cannot be migrated." | 	eerror "moving /run to /run.pre-openrc" | ||||||
| 	eerror "Please create the '@PREFIX@/run' directory and reboot the system." | 	mv /run /run.pre-openrc | ||||||
| 	exit 1 | 	mkdir /run | ||||||
| fi | fi | ||||||
|  |  | ||||||
| if ! mountinfo -q -f tmpfs "@PREFIX@/run"; then | rm -rf /run/openrc | ||||||
| 	for x in "@PREFIX@/run/."* "@PREFIX@/run/"*; do |  | ||||||
| 		case "$x" in |  | ||||||
| 			"@PREFIX@/run/."|"@PREFIX@/run/..") |  | ||||||
| 				continue |  | ||||||
| 				;; |  | ||||||
| 		esac |  | ||||||
| 		if [ -e "$x" ]; then |  | ||||||
| 				eerror "Your '@PREFIX@/run' directory contains files." |  | ||||||
| 				eerror "Please reboot the system." |  | ||||||
| 				exit 1 |  | ||||||
| 		fi |  | ||||||
| 	done |  | ||||||
|  |  | ||||||
| 	mount -t tmpfs -o mode=0755,nosuid,nodev \ | if ! mountinfo -q -f tmpfs /run; then | ||||||
| 		tmpfs "@PREFIX@/run" 2> /dev/null | 	ln -s "@LIBEXECDIR@"/init.d /run/openrc | ||||||
| 	if [ $? != 0 ]; then | else | ||||||
| 		eerror "Unable to mount a tmpfs on '@PREFIX@/run'." | 	cp -a "@LIBEXECDIR@/init.d" /run/openrc | ||||||
| 		eerror "This means the OpenRC dependency data cannot be migrated." | 	rc-update -u | ||||||
| 		eerror "Please create the '@PREFIX@/run' directory and reboot the system." |  | ||||||
| 		exit 1 |  | ||||||
| 	fi |  | ||||||
| fi | fi | ||||||
|  |  | ||||||
| rm -rf "@PREFIX@/run/openrc" |  | ||||||
| cp -a "@LIBEXECDIR@/init.d" "@PREFIX@/run/openrc" |  | ||||||
| rc-update -u |  | ||||||
| rm -rf "@LIBEXECDIR@/init.d" |  | ||||||
| umount "@LIBEXECDIR@/init.d" |  | ||||||
| einfo "The OpenRC dependency data was migrated successfully." | einfo "The OpenRC dependency data was migrated successfully." | ||||||
| exit 0 | exit 0 | ||||||
|   | |||||||
| @@ -61,7 +61,7 @@ _f() { | |||||||
|  |  | ||||||
| 	if [ ! -e "$path" ]; then | 	if [ ! -e "$path" ]; then | ||||||
| 		dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" | 		dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" | ||||||
| 		[ -n "$arg" ] && _w "$@" | 		[ -z "$arg" ] || _w "$@" | ||||||
| 	fi | 	fi | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -72,7 +72,7 @@ _F() { | |||||||
| 	[ $CREATE -gt 0 ] || return 0 | 	[ $CREATE -gt 0 ] || return 0 | ||||||
|  |  | ||||||
| 	dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" | 	dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" | ||||||
| 	[ -n "$arg" ] && _w "$@" | 	[ -z "$arg" ] || _w "$@" | ||||||
| } | } | ||||||
|  |  | ||||||
| _d() { | _d() { | ||||||
| @@ -201,6 +201,7 @@ tmpfiles_d='' | |||||||
| # `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf' | # `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf' | ||||||
| for d in ${tmpfiles_dirs} ; do | for d in ${tmpfiles_dirs} ; do | ||||||
| 	[ -d $d ] && for f in ${d}/*.conf ; do | 	[ -d $d ] && for f in ${d}/*.conf ; do | ||||||
|  | 		[ "$f" = "$d/systemd.conf" ] && continue | ||||||
| 		[ -f $f ] && tmpfiles_basenames="${tmpfiles_basenames}\n${f##*/}" | 		[ -f $f ] && tmpfiles_basenames="${tmpfiles_basenames}\n${f##*/}" | ||||||
| 	done # for f in ${d} | 	done # for f in ${d} | ||||||
| done # for d in ${tmpfiles_dirs} | done # for d in ${tmpfiles_dirs} | ||||||
| @@ -231,7 +232,7 @@ if [ $(( CLEAN )) -eq 1 ] ; then | |||||||
| 	exit 1 | 	exit 1 | ||||||
| fi | fi | ||||||
|  |  | ||||||
| if [ $(( CREATE + REMOVE )) -ne 1 ] ; then | if [ "$CREATE$REMOVE" = '00' ]; then | ||||||
| 	printf 'usage: %s [--create] [--remove] [--clean] [--verbose] [--dry-run]\n' "${0##*/}" | 	printf 'usage: %s [--create] [--remove] [--clean] [--verbose] [--dry-run]\n' "${0##*/}" | ||||||
| 	exit 1 | 	exit 1 | ||||||
| fi | fi | ||||||
| @@ -252,46 +253,34 @@ for FILE in $tmpfiles_d ; do | |||||||
|  |  | ||||||
| 	# XXX: Upstream says whitespace is NOT permitted in the Path argument. | 	# XXX: Upstream says whitespace is NOT permitted in the Path argument. | ||||||
| 	# But IS allowed when globs are expanded for the x/r/R/z/Z types. | 	# But IS allowed when globs are expanded for the x/r/R/z/Z types. | ||||||
| 	while read line; do | 	while read cmd path mode uid gid age arg; do | ||||||
| 		LINENUM=$(( LINENUM+1 )) | 		LINENUM=$(( LINENUM+1 )) | ||||||
|  |  | ||||||
| 		# This will skip over comments and empty lines |  | ||||||
| 		set -- $line |  | ||||||
|  |  | ||||||
| 		# Unless we have both command and path, skip this line. | 		# Unless we have both command and path, skip this line. | ||||||
| 		if [ -z "$1" -o -z "$2" ]; then | 		if [ -z "$cmd" -o -z "$path" ]; then | ||||||
| 			continue | 			continue | ||||||
| 		fi | 		fi | ||||||
|  |  | ||||||
| 		# whine about invalid entries | 		# whine about invalid entries | ||||||
| 		case $1 in | 		case $cmd in | ||||||
| 			f|F|w|d|D|p|L|c|b|x|r|R|z|Z) ;; | 			f|F|w|d|D|p|L|c|b|x|r|R|z|Z) ;; | ||||||
| 			\#) continue ;; | 			\#) continue ;; | ||||||
| 			*) warninvalid ; continue ;; | 			*) warninvalid ; continue ;; | ||||||
| 		esac | 		esac | ||||||
|  |  | ||||||
| 		cmd=$1 |  | ||||||
| 		path=$2 |  | ||||||
|  |  | ||||||
| 		# fall back on defaults when parameters are passed as '-' | 		# fall back on defaults when parameters are passed as '-' | ||||||
| 		if [ "$3" = '-' -o "$3" = '' ]; then | 		if [ "$mode" = '-' -o "$mode" = '' ]; then | ||||||
| 			case ${1} in | 			case "$cmd" in | ||||||
| 				p|f|F) mode=0644 ;; | 				p|f|F) mode=0644 ;; | ||||||
| 				d|D) mode=0755 ;; | 				d|D) mode=0755 ;; | ||||||
| 				z|Z|x|r|R|L) ;; | 				z|Z|x|r|R|L) ;; | ||||||
| 			esac | 			esac | ||||||
| 		else |  | ||||||
| 			mode=$3 |  | ||||||
| 		fi | 		fi | ||||||
| 		uid=$4 |  | ||||||
| 		gid=$5 |  | ||||||
| 		age=$6 |  | ||||||
| 		arg=$7 |  | ||||||
|  |  | ||||||
| 		[ "${4}" = '-' -o "${4}" = '' ] && uid=0 | 		[ "$uid" = '-' -o "$uid" = '' ] && uid=0 | ||||||
| 		[ "${5}" = '-' -o "${5}" = '' ] && gid=0 | 		[ "$gid" = '-' -o "$gid" = '' ] && gid=0 | ||||||
| 		[ "${6}" = '-' -o "${6}" = '' ] && age=0 | 		[ "$age" = '-' -o "$age" = '' ] && age=0 | ||||||
| 		[ "${7}" = '-' -o "${7}" = '' ] && arg='' | 		[ "$arg" = '-' -o "$arg" = '' ] && arg='' | ||||||
| 		set -- "$path" "$mode" "$uid" "$gid" "$age" "$arg" | 		set -- "$path" "$mode" "$uid" "$gid" "$age" "$arg" | ||||||
|  |  | ||||||
| 		[ "$VERBOSE" -eq "1" ] && echo _$cmd "$@" | 		[ "$VERBOSE" -eq "1" ] && echo _$cmd "$@" | ||||||
|   | |||||||
| @@ -40,7 +40,7 @@ __BEGIN_DECLS | |||||||
| #if defined(PREFIX) | #if defined(PREFIX) | ||||||
| #define RC_SVCDIR               RC_LIBEXECDIR "/init.d" | #define RC_SVCDIR               RC_LIBEXECDIR "/init.d" | ||||||
| #elif defined(__linux__) | #elif defined(__linux__) | ||||||
| #define RC_SVCDIR               "@PREFIX@/run/openrc" | #define RC_SVCDIR               "/run/openrc" | ||||||
| #else | #else | ||||||
| #define RC_SVCDIR               RC_LIBEXECDIR "/init.d" | #define RC_SVCDIR               RC_LIBEXECDIR "/init.d" | ||||||
| #endif | #endif | ||||||
|   | |||||||
| @@ -133,7 +133,7 @@ do_check(char *path, uid_t uid, gid_t gid, mode_t mode, inode_t type, | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (mode && (st.st_mode & 0777) != mode) { | 	if (mode && (st.st_mode & 0777) != mode) { | ||||||
| 		einfo("%s: correcting mode", applet); | 		einfo("%s: correcting mode", path); | ||||||
| 		if (chmod(path, mode)) { | 		if (chmod(path, mode)) { | ||||||
| 			eerror("%s: chmod: %s", applet, strerror(errno)); | 			eerror("%s: chmod: %s", applet, strerror(errno)); | ||||||
| 			return -1; | 			return -1; | ||||||
|   | |||||||
| @@ -390,11 +390,8 @@ mountinfo(int argc, char **argv) | |||||||
| 	char real_path[PATH_MAX + 1]; | 	char real_path[PATH_MAX + 1]; | ||||||
| 	int opt; | 	int opt; | ||||||
| 	int result; | 	int result; | ||||||
| 	bool quiet; |  | ||||||
| 	char *this_path; | 	char *this_path; | ||||||
|  |  | ||||||
| 	quiet = rc_yesno(getenv("EINFO_QUIET")); |  | ||||||
|  |  | ||||||
| #define DO_REG(_var)							      \ | #define DO_REG(_var)							      \ | ||||||
| 	if (_var) free(_var);						      \ | 	if (_var) free(_var);						      \ | ||||||
| 	_var = get_regex(optarg); | 	_var = get_regex(optarg); | ||||||
| @@ -483,7 +480,7 @@ mountinfo(int argc, char **argv) | |||||||
| 		if (skip_point_regex && | 		if (skip_point_regex && | ||||||
| 		    regexec(skip_point_regex, s->value, 0, NULL, 0) == 0) | 		    regexec(skip_point_regex, s->value, 0, NULL, 0) == 0) | ||||||
| 			continue; | 			continue; | ||||||
| 		if (! quiet) | 		if (! rc_yesno(getenv("EINFO_QUIET"))) | ||||||
| 			printf("%s\n", s->value); | 			printf("%s\n", s->value); | ||||||
| 		result = EXIT_SUCCESS; | 		result = EXIT_SUCCESS; | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user