diff options
Diffstat (limited to 'libexec/rc/rc.d/rctl')
-rwxr-xr-x | libexec/rc/rc.d/rctl | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/libexec/rc/rc.d/rctl b/libexec/rc/rc.d/rctl new file mode 100755 index 000000000000..96c148e78bcd --- /dev/null +++ b/libexec/rc/rc.d/rctl @@ -0,0 +1,45 @@ +#!/bin/sh +# +# + +# PROVIDE: rctl +# REQUIRE: FILESYSTEMS +# BEFORE: LOGIN +# KEYWORD: nojail + +. /etc/rc.subr + +name="rctl" +desc="Manage resource limits" +rcvar="rctl_enable" +start_cmd="rctl_start" +stop_cmd="rctl_stop" + +rctl_start() +{ + if [ -f ${rctl_rules} ]; then + while read var comments + do + case ${var} in + \#*|'') + ;; + *) + echo "${var}" + ;; + esac + done < ${rctl_rules} | xargs rctl -a + fi +} + +rctl_stop() +{ + + rctl -r : +} + +load_rc_config $name + +# doesn't make sense to run in a svcj: config setting +rctl_svcj="NO" + +run_rc_command "$1" |