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