2011-03-30 18:32:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: rctl
|
|
|
|
# BEFORE: LOGIN
|
|
|
|
# KEYWORD: nojail
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="rctl"
|
2016-04-23 16:10:54 +00:00
|
|
|
desc="Manage resource limits"
|
2015-08-05 17:38:02 +00:00
|
|
|
rcvar="rctl_enable"
|
2011-03-30 18:32:45 +00:00
|
|
|
start_cmd="rctl_start"
|
|
|
|
stop_cmd="rctl_stop"
|
|
|
|
|
|
|
|
rctl_start()
|
|
|
|
{
|
2014-02-15 14:50:47 +00:00
|
|
|
if [ -f ${rctl_rules} ]; then
|
2011-03-30 18:32:45 +00:00
|
|
|
while read var comments
|
|
|
|
do
|
|
|
|
case ${var} in
|
|
|
|
\#*|'')
|
|
|
|
;;
|
|
|
|
*)
|
2015-12-01 16:42:39 +00:00
|
|
|
echo "${var}"
|
2011-03-30 18:32:45 +00:00
|
|
|
;;
|
|
|
|
esac
|
2015-12-01 16:42:39 +00:00
|
|
|
done < ${rctl_rules} | xargs rctl -a
|
2011-03-30 18:32:45 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
rctl_stop()
|
|
|
|
{
|
|
|
|
|
|
|
|
rctl -r :
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|