1

upstartに問題があり、開始できますが、実行すると

sudo stop up

ハングします

これは.confファイルです

# my upstart django script
# this script will start/stop my django development server
# optional stuff
description "start and stop the django development server"
version "1.0"
author "Calum"

console log

# configuration variables.
# You'll want to change thse as needed
env DJANGO_HOME=/home/calum/django/django-nexus7/nexus7
env DJANGO_PORT=8000
env DJANGO_HOST=0.0.0.0 # bind to all interfaces

# tell upstart we're creating a daemon
# upstart manages PID creation for you.
expect fork

script
# My startup script, plain old shell scripting here.
chdir $DJANGO_HOME
pwd
exec /usr/bin/python manage.py run_gunicorn -c config/gunicorn
#exec /usr/bin/python manage.py runserver $DJANGO_HOST:$DJANGO_PORT &
# create a custom event in case we want to chain later
emit django_running
end script

誰かが私にそれがハングする理由のアイデアを与えることができれば本当に感謝しますか?

4

1 に答える 1

4

私はそれを理解したと思います、または少なくとも何かを使用して動作しています。

# my upstart django script
# this script will start/stop my django development server
# optional stuff
description "start and stop the django development server"
version "1.0"
author "Calum"

console log

# configuration variables.
# You'll want to change thse as needed
env DJANGO_HOME=/home/calum/django/django-nexus7/nexus7
env DJANGO_PORT=8000
env DJANGO_HOST=0.0.0.0 # bind to all interfaces

# tell upstart we're creating a daemon
# upstart manages PID creation for you.
#expect fork

script
# My startup script, plain old shell scripting here.
chdir $DJANGO_HOME
/usr/bin/python manage.py run_gunicorn -c config/gunicorn
end script

他の人を助けるかもしれないことを私が学んだこと:

  • スクリプトタグ内でexecを使用しないでください。シェル内にいるかのようにコーディングしてください。
  • 一度フォークする場合はexpectフォークを使用してください
  • 2回フォークする場合は、expectデーモンを使用します
于 2013-01-31T01:02:20.127 に答える