docs: create centos/spring-boot-startup
This commit is contained in:
parent
bac430262f
commit
8a7ab757d1
40
centos/spring-boot-startup.md
Normal file
40
centos/spring-boot-startup.md
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
title: Springboot启动脚本
|
||||||
|
description: Springboot启动脚本
|
||||||
|
published: true
|
||||||
|
date: 2021-08-03T09:19:13.633Z
|
||||||
|
tags: springboot, cento
|
||||||
|
editor: markdown
|
||||||
|
dateCreated: 2021-08-03T09:19:13.633Z
|
||||||
|
---
|
||||||
|
|
||||||
|
# start.sh
|
||||||
|
```shell
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# 删除pid输出文件
|
||||||
|
rm -f tpid
|
||||||
|
# 启动命令
|
||||||
|
nohup java -jar -Dspring.profiles.active=prod ./XXX.jar >/dev/null 2>&1 &
|
||||||
|
|
||||||
|
# pid输出到文件中
|
||||||
|
echo $! > tpid
|
||||||
|
|
||||||
|
# 描述启动成功
|
||||||
|
echo Start Success!
|
||||||
|
```
|
||||||
|
|
||||||
|
# 启动服务
|
||||||
|
1. 直接启动
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ sh ./start.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 修改为可执行文件再启动
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ chmod u+x ./start.sh
|
||||||
|
$ ./start.sh
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user