diff options
author | Roy Marples <roy@marples.name> | 2008-03-26 09:36:34 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-03-26 09:36:34 +0000 |
commit | 6af2b20297afb9cca88eb4843997c87eb48a5429 (patch) | |
tree | 5716be748b0139abe4421cab3679e0abcebe5915 /init.d | |
parent | 1b40379a79cb96d9ca8fb0d268a73fe7426fbf5c (diff) |
Split sysctl into Linux and BSD specific files.
Diffstat (limited to 'init.d')
-rw-r--r-- | init.d/Makefile.FreeBSD | 6 | ||||
-rw-r--r-- | init.d/Makefile.Linux | 4 | ||||
-rw-r--r-- | init.d/Makefile.NetBSD | 6 | ||||
-rw-r--r-- | init.d/sysctl.BSD.in (renamed from init.d/sysctl.in) | 23 | ||||
-rw-r--r-- | init.d/sysctl.Linux.in | 18 |
5 files changed, 37 insertions, 20 deletions
diff --git a/init.d/Makefile.FreeBSD b/init.d/Makefile.FreeBSD index cca0e004..8bcb9694 100644 --- a/init.d/Makefile.FreeBSD +++ b/init.d/Makefile.FreeBSD @@ -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} $< > $@ diff --git a/init.d/Makefile.Linux b/init.d/Makefile.Linux index f8be1de9..653913cb 100644 --- a/init.d/Makefile.Linux +++ b/init.d/Makefile.Linux @@ -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} $< > $@ diff --git a/init.d/Makefile.NetBSD b/init.d/Makefile.NetBSD index 90832db5..0bf2f657 100644 --- a/init.d/Makefile.NetBSD +++ b/init.d/Makefile.NetBSD @@ -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} $< > $@ diff --git a/init.d/sysctl.in b/init.d/sysctl.BSD.in index fdaf8ee2..6131a0b6 100644 --- a/init.d/sysctl.in +++ b/init.d/sysctl.BSD.in @@ -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" } diff --git a/init.d/sysctl.Linux.in b/init.d/sysctl.Linux.in new file mode 100644 index 00000000..03f48eec --- /dev/null +++ b/init.d/sysctl.Linux.in @@ -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" +} |