Skip to content
Ameen Abozaid
Planned lessonJNR-048-L07

Demo: running Shop as a systemd service

  • Lesson 7 of 7
  • Junior
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

run the Shop JAR as a managed service. Prepares JNR-048-LAB1.

Draft outline details

Step by step

  1. Create a shop system user and copy the JAR to /opt/shop.
  2. Write /etc/systemd/system/shop.service with User=shop, ExecStart=java -jar /opt/shop/shop.jar, Restart=on-failure.
  3. systemctl daemon-reload, enable --now shop, then check status and journalctl -u shop.
  4. Find the port with ss -tlnp and call the health endpoint with curl.
  5. Planned mistake: the JAR is owned by root with mode 600, so the service fails with "permission denied"; fix with chown and chmod 640, not 777.
  6. kill the process and show systemd restarting it.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.