#!/bin/bash
cat >/tmp/blbs.service <<EOL
[Unit]
Description=Open Java blbs Service
After=network.target
[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
ExecStart=/opt/jdk1.8.0_281/bin/java -jar /app/bl_jar/ruoyi-blbs.jar --spring.profiles.active=node1
ExecStop=/usr/bin/kill -15 $MAINPID
WorkingDirectory=/app/bl_jar
[Install]
WantedBy=multi-user.target
EOL
sudo mv /tmp/blbs.service /lib/systemd/system/blbs.service
echo "[*] Starting blbs systemd service"
sudo systemctl daemon-reload
sudo systemctl enable blbs.service
sudo systemctl is-enabled blbs.service
sudo systemctl restart blbs.service
#sudo systemctl start blbs.service
sudo systemctl status blbs.service
网友评论