0

trying to make my django site as service. Here is the code:

DIR=/home/karonator/pk-akr
DAEMON=$DIR/manage.py

DAEMON_NAME=somename
DAEMON_OPTS="runserver 0.0.0.0:7777"

DAEMON_USER=karonator

PIDFILE=/var/run/$DAEMON_NAME.pid

. /lib/lsb/init-functions

do_start () {
    log_daemon_msg "Starting system $DAEMON_NAME daemon"

    start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --user $DAEMON_USER --chuid $DAEMON_USER --exec /usr/bin/python $DAEMON -- $DAEMON_OPTS
    log_end_msg $?

}

This works but start-stop-daemon spawning two processes:

enter image description here

Any ideas how to fix it? As the result the stop and restart functions not works correctly.

KaronatoR
  • 2,579
  • 4
  • 21
  • 31

1 Answers1

1

Add --noreload to DAEMON_OPTS="runserver 0.0.0.0:7777"

Here is a link explaining --noreload and the auto-reloader process.

Why is run called twice in the Django dev server?

Austin Walker
  • 28
  • 1
  • 6