2013-12-22 02:21:11 +05:30
|
|
|
#!@SBINDIR@/openrc-run
|
2015-12-05 04:22:19 +05:30
|
|
|
# Copyright (c) 2007-2015 The OpenRC Authors.
|
|
|
|
# See the Authors file at the top-level directory of this distribution and
|
2021-12-21 06:37:00 +05:30
|
|
|
# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS
|
2015-12-05 04:22:19 +05:30
|
|
|
#
|
|
|
|
# This file is part of OpenRC. It is subject to the license terms in
|
|
|
|
# the LICENSE file found in the top-level directory of this
|
2021-12-21 06:37:00 +05:30
|
|
|
# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE
|
2015-12-05 04:22:19 +05:30
|
|
|
# This file may not be copied, modified, propagated, or distributed
|
|
|
|
# except according to the terms contained in the LICENSE file.
|
2007-11-20 17:40:32 +05:30
|
|
|
|
2008-01-11 17:43:46 +05:30
|
|
|
depend()
|
|
|
|
{
|
2017-03-16 20:46:39 +05:30
|
|
|
after clock
|
2007-11-20 17:40:32 +05:30
|
|
|
before bootmisc logger
|
2016-07-20 02:26:06 +05:30
|
|
|
keyword -prefix -systemd-nspawn -vserver
|
2007-11-20 17:40:32 +05:30
|
|
|
}
|
|
|
|
|
2016-07-20 02:26:06 +05:30
|
|
|
BSD_sysctl()
|
2008-03-26 15:06:34 +05:30
|
|
|
{
|
|
|
|
[ -e /etc/sysctl.conf ] || return 0
|
2009-11-11 04:10:35 +05:30
|
|
|
local retval=0 var= comments= conf=
|
|
|
|
eindent
|
2017-12-15 01:22:55 +05:30
|
|
|
for conf in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
|
2009-11-11 04:10:35 +05:30
|
|
|
if [ -r "$conf" ]; then
|
|
|
|
vebegin "applying $conf"
|
|
|
|
while read var comments; do
|
|
|
|
case "$var" in
|
|
|
|
""|"#"*) continue;;
|
|
|
|
esac
|
|
|
|
sysctl -w "$var" >/dev/null || retval=1
|
|
|
|
done < "$conf"
|
|
|
|
veend $retval
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
eoutdent
|
2016-07-20 02:26:06 +05:30
|
|
|
return $retval
|
|
|
|
}
|
|
|
|
|
|
|
|
Linux_sysctl()
|
|
|
|
{
|
|
|
|
local quiet
|
|
|
|
yesno $rc_verbose || quiet=-q
|
|
|
|
|
|
|
|
sysctl ${quiet} --system
|
|
|
|
}
|
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
|
|
|
local rc=0
|
|
|
|
|
|
|
|
ebegin "Configuring kernel parameters"
|
2016-07-28 00:39:24 +05:30
|
|
|
case "$RC_UNAME" in
|
2016-07-20 02:26:06 +05:30
|
|
|
*BSD|GNU) BSD_sysctl; rc=$? ;;
|
|
|
|
Linux) Linux_sysctl; rc=$? ;;
|
|
|
|
esac
|
|
|
|
eend $rc "Unable to configure some kernel parameters"
|
2007-11-20 17:40:32 +05:30
|
|
|
}
|