我正在尝试将Spring Boot应用添加到systemctl
,但是当我开始服务时,它失败并显示错误:
进程:7278 ExecStart = / usr / bin / java -jar /home/**/build/libs/roc0.0.1-SNAPSHOT.jar(代码=已退出,状态= 1 /失败) 操作系统 NAME =“ Ubuntu” VERSION =“ 18.04.2 LTS(Bionic Beaver)”
这是服务文件:
[Unit]
Description=Spring MVC Java Service
[Service]
User=denis
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/log/roc
ExecStartPre=/bin/chown -R denis:syslog /var/log/roc
ExecStartPre=/bin/chmod -R 775 /var/log/roc
Environment="ENV=stage"
ExecStart=/usr/bin/java -jar /home/denis/build/libs/roc.jar
SuccessExitStatus=143
StandardOutput=journal
StandardError=journal
KillSignal=SIGINT
TimeoutStopSec=20
Restart=always
RestartSec=5
StartLimitInterval=0
StartLimitBurst=10
LimitNOFILE=500000
LimitNPROC=500000
SyslogIdentifier=lab
[Install]
WantedBy=multi-user.target