[Midnightbsd-cvs] src: etc/rc.d: add stop command and fix lowest power profile testing

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jan 17 19:08:33 EST 2009


Log Message:
-----------
add stop command and fix lowest power profile testing

Modified Files:
--------------
    src/etc/rc.d:
        ipnat (r1.2 -> r1.3)
        power_profile (r1.3 -> r1.4)

-------------- next part --------------
Index: power_profile
===================================================================
RCS file: /home/cvs/src/etc/rc.d/power_profile,v
retrieving revision 1.3
retrieving revision 1.4
diff -L etc/rc.d/power_profile -L etc/rc.d/power_profile -u -r1.3 -r1.4
--- etc/rc.d/power_profile
+++ etc/rc.d/power_profile
@@ -16,6 +16,7 @@
 . /etc/rc.subr
 
 name="power_profile"
+stop_cmd=':'
 LOGGER="logger -t power_profile -p daemon.notice"
 
 # Set a given sysctl node to a value.
@@ -77,7 +78,7 @@
 # Set the various sysctls based on the profile's values.
 node="hw.acpi.cpu.cx_lowest"
 highest_value="C1"
-lowest_value="`(sysctl -n hw.acpi.cpu.cx_supported | \
+lowest_value="`(sysctl -n dev.cpu.0.cx_supported | \
 	awk '{ print "C" split($0, a) }' -) 2> /dev/null`"
 eval value=\$${profile}_cx_lowest
 sysctl_set
Index: ipnat
===================================================================
RCS file: /home/cvs/src/etc/rc.d/ipnat,v
retrieving revision 1.2
retrieving revision 1.3
diff -L etc/rc.d/ipnat -L etc/rc.d/ipnat -u -r1.2 -r1.3
--- etc/rc.d/ipnat
+++ etc/rc.d/ipnat
@@ -1,7 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ipnat,v 1.6 2000/09/19 13:04:38 lukem Exp $
-# $FreeBSD: src/etc/rc.d/ipnat,v 1.14 2004/10/07 13:55:26 mtm Exp $
+# $FreeBSD: src/etc/rc.d/ipnat,v 1.15.4.1 2008/01/28 07:58:31 dougb Exp $
 # $MidnightBSD$
 
 # PROVIDE: ipnat
@@ -14,31 +13,15 @@
 name="ipnat"
 rcvar=`set_rcvar`
 load_rc_config $name
-start_precmd="ipnat_precmd"
 start_cmd="ipnat_start"
 stop_cmd="${ipnat_program} -F -C"
 reload_cmd="${ipnat_program} -F -C -f ${ipnat_rules}"
 extra_commands="reload"
-
-ipnat_precmd()
-{
-	# Make sure ipfilter is loaded before continuing
-	if ! ${SYSCTL} net.inet.ipf.fr_pass >/dev/null 2>&1; then
-		if kldload ipl; then
-			info 'IP-filter module loaded.'
-		else
-			err 1 'IP-filter module failed to load.'
-		fi
-	fi
-	return 0
-}
+required_files="${ipnat_rules}"
+required_modules="ipl:ipfilter"
 
 ipnat_start()
 {
-	if [ ! -f ${ipnat_rules} ]; then
-		warn 'NO IPNAT RULES'
-		return 0
-	fi
 	echo "Installing NAT rules."
 	${ipnat_program} -CF -f ${ipnat_rules} ${ipnat_flags}
 }


More information about the Midnightbsd-cvs mailing list