使用systemctl启动的进程不会抛出错误,但不会出现在进程列表中?


1

Unix新手在这里。我想开始gunicornsystemctl。没有出现错误消息,但它也没有显示在进程列表中:

$ sudo systemctl start gunicorn
$ ps aux | grep gunicorn
test+ 29902  0.0  0.0  14224   924 pts/0    S+   11:13   0:00 grep --color=auto gunicorn

它可能正在运行,但看不见吗?

或者如果没有,我该如何调试它为什么不运行?

更新:刚试过systemctl status gunicorn并得到了这个:

● gunicorn.service - Gunicorn Application Server handling myapp
   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Mon 2016-10-31 11:24:04 EDT; 1min 25s ago
  Process: 30135 ExecStart=/.venv/bin/gunicorn --workers 3 --bind unix:/home/myapp/myapp/myapp.sock myapp.wsgi:application (code=exited, status=200/CHDIR)
 Main PID: 30135 (code=exited, status=200/CHDIR)

它已经死了,但我怎么能找出原因呢?


你试过自己运行吗?,对于journalctl呢?
ryanpattison 2016年

Answers:


1
(code = exited,status = 200 / CHDIR)

您在服务单元中配置的工作目录错误或无法访问。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.