# 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
 
 unset MGMT_VCONNS
 unset COMMANDS
 unset DAEMON_OPTS
+unset CORE_LIMIT
 default=/etc/default/openflow-switch
 if [ -f $default ] ; then
        . $default
             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 \