我创建了一个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