From: Ben Pfaff Date: Wed, 5 Nov 2008 23:47:44 +0000 (-0800) Subject: Add openflow-switch settings for the limit on core files. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91bdbe0c017a1dbda0128c44b862234ddb85eec2;p=openvswitch Add openflow-switch settings for the limit on core files. --- diff --git a/debian/openflow-switch.default b/debian/openflow-switch.default index f0ef4e05..32761eb1 100644 --- a/debian/openflow-switch.default +++ b/debian/openflow-switch.default @@ -111,3 +111,10 @@ MGMT_VCONNS="punix:/var/run/secchan.socket" # DAEMON_OPTS: Additional options to pass to secchan, e.g. "--fail=open" DAEMON_OPTS="" + +# CORE_LIMIT: Maximum size for core dumps. +# +# Leaving this unset will use the system default. Setting it to 0 +# will disable core dumps. Setting it to "unlimited" will dump all +# core files regardless of size. +#CORE_LIMIT=unlimited diff --git a/debian/openflow-switch.init b/debian/openflow-switch.init index 79dad496..1df4ea0b 100755 --- a/debian/openflow-switch.init +++ b/debian/openflow-switch.init @@ -45,6 +45,7 @@ unset CACERT_MODE unset MGMT_VCONNS unset COMMANDS unset DAEMON_OPTS +unset CORE_LIMIT default=/etc/default/openflow-switch if [ -f $default ] ; then . $default @@ -255,6 +256,10 @@ case "$1" in DAEMON_OPTS="$DAEMON_OPTS --out-of-band" fi + if test -n "$CORE_LIMIT"; then + check_ops "Setting core limit to $CORE_LIMIT" ulimit -c "$CORE_LIMIT" + fi + echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile $PIDFILE \ --exec $DAEMON -- nl:0 $CONTROLLER --detach --pidfile=$PIDFILE \