Lines 27-45
Link Here
|
27 |
# Check for > MIN_MEMORY MB |
27 |
# Check for > MIN_MEMORY MB |
28 |
#free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0 |
28 |
#free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0 |
29 |
|
29 |
|
30 |
# IMPORTANT: Let ssd do the backgrounding so we immediatly get a valid |
30 |
IONICE=$(which ionice) |
31 |
# pid file in the next step (ionice) |
31 |
if [ -x "$IONICE" ]; then |
|
|
32 |
EXEC="$IONICE" |
33 |
ARGS=( "${IONICE_OPTS:--c3}" "@sbindir@/@PACKAGE@" ) |
34 |
else |
35 |
EXEC="@sbindir@/@PACKAGE@" |
36 |
ARGS=() |
37 |
fi |
38 |
|
32 |
start-stop-daemon --start --quiet --background \ |
39 |
start-stop-daemon --start --quiet --background \ |
33 |
--make-pidfile --pidfile ${PIDFILE} \ |
40 |
--make-pidfile --pidfile ${PIDFILE} \ |
34 |
--exec @sbindir@/@PACKAGE@ -- \ |
41 |
--exec "$EXEC" -- "${ARGS[@]}" \ |
35 |
-l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-1} \ |
42 |
-l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-1} \ |
36 |
-n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""} ${PRELOAD_OPTS} -f |
43 |
-n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""} ${PRELOAD_OPTS} -f |
37 |
|
44 |
|
38 |
IONICE=$(which ionice) |
|
|
39 |
if [ -x "$IONICE" ]; then |
40 |
IONICE_OPTS=${IONICE_OPTS:--c3} |
41 |
$IONICE ${IONICE_OPTS} -p$(<${PIDFILE}) |
42 |
fi |
43 |
eend $? |
45 |
eend $? |
44 |
} |
46 |
} |
45 |
|
47 |
|