Merge pull request #914 from aerickson/scripts_set_priority

scripts: init and default files now specify a process priority.
This commit is contained in:
Gina Häußge 2015-05-28 17:59:27 +02:00
commit 1e65335173
2 changed files with 6 additions and 1 deletions

View file

@ -15,5 +15,9 @@ DAEMON_ARGS="--port=$PORT"
# Umask of files octoprint generates, Change this to 000 if running octoprint as its own, separate user
UMASK=022
# Process priority, 0 here will result in a priority 20 process.
# -2 ensures Octoprint has a slight priority over user processes.
NICELEVEL=-2
# Should we run at startup?
START=yes

View file

@ -73,7 +73,8 @@ do_start()
if [ $RETVAL != 0 ]; then
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
--exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK -- $DAEMON_ARGS
--exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK --nicelevel=$NICELEVEL \
-- $DAEMON_ARGS
RETVAL="$?"
fi
}