Compare commits
	
		
			15 Commits
		
	
	
		
			openrc-0.1
			...
			openrc-0.1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 0884271bdd | ||
|   | f837107ca5 | ||
|   | 9c4582fbd7 | ||
|   | ccb068c484 | ||
|   | 603a308c6a | ||
|   | fba6bbb4b6 | ||
|   | ded282f163 | ||
|   | 38ae822077 | ||
|   | 611ed42044 | ||
|   | 3f719bbb8b | ||
|   | e37b84a37d | ||
|   | 9fdee75936 | ||
|   | dd261a2a54 | ||
|   | b36ef234be | ||
|   | a2c3660b87 | 
| @@ -1,3 +1,3 @@ | ||||
| NAME=		openrc | ||||
| VERSION=	0.11.4 | ||||
| VERSION=	0.11.8 | ||||
| PKG=		${NAME}-${VERSION} | ||||
|   | ||||
| @@ -1,20 +1,40 @@ | ||||
| # Depending on how mounting your network file systems behaves when your | ||||
| # network interfaces are down, you may need to set the netmount script to | ||||
| # require  specific network interfaces to be active. This file gives | ||||
| # examples of how to do this: | ||||
| # 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. | ||||
| # | ||||
| # If you are using newnet and configuring the interface with a static | ||||
| # address with the network script: | ||||
| # rc_need="network" | ||||
| # 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: | ||||
| # need. | ||||
| # | ||||
| # rc_need="net.eth0" | ||||
| # rc_need="net.eth1 net.eth2" | ||||
| # 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, etc, you should list that tool here. | ||||
| # 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="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" | ||||
|   | ||||
| @@ -1137,6 +1137,13 @@ | ||||
| # 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" | ||||
|  | ||||
| #----------------------------------------------------------------------------- | ||||
| # 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 | ||||
| # | ||||
|   | ||||
| @@ -21,7 +21,7 @@ | ||||
| rc_tty_number=12 | ||||
|  | ||||
| # 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. | ||||
| # 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 | ||||
|   | ||||
| @@ -22,6 +22,9 @@ start() | ||||
|  | ||||
| 	if [ "$RC_UNAME" = Linux ]; then | ||||
| 		no_netdev="-O no_netdev" | ||||
| 		if mountinfo -q /usr; then | ||||
| 			touch $RC_SVCDIR/usr_premounted | ||||
| 		fi | ||||
| 	fi | ||||
| 	ebegin "Mounting local filesystems" | ||||
| 	mount -at "$types" $no_netdev | ||||
| @@ -48,7 +51,10 @@ stop() | ||||
| 	done | ||||
|  | ||||
| 	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 | ||||
| 	no_umounts_r="^($no_umounts_r)$" | ||||
|  | ||||
|   | ||||
| @@ -13,7 +13,7 @@ SRCS-Linux=	iwconfig.sh.in | ||||
| 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 \ | ||||
| 		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= | ||||
| 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 | ||||
| } | ||||
| @@ -51,6 +51,10 @@ if [ ! -d /run ]; then | ||||
| 	fi | ||||
| fi | ||||
|  | ||||
| if [ -L /run/openrc ]; then | ||||
| 	rm /run/openrc | ||||
| fi | ||||
|  | ||||
| if [ "$sys" = VSERVER ]; then | ||||
| 	rm -rf /run/* | ||||
| elif ! mountinfo -q /run; then | ||||
|   | ||||
| @@ -9,41 +9,21 @@ if ! mountinfo -q -f tmpfs "@LIBEXECDIR@/init.d"; then | ||||
| 	exit 0 | ||||
| fi | ||||
|  | ||||
| if [ ! -d "@PREFIX@/run" ]; then | ||||
| 	eerror "'@PREFIX@/run' is not a directory." | ||||
| 	eerror "This means the OpenRC dependency data cannot be migrated." | ||||
| 	eerror "Please create the '@PREFIX@/run' directory and reboot the system." | ||||
| 	exit 1 | ||||
| if [ ! -d /run ]; then | ||||
| 	eerror "/run is not a directory." | ||||
| 	eerror "moving /run to /run.pre-openrc" | ||||
| 	mv /run /run.pre-openrc | ||||
| 	mkdir /run | ||||
| fi | ||||
|  | ||||
| if ! mountinfo -q -f tmpfs "@PREFIX@/run"; then | ||||
| 	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 | ||||
| rm -rf /run/openrc | ||||
|  | ||||
| 	mount -t tmpfs -o mode=0755,nosuid,nodev \ | ||||
| 		tmpfs "@PREFIX@/run" 2> /dev/null | ||||
| 	if [ $? != 0 ]; then | ||||
| 		eerror "Unable to mount a tmpfs on '@PREFIX@/run'." | ||||
| 		eerror "This means the OpenRC dependency data cannot be migrated." | ||||
| 		eerror "Please create the '@PREFIX@/run' directory and reboot the system." | ||||
| 		exit 1 | ||||
| 	fi | ||||
| if ! mountinfo -q -f tmpfs /run; then | ||||
| 	ln -s "@LIBEXECDIR@"/init.d /run/openrc | ||||
| else | ||||
| 	cp -a "@LIBEXECDIR@/init.d" /run/openrc | ||||
| 	rc-update -u | ||||
| 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." | ||||
| exit 0 | ||||
|   | ||||
| @@ -232,7 +232,7 @@ if [ $(( CLEAN )) -eq 1 ] ; then | ||||
| 	exit 1 | ||||
| fi | ||||
|  | ||||
| if [ "$CREATE$REMOVE" == '00' ]; then | ||||
| if [ "$CREATE$REMOVE" = '00' ]; then | ||||
| 	printf 'usage: %s [--create] [--remove] [--clean] [--verbose] [--dry-run]\n' "${0##*/}" | ||||
| 	exit 1 | ||||
| fi | ||||
|   | ||||
| @@ -40,7 +40,7 @@ __BEGIN_DECLS | ||||
| #if defined(PREFIX) | ||||
| #define RC_SVCDIR               RC_LIBEXECDIR "/init.d" | ||||
| #elif defined(__linux__) | ||||
| #define RC_SVCDIR               "@PREFIX@/run/openrc" | ||||
| #define RC_SVCDIR               "/run/openrc" | ||||
| #else | ||||
| #define RC_SVCDIR               RC_LIBEXECDIR "/init.d" | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user