2017-01-30 167 views
1

我试图建立uwsgi服务为/etc/systemd/system/emperor.uwsgi.service设置systemctl为uwsgi

[Unit] 
Description=uWSGI Emperor 
After=syslog.target 

[Service] 
ExecStart=/root/uwsgi/uwsgi --ini /etc/uwsgi/emperor.ini 
# Requires systemd version 211 or newer 
RuntimeDirectory=uwsgi 
Restart=always 
KillSignal=SIGQUIT 
Type=notify 
StandardError=syslog 
NotifyAccess=all 

[Install] 
WantedBy=multi-user.target 

当试图启动它,我收到以下错误:

[email protected]:~$ sudo systemctl start emperor.uwsgi.service 
Job for emperor.uwsgi.service failed because the control process exited with error code. See "systemctl status emperor.uwsgi.service" and "journalctl -xe" for details. 

这是输出当我检查状态:

[email protected]:~$ sudo systemctl status emperor.uwsgi.service 
● emperor.uwsgi.service - uWSGI Emperor 
    Loaded: loaded (/etc/systemd/system/emperor.uwsgi.service; disabled; vendor preset: enabled) 
    Active: inactive (dead) 

Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Stopped uWSGI Emperor. 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Starting uWSGI Emperor... 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Main process exited, code=exited 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Failed to start uWSGI Emperor. 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Unit entered failed state. 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Failed with result 'exit-code'. 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Service hold-off time over, sche 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Stopped uWSGI Emperor. 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Start request repeated too quick 
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Failed to start uWSGI Emperor. 
+0

与所有应有的尊重这是一个编程问题我设置uwsgi与Django一起工作,并在我的调试过程中,我看到它适合安装systemctl,因此我可以启动和停止uwsgi并查看它下面运行的进程 –

回答

0

我有类似的问题。看起来systemd在无法启动(UWSGI)服务时吞下了一些输出。这里有几件事情要检查,找出造成问题的:

  1. 检查systemd杂志:journalctl -b -u $service
  2. 尝试手动运行该服务:只需运行在systemd服务文件ExecStart=之后指定的CMDLINE;所以在你的例子中:/root/uwsgi/uwsgi --ini /etc/uwsgi/emperor.ini

这些都应该说明服务是否无法启动。