File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -666,11 +666,33 @@ export LC_MESSAGES
666666# Start the server; run as foreground daemon in the background...
667667#
668668
669+ if test " x$VALGRIND " ! = x; then
670+ # Wrap cupsd with Valgrind
671+ WRAPPER=" $VALGRIND "
672+ elif test " x$testtype " = x0; then
673+ # Don't limit run time...
674+ WRAPPER=" "
675+ elif test -x /usr/bin/timeout; then
676+ # Limit run time to 5 minutes
677+ echo " Limiting run time to 5 minutes..."
678+ echo " "
679+
680+ WRAPPER=" /usr/bin/timeout --foreground 5m"
681+ else
682+ # No timeout command, just try limiting CPU time...
683+ echo " Limiting CPU time to 5 minutes (300 seconds):"
684+ echo " limit -t 300"
685+ echo " "
686+
687+ limit -t 300
688+ WRAPPER=" "
689+ fi
690+
669691echo " Starting scheduler:"
670- echo " $runcups $VALGRIND ../scheduler/cupsd -c $BASE /cupsd.conf -f >$BASE /log/debug_log 2>&1 &"
692+ echo " $runcups $WRAPPER ../scheduler/cupsd -c $BASE /cupsd.conf -f >$BASE /log/debug_log 2>&1 &"
671693echo " "
672694
673- $runcups $VALGRIND ../scheduler/cupsd -c $BASE /cupsd.conf -f > $BASE /log/debug_log 2>&1 &
695+ $runcups $WRAPPER ../scheduler/cupsd -c $BASE /cupsd.conf -f > $BASE /log/debug_log 2>&1 &
674696
675697cupsd=$!
676698
You can’t perform that action at this time.
0 commit comments