Startup progress

Note: this page is only relevant for Spring Boot applications.

As a Spring Boot application starts up, it progresses through various stages as defined in SpringApplicationRunListener: * starting * context loaded * context prepared * environment prepared * started * running * failed (not used)

These stages compose the startup sequence.

The current stage is shown when requesting the service status:

[root@machine ~]# systemctl status myservice.service
● myservice.service - My Spring Boot Service
   Loaded: loaded (/etc/systemd/system/myservice.service; disabled; vendor preset: disabled)
   Active: activating (start) since Wed 2018-03-07 23:01:10 WET; 3s ago
 Main PID: 21034 (java)
   Status: "State: context prepared"
   CGroup: /system.slice/myservice.service
           └─21034 /opt/jdk1.8.0/bin/java -XX:+ExitOnOutOfMemoryError -Xms256M -Xmx512M -XX:+UseG1GC -jar /opt/myservice/myservice.jar

As soon as the application context is ready and starts creating beans, the status will also show the progress on bean creation, which can give you an approximate measure of the percent complete:

[root@machine ~]# systemctl status myservice.service
● myservice.service - My Spring Boot Service
   Loaded: loaded (/etc/systemd/system/myservice.service; disabled; vendor preset: disabled)
   Active: activating (start) since Wed 2018-03-07 23:01:10 WET; 11s ago
 Main PID: 21034 (java)
   Status: "State: context loaded, Creating bean 94 of 472"
   CGroup: /system.slice/myservice.service
           └─21034 /opt/jdk1.8.0/bin/java -XX:+ExitOnOutOfMemoryError -Xms256M -Xmx512M -XX:+UseG1GC -jar /opt/myservice/myservice.jar

This status information will only be shown during the startup sequence of a Spring Boot application, and will no longer be displayed after systemd is notified that the service is ready.