Service: Spring Todo MVC

Setup

Dependencies

Note

This Spring Todo MVC application requires openjdk-11-jre to run. You should already have this on your machine. If you do not, feel free to install it with apt.

Deploy Artifacts (GitHub)

You can find the artifacts for this project at the Spring Todo MVC artifacts GitHub repo

Instructions

Using the project dependencies and the deploy artifacts create a unit file for the Spring Todo MVC application, configure the unit to restart on failure, and to start on boot (multi-user.target).

Create Unit File

CLICK FOR ANSWER
sudo touch /etc/systemd/system/todo-mvc.service

[Unit] Section

CLICK FOR ANSWER

Using your editor of choice append the following text into the unit file.

[Unit]
Description=Todo MVC Application

[Service] Section

CLICK FOR ANSWER

Using your editor of choice append the following text into the unit file.

[Service]
ExecStart=/usr/bin/java -jar /home/student/spring-todo-mvc-artifact/todo-mvc.jar
Restart=on-failure

[Install] Section

CLICK FOR ANSWER

Using your editor of choice append the following text into the unit file.

[Install]
WantedBy=multi-user.target

Enable the Service

CLICK FOR ANSWER
sudo systemctl enable todo-mvc.service

Start the Service

CLICK FOR ANSWER
sudo systemctl start todo-mvc.service

Hints

The Spring Todo MVC application is configured to start on port 8080, make sure no other applications are using the port.