我是systemd
的新用戶。剛剛安裝了lubuntu16.04
。
我有以下systemd
文件:Systemd django無法啓動gunicorn
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=jcg
Group=jcg
WorkingDirectory=/home/jcg/venvs/baseball/baseball_stats
ExecStart=/home/jcg/.virtualenvs/baseball/bin/gunicorn -w 3 -b 0.0.0.0:8001 baseball_stats.wsgi
[Install]
WantedBy=multi-user.target
我得到這個錯誤:
[email protected]:/var/log$ systemctl status gunicorn
● gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2016-05-16 13:59:18 EDT; 9min ago
Process: 681 ExecStart=/home/jcg/.virtualenvs/baseball/bin/gunicorn -w 3 -b 0.0.0.0:8001 baseball_stats.wsgi
Main PID: 681 (code=exited, status=200/CHDIR)
May 16 13:59:18 jcg-Inspiron-1011 systemd[1]: Started gunicorn daemon.
May 16 13:59:18 jcg-Inspiron-1011 systemd[1]: gunicorn.service: Main process exited, code=exited, status=200/CH
May 16 13:59:18 jcg-Inspiron-1011 systemd[1]: gunicorn.service: Unit entered failed state.
May 16 13:59:18 jcg-Inspiron-1011 systemd[1]: gunicorn.service: Failed with result 'exit-code'.
但是,如果我運行此gunicorn starts
:
(baseball) [email protected]:~/venvs/baseball/baseball_stats$ /home/jcg/.virtualenvs/baseball/bin/gunicorn -w 3 -b 0.0.0.0:8001 baseball_stats.wsgi
我缺少什麼,或做錯了?
工作目錄似乎並不在腳本和shell命令一樣。我希望這只是一個錯字。 –
好的。我改變了/.venvs到/ venvs但是同樣的問題 –
沒有journalctl給你更多的東西? – e4c5