2006-12-19 00:17:32 +01:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
|
|
|
#
|
|
|
|
# /etc/init.d/boot.sysctl
|
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: boot.sysctl
|
2010-09-21 11:55:14 +02:00
|
|
|
# Required-Start: boot.proc $local_fs
|
2008-08-02 05:29:33 +02:00
|
|
|
# Should-Start: setserial boot.isapnp
|
2010-09-21 11:55:14 +02:00
|
|
|
# Required-Stop: boot.proc $local_fs
|
2008-08-02 05:29:33 +02:00
|
|
|
# Should-Stop: $null
|
2006-12-19 00:17:32 +01:00
|
|
|
# Default-Start: B
|
|
|
|
# Default-Stop:
|
|
|
|
# Description: run sysctl with a given config file or create it
|
|
|
|
### END INIT INFO
|
|
|
|
|
2009-02-09 12:25:17 +01:00
|
|
|
test -x /sbin/sysctl || exit 0
|
|
|
|
|
2006-12-19 00:17:32 +01:00
|
|
|
. /etc/rc.status
|
|
|
|
. /etc/sysconfig/sysctl
|
|
|
|
|
|
|
|
rc_reset
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
#
|
|
|
|
# run sysctl if the config file exists
|
|
|
|
# otherwise generate it
|
|
|
|
# the values set here might be overridden by the settings
|
|
|
|
# in /etc/sysconfig/sysctl
|
|
|
|
#
|
2009-02-09 12:25:17 +01:00
|
|
|
if test ! -e /etc/sysctl.conf ; then
|
2006-12-19 00:17:32 +01:00
|
|
|
echo -n "Sysctl: no file /etc/sysctl.conf"
|
|
|
|
rc_failed 5
|
2009-02-09 12:25:17 +01:00
|
|
|
else
|
|
|
|
echo -n "Setting current sysctl status from /etc/sysctl.conf"
|
|
|
|
sysctl -e -q -p /etc/sysctl.conf
|
2006-12-19 00:17:32 +01:00
|
|
|
fi
|
2009-02-09 12:25:17 +01:00
|
|
|
rc_status -v -r
|
2006-12-19 00:17:32 +01:00
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
# skip / do nothing
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
rc_failed 4
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|status}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
rc_exit
|