我創建了一個systemd服務,它應該在啓動或重啓時調用shell腳本。爲什麼systemd在啓動後立即停止服務?
[Unit]
Description=Starts the DCCA index software
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/opt/insiteone/bin/indexControl start
ExecStop=/opt/insiteone/bin/indexControl stop
# Execute pre and post scripts as root
#PermissionsStartOnly=true
Restart=on-abort
TimeoutSec=600
最初,它不停地只要它開始重新啓動在無限循環,但是當我加入TimeoutSec
選項,它只要服務已啓動首次(開始叫ExecStop
,然後立即再次停止)。
任何線索,我哪裏會出錯? P.S:indexControl是一個shell腳本,它啓動其他進程。
'chkconfig index off'也沒有幫助(index.service是ssystemd服務文件) – kingsmasher1
我在這裏得到了答案:http://superuser.com/questions/1022142/why-is-systemd-stopping -service-immediately-after-it-is-started修復了問題 – kingsmasher1