无法在Ubuntu 16.04中重启Unicorn

时间:2017-07-03 12:02:58

标签: ruby-on-rails ubuntu unicorn systemd

我正在尝试将我的新rails应用程序部署到Ubuntu 16.04 Digital Ocean Server。 Unicorn通过systemd进行管理。这是我的 /etc/systemd/system/unicorn.service 文件

[Unit]
Description=Skreem Application
Before=nginx.service
Requires=network.target

[Service]
Type=simple
User=rails
Group=rails

RuntimeDirectory=DigitalOceanOneClick
SyslogIdentifier=DigitalOceanRailsOneClick

# Go paranoid
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
ProtectKernelTunables=true
NoNewPrivileges=true

WorkingDirectory=/home/rails/skreem-ror
ExecStart=/bin/bash /home/rails/skreem-ror/.unicorn.sh              

TimeoutSec=60s
RestartSec=10s
Restart=always

[Install]
WantedBy=multi-user.target

当我尝试重启unicorn服务时,我收到以下错误

Failed to restart unicorn.service: Unit unicorn.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status unicorn.service' for details.

然后我尝试systemctl status unicorn.service并获得

Jul 03 10:05:06 skreem-dev2 systemd[1]: unicorn.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 10:05:06 skreem-dev2 systemd[1]: unicorn.service: Unit entered failed state.
Jul 03 10:05:06 skreem-dev2 systemd[1]: unicorn.service: Failed with result 'exit-code'.
Jul 03 10:05:07 skreem-dev2 systemd[1]: [/etc/systemd/system/unicorn.service:18] Unknown lvalue 'ProtectKernelTunables' in section 'Service'
Jul 03 10:05:07 skreem-dev2 systemd[1]: [/etc/systemd/system/unicorn.service:32] Missing '='.
Jul 03 10:05:16 skreem-dev2 systemd[1]: unicorn.service: Service hold-off time over, scheduling restart.
Jul 03 10:05:16 skreem-dev2 systemd[1]: unicorn.service: Failed to schedule restart job: Unit unicorn.service is not loaded properly: Invalid a
Jul 03 10:05:16 skreem-dev2 systemd[1]: unicorn.service: Unit entered failed state.
Jul 03 10:05:16 skreem-dev2 systemd[1]: unicorn.service: Failed with result 'resources'.
Jul 03 11:33:51 skreem-dev2 systemd[1]: Stopped DigitalOcean Rails One-Click Application.

它不是来自我更新的unicorn.service文件。是因为我的更改未正确加载。请帮我解决这个问题。

0 个答案:

没有答案