启动 uWSGI 服务后 Systemd 崩溃

启动 uWSGI 服务后 Systemd 崩溃

我最近将虚拟机从 utopic 更新到了 Vivid 15.04。我以前有一个用于 uwsgi 的 init.d 脚本,现在它不再起作用了。

我按照官方文档从这里使用 SystemD 创建了一个 uwsgi 服务守护进程:http://uwsgi-docs.readthedocs.org/en/latest/Systemd.html

这看起来很简单,但是当我运行服务时出现这个错误。

miruka@*****:~$ sudo systemctl start emperor.uwsgi.service
Job for emperor.uwsgi.service failed. See "systemctl status emperor.uwsgi.service" and "journalctl -xe" for details.

我不知道为什么。无论如何,此后,systemctl 崩溃并且无法使用。

sudo systemctl start emperor.uwsgi.service
Failed to get D-Bus connection: Operation not permitted

在 dmesg 中我看到:

[   37.004704] random: nonblocking pool is initialized
[  271.733039] systemd[1]: systemd-journald.service: main process exited, code=dumped, status=6/ABRT
[  271.733378] systemd[1]: Unit systemd-journald.service entered failed state.
[  271.733441] systemd[1]: systemd-journald.service failed.
[  271.733853] systemd[1]: systemd-journald.service has no holdoff time, scheduling restart.
[  271.734283] systemd[1]: Stopping Flush Journal to Persistent Storage...
[  271.735113] systemd[1]: Starting Journal Service...
[  271.792164] systemd-journald[1219]: File /run/log/journal/0d99c9801b8b4ec1a3f5942be02a144c/system.journal corrupted or uncleanly shut down, renaming and replacing.
[  281.300187] systemd[1]: systemd-timesyncd.service watchdog timeout (limit 1min)!
[  281.301408] systemd[1]: systemd-timesyncd.service: main process exited, code=killed, status=6/ABRT
[  281.301672] systemd[1]: Unit systemd-timesyncd.service entered failed state.
[  281.301718] systemd[1]: systemd-timesyncd.service failed.
[  281.303804] systemd[1]: systemd-timesyncd.service has no holdoff time, scheduling restart.
[  281.305369] systemd[1]: Starting Network Time Synchronization...
[  281.330476] systemd[1]: systemd-timesyncd.service: main process exited, code=exited, status=1/FAILURE
[  281.330905] systemd[1]: Failed to start Network Time Synchronization.
[  281.331007] systemd[1]: Unit systemd-timesyncd.service entered failed state.
[  281.331047] systemd[1]: systemd-timesyncd.service failed.
[  281.333299] systemd[1]: systemd-timesyncd.service has no holdoff time, scheduling restart.
[  281.334691] systemd[1]: Starting Network Time Synchronization...
[  281.343251] systemd[1]: systemd-timesyncd.service: main process exited, code=exited, status=1/FAILURE
[  281.343658] systemd[1]: Failed to start Network Time Synchronization.

重新启动可以解决问题,但我仍然无法运行我的服务。有什么想法吗?

答案1

注释掉RuntimeDirectory指令emperor.uwsgi.service对我来说解决了这个问题。我不确定为什么这样可以解决问题,或者这个更改是否会带来任何负面影响。

顺便说一句,通过启用它,emperor.uwsgi.service我能够让它在启动时正常启动,但是停止它会锁定 systemd 并且我不得不强制我的 VM 停止(无法重新启动或停止)然后重新启动它。

相关内容