CentOS7中Java应用配置成服务

/usr/lib/systemd/system/meteor.service
[Unit]
Description=This is a service.
After=network.target

[Service]
Type=forking
User=root
WorkingDirectory=/usr/local/kyubi/kyubi_main
Restart=on-failure
# 重启间隔,服务异常退出后,等待多少秒再启动
RestartSec=30s
# 限制启动间隔,当为0时,表示不限重启次数
StartLimitInterval=0
RestartPreventExitStatus=SIGKILL
ExecStart=/bin/sh 启动命令
ExecStop=/bin/sh 停止命令

[Install]
WantedBy=multi-user.target