Skip to content

Instantly share code, notes, and snippets.

@TavenYin
Created November 5, 2020 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TavenYin/e6753e73732dfcdf9aa92c54206bff74 to your computer and use it in GitHub Desktop.
Save TavenYin/e6753e73732dfcdf9aa92c54206bff74 to your computer and use it in GitHub Desktop.
consumer.service
[Unit]
Description=IRON consumer service
# 网络就绪后执行
After=network.target
[Service]
#
Type=simple
# 当服务进程 正常退出、异常退出、被杀死、超时的时候, 是否重新启动该服务,可选的值包括 always(总是重启)、on-success、on-failure、on-abnormal、on-abort、on-watchdog
Restart=always
# 自动重启当前服务间隔的秒数
RestartSec=1
User=root
# 定义systemctl start的命令
ExecStart=/bin/java -jar /opt/planck/_server/consumer.jar
# systemctl start时执行脚本
#ExecStart=/bin/sh /opt/planck/planck-iron/consumer/script/start.sh
# 定义systemctl start的命令
#ExecStop=XX
# 定义systemctl restart的命令
#ExecReload=XX
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment