我是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