xref: /freebsd/libexec/rc/rc.d/rctl (revision d6eb98610fa65663bf0df4574b7cb2c5c4ffda71)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# PROVIDE: rctl
7# BEFORE: LOGIN
8# KEYWORD: nojail
9
10. /etc/rc.subr
11
12name="rctl"
13desc="Manage resource limits"
14rcvar="rctl_enable"
15start_cmd="rctl_start"
16stop_cmd="rctl_stop"
17
18rctl_start()
19{
20	if [ -f ${rctl_rules} ]; then
21		while read var comments
22		do
23			case ${var} in
24			\#*|'')
25				;;
26			*)
27				echo "${var}"
28				;;
29			esac
30		done < ${rctl_rules} | xargs rctl -a
31	fi
32}
33
34rctl_stop()
35{
36
37	rctl -r :
38}
39
40load_rc_config $name
41run_rc_command "$1"
42