1. 添加服务
cat >/etc/systemd/system/bigdata_sr_detection.service <<'EOF'
[Unit]
Description=bigdata_sr_detection
After=network.target
[Service]
WorkingDirectory=/webser/bigdata_sr_detection
ExecStart=/usr/bin/java -jar /webser/bigdata_sr_detection/bigdata_sr_detection-1.0-SNAPSHOT.jar
StandardOutput=file:/webser/bigdata_sr_detection/log/bigdata_sr_detection_test.log
StandardError=append:/webser/bigdata_sr_detection/log/bigdata_sr_detection_test.log
[Install]
WantedBy=multi-user.target
EOF
操作服务
systemctl status bigdata_sr_detection
systemctl start bigdata_sr_detection
systemctl stop bigdata_sr_detection
systemctl restart bigdata_sr_detection