客户名称是siar,unroot这是我的想法:
sudo mkdir -p /usr/lib/systemd/system
sudo vim /usr/lib/systemd/system/siar.service
及其背景:
[Unit]
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
User=siar
WorkingDirectory=/home/siar/sites/django-blog-learning/blogproject
ExecStart=/home/siar/sites/env/bin/gunicorn --bind unix:/tmp/siar.socket blogproject.wsgi:application
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo systemctl start siar
在这里我得到错误:
Failed to start siar.service: Launch helper exited with unknown return code 1
See system logs and 'systemctl status siar.service' for details.
cat /var/log/syslog
我发现错误:
Dec 4 23:43:33 iZwz92ma406e6d08vhkwqmZ dbus[305]: [system] Activating service name='org.freedesktop.systemd1' (using servicehelper)
Dec 4 23:43:33 iZwz92ma406e6d08vhkwqmZ dbus[305]: [system] Activated service 'org.freedesktop.systemd1' failed: Launch helper exited with unknown return code 1
systemctl status siar.service
结果是
Failed to get properties: Launch helper exited with unknown return code 1
我不知道它是什么意思
chmod 777 /usr/lib/systemd/system
什么都没发生
现在,我可以使用start
自动完成gunicorn工作,但命令systemctl
仍无法启动siar.service