1. 程式人生 > >centos 7 下的 service部署

centos 7 下的 service部署

在centos 7下部署service一般涉及到jar包部署, service指令碼. 資料存貯路徑, log存貯路徑

jar包部署

/usr/local/app/app1/app1.jar

service 啟動檔案

/usr/lib/systemd/system/app1.service

[Unit]
Description=my app1 Service

[Service]
User=appuser

# The configuration file application.properties should be here:
WorkingDirectory=/usr/local/app/app1
ExecStart=/usr/local/java/jdk1.7.0_80/bin/java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8787,suspend=n
-jar /usr/local/app/app1/app1.jar
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

資料存貯

/var/lib/app/app1

log

/var/log/app/app1.log