
我的 systemd 單元檔案/etc/systemd/system/ei-integrator.service
如下:
[Unit]
Description=Integrator
After=network.target
[Service]
ExecStart=/tmp/ei-6.6.0/bin/integrator.sh start
ExecStop=/tmp/ei-6.6.0/bin/integrator.sh stop
ExecRestart=/tmp/ei-6.6.0/bin/integrator.sh restart
PIDFile=/tmp/ei-6.6.0/pid.pid
User=wso2user
Group=wso2
Type=forking
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
當我嘗試時,systemctl start ei-integrator.service
它給了我以下錯誤:
/etc/systemd/system/ei-integrator.service:8:“服務”部分中未知的鍵名“ExecRestart”,忽略。
有人能幫我嗎?
我在用Ubuntu 20.04.4 LTS
答案1
正確的語法是“ExecReload”。嘗試使用“ExecReload”而不是“ExecRestart”,看看它是否有效。
您可以在以下文件中找到可用的 Exec 命令。 https://www.freedesktop.org/software/systemd/man/systemd.service.html
更多討論可以在這裡: https://github.com/wso2/puppet-ei/issues/70 https://systemd-devel.freedesktop.narkive.com/Ln2Sc9Ot/execrestart