procps/boot.sysctl

64 lines
1.4 KiB
Plaintext
Raw Normal View History

#! /bin/sh
#
# Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
#
# /etc/init.d/boot.sysctl
#
### BEGIN INIT INFO
# Provides: boot.sysctl
# Required-Start: boot.proc $local_fs
# Should-Start: setserial boot.isapnp
# Required-Stop: boot.proc $local_fs
# Should-Stop: $null
# Default-Start: B
# Default-Stop:
# Description: run sysctl with a given config file or create it
### END INIT INFO
test -x /sbin/sysctl || exit 0
. /etc/rc.status
. /etc/sysconfig/sysctl
rc_reset
case "$1" in
start)
# Load per-kernel defaults from /boot. This file is provided
# by the kernel package and will be replaced on update.
if test -e "/boot/sysctl.conf-$(uname -r)"; then
echo -n "Loading sysctl defaults from /boot/sysctl.conf-$(uname -r)"
sysctl -e -q -p /boot/sysctl.conf-$(uname -r)
rc_status -v -r
fi
#
# run sysctl if the config file exists
# otherwise generate it
# the values set here might be overridden by the settings
# in /etc/sysconfig/sysctl
#
if test ! -e /etc/sysctl.conf ; then
echo -n "Sysctl: no file /etc/sysctl.conf"
rc_failed 5
else
echo -n "Setting current sysctl status from /etc/sysctl.conf"
sysctl -e -q -p /etc/sysctl.conf
fi
rc_status -v -r
;;
stop)
# skip / do nothing
;;
status)
rc_failed 4
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 1
;;
esac
rc_exit