2017-04-23 103 views
1

我跟着spring documentation for creating systemd service爲我的springboot應用程序創建啓動腳本。無法啓動springboot應用程序的systemd服務

僅供參考:我在github上看到this已解決問題,其中指出該問題是許可問題,但對我無效該jar擁有755許可權。

這裏是我的服務描述:

[Unit] 
Description=gs-spring-boot-0.1.0 
After=syslog.target 

[Service] 
ExecStart=/home/user/deploy/gs-spring-boot-0.1.0.jar 
SuccessExitStatus=143 

[Install] 
WantedBy=multi-user.target 

當我試圖啓用這樣的服務:

sudo systemctl enable gs-spring-boot-0.1.0.service 

正在此錯誤:

update-rc.d: error: gs-spring-boot-0.1.0 Default-Start contains no runlevels, aborting. 

當我檢查狀態這是輸出: enter image description here

enter image description here

注:我使用Ubuntu和jar文件有權限:755

任何幫助表示讚賞。

回答

1

對不起加入這build.gradle是解決辦法:

bootRepackage { executable = true } 

它使罐子是可執行的。即添加此代碼後,您應該可以使用此命令運行應用程序:

./app-name.jar 
相關問題