Ubuntu上で作成しているDjangoアプリがある時に、OS起動時に自動でrunserverさせたいです。
またシャットダウンしたらrunserverも停止するようにしたいです。
こちらのサイトを参考にしてみたのですが、systemctl statusで確認すると以下のようにfialedになっており起動できませんでした。
Failed to determine user credentials: No such process Failed at step USER spawning /usr/local/bin/gunicorn: No such process
Apacheを使えば良い等あるかと思いますが、上記のような要件でrunserverすることはできるのでしょうか?
ご教示いただけますと幸いです。よろしくお願いいたします。
追記
実際に設定したファイルは以下になります。
[Unit] Description=gunicorn daemon After=network.target [Service] WorkingDirectory=/path/to/django/app ExecStart=/usr/local/bin/gunicorn -w 3 -b 127.0.0.1:8000 {djangoappname}.wsgi [Install] WantedBy=multi-user.target
上記のようにファイルを変更したところ、エラーが次のようになりました。
Main process exited, code=exited, status=1/FAILURE Failed with result 'exit-code'.
あなたの回答
tips
プレビュー