Dolphin的博客

spring-boot-app-management

1
2
3
4
5
6
7
8
9
@ComponentScan
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(Application.class);
app.addListeners(new ApplicationPidFileWriter("app.pid"));
app.run(args);
}
}

when we already have our PID file we need bash script providing standard operations like stop, start, restart and status checking. Below you can find simple script solving that challenge.