这是我的 systemd 单元文件(几乎相同,用于运行 Meteor webservice,并且可以正常工作):
[Unit]
Description=SomeService
[Service]
ExecStart=/opt/myapp/app
WorkingDirectory=/opt/myapp
[Install]
这是 systemd 日志(使用系统启动和手动重启服务时都是相同的):
● someservice.service - SomeService
Loaded: loaded (/etc/systemd/system/multi-user.target.wants/someservice.service)
Active: failed (Result: signal) since sat 2017-03-04 14:54:29 CET; 1s ago
Process: 1543 ExecStart=/opt/myapp/app (code=killed, signal=ABRT)
Main PID: 1543 (code=killed, signal=ABRT)
mar 04 14:54:29 somehostname systemd[1]: Started SomeService.
mar 04 14:54:29 somehostname someservice[1543]: Unable to connect daemon to port: 3501
mar 04 14:54:29 somehostname someservice[1543]: terminate called after throwing an instance of 'httpserver::webserver_exception'
mar 04 14:54:29 somehostname someservice[1543]: what(): httpserver runtime error
mar 04 14:54:29 somehostname systemd[1]: someservice.service: main process exited, code=killed, status=6/ABRT
mar 04 14:54:29 somehostname systemd[1]: Unit someservice.service entered failed state.
该端口肯定未使用,更改端口或使用 /bin/bash -c "sleep 5;/opt/myapp/app" 之类的技巧或以 root 身份运行(没有用户指令)都无济于事。我还应该提到,我正在尝试在 systemd-nspawn 容器中运行它。容器外部和内部:最新的 Debian Jessie(稳定版)。有人可以帮忙吗?