【发布时间】:2016-04-09 10:57:09
【问题描述】:
我创建了一个 systemd 服务,它应该在启动或重启时调用一个 shell 脚本。
[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 服务文件) -
我在这里得到了答案:superuser.com/questions/1022142/… 解决了这个问题