服务设置自动重启
使用systemctl管理服务,如kibana
设置自动重启的参数 StartLimitIntervalSec=0 Restart=always
RestartSec=1
#vim /etc/systemd/system/kibana.service[Unit]Description=Kibana[Service]Type=simpleUser=kibanaGroup=kibana# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.# Prefixing the path with '-' makes it try to load, but if the file doesn't# exist, it continues onward.EnvironmentFile=-/etc/default/kibanaEnvironmentFile=-/etc/sysconfig/kibanaExecStart=/usr/share/kibana/bin/kibana "-c /etc/kibana/kibana.yml"Restart=alwaysStartLimitIntervalSec=0RestartSec=1WorkingDirectory=/[Install]WantedBy=multi-user.target
使用supervisord设置自动重启,如ardb
#cat /etc/supervisord/conf.d/ardb.conf[program:ardb]directory=/opt/db/ardbcommand=/opt/db/ardb/src/ardb-server /opt/db/ardb/ardb.confnumprocs=1user=rootautostart=trueautorestart=trueredirect_stderr=truestdout_logfile=/opt/db/ardb/log/ardb-server.logstdout_logfile_maxbytes=200MBstdout_logfile_backups=20
