today), but this requires kernel recompilation. If possible, sysctl(8)
knobs should be provided to permit to change this default value instead. If
this worked, init(8) would not need to be modified.
+ I implemented a small rc.d script which might do the trick (to be tested).
+ If this works, ideally /etc/defaults/rc.conf should include rlimit=YES and
+ new systems should come with an /etc/rlimit.conf file.
+#!/bin/sh
+#
+# $Id: netbsd_improvements.txt,v 1.47 2015/07/22 13:46:08 mmondor Exp $
+#
+
+# PROVIDE: rlimit
+# BEFORE: wdogctl
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="rlimit"
+rcvar=$name
+conf=/etc/rlimit.conf
+
+start_cmd="rlimit_start"
+stop_cmd=":"
+status_cmd="rlimit_status"
+
+extra_commands="status"
+
+rlimit_start()
+{
+ echo "Configuring init(8) rlimits."
+ if [ -f "$conf" ]; then
+ cat $conf | while read l; do
+ /sbin/sysctl -w proc.1.rlimit.${l}
+ done
+ else
+ echo "Warning: $rcvar enabled but $conf missing."
+ fi
+}
+
+rlimit_status()
+{
+ /sbin/sysctl proc.1.rlimit | /usr/bin/sed 's/proc.1.rlimit.//g'
+}
+
+load_rc_config $name
+run_rc_command "$1"
+
- csh(1) will reach the heap limit if given the following command:
"yes `yes maybe`" and similar.