--- preload-0.6.4.init.in.orig 2009-05-20 04:58:30.000000000 +0200 +++ preload-0.6.4.init.in 2009-12-31 18:19:43.000000000 +0100 @@ -27,19 +27,21 @@ # Check for > MIN_MEMORY MB #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0 - # IMPORTANT: Let ssd do the backgrounding so we immediatly get a valid - # pid file in the next step (ionice) + IONICE=$(which ionice) + if [ -x "$IONICE" ]; then + EXEC="$IONICE" + ARGS=( ${IONICE_OPTS:--c3} "@sbindir@/@PACKAGE@" ) + else + EXEC="@sbindir@/@PACKAGE@" + ARGS=() + fi + start-stop-daemon --start --quiet --background \ --make-pidfile --pidfile ${PIDFILE} \ - --exec @sbindir@/@PACKAGE@ -- \ + --exec "$EXEC" -- "${ARGS[@]}" \ -l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-1} \ -n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""} ${PRELOAD_OPTS} -f - IONICE=$(which ionice) - if [ -x "$IONICE" ]; then - IONICE_OPTS=${IONICE_OPTS:--c3} - $IONICE ${IONICE_OPTS} -p$(<${PIDFILE}) - fi eend $? }