Split sysctl into Linux and BSD specific files.
This commit is contained in:
parent
1b40379a79
commit
6af2b20297
@ -1,7 +1,11 @@
|
||||
# Generic BSD scripts
|
||||
SRCS+= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
|
||||
rpcbind.in savecore.in sysctl.in syslogd.in
|
||||
rpcbind.in savecore.in syslogd.in
|
||||
|
||||
# These are FreeBSD specific
|
||||
SRCS+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
|
||||
powerd.in syscons.in
|
||||
|
||||
.SUFFIXES: .BSD.in
|
||||
.BSD.in:
|
||||
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
|
||||
|
@ -1,2 +1,6 @@
|
||||
SRCS+= hwclock.in consolefont.in keymaps.in modules.in mtab.in numlock.in \
|
||||
procfs.in
|
||||
|
||||
.SUFFIXES: .Linux.in
|
||||
.Linux.in:
|
||||
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
|
||||
|
@ -1,6 +1,10 @@
|
||||
# Generic BSD scripts
|
||||
SRCS+= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
|
||||
rpcbind.in savecore.in sysctl.in syslogd.in
|
||||
rpcbind.in savecore.in syslogd.in
|
||||
|
||||
# These are NetBSD specific
|
||||
SRCS+= swap-blk.in ttys.in wscons.in
|
||||
|
||||
.SUFFIXES: .BSD.in
|
||||
.BSD.in:
|
||||
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
|
||||
|
@ -9,29 +9,16 @@ depend()
|
||||
keyword noprefix
|
||||
}
|
||||
|
||||
sysctl_BSD() {
|
||||
start()
|
||||
{
|
||||
[ -e /etc/sysctl.conf ] || return 0
|
||||
local retval=0 var= comments=
|
||||
ebegin "Configuring kernel parameters"
|
||||
while read var comments; do
|
||||
case "${var}" in
|
||||
""|"#"*) continue;;
|
||||
esac
|
||||
sysctl -w "${var}" >/dev/null || retval=1
|
||||
done < /etc/sysctl.conf
|
||||
return ${retval}
|
||||
}
|
||||
|
||||
sysctl_Linux() {
|
||||
sysctl -p >/dev/null
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
[ -e /etc/sysctl.conf ] || return 0
|
||||
|
||||
ebegin "Configuring kernel parameters"
|
||||
case "${RC_UNAME}" in
|
||||
Linux) sysctl_Linux;;
|
||||
*) sysctl_BSD;;
|
||||
esac
|
||||
eend $? "Some errors were encountered"
|
||||
eend ${retval} "Some errors were encountered"
|
||||
}
|
18
init.d/sysctl.Linux.in
Normal file
18
init.d/sysctl.Linux.in
Normal file
@ -0,0 +1,18 @@
|
||||
#!@PREFIX@/sbin/runscript
|
||||
# Copyright 2007-2008 Roy Marples <roy@marples.name>
|
||||
# All rights reserved. Released under the 2-clause BSD license.
|
||||
|
||||
depend()
|
||||
{
|
||||
use hostname
|
||||
before bootmisc logger
|
||||
keyword noprefix
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
[ -e /etc/sysctl.conf ] || return 0
|
||||
ebegin "Configuring kernel parameters"
|
||||
sysctl -p >/dev/null
|
||||
eend $? "Some errors were encountered"
|
||||
}
|
@ -7,4 +7,3 @@ BIN+= ifwatchd-carrier.sh ifwatchd-nocarrier.sh
|
||||
.SUFFIXES: .BSD.sh.in
|
||||
.BSD.sh.in.sh:
|
||||
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user