Unit File from Scratch

Write a systemd unit file, enable, start, and read the journal.

A advanced Linux challenge worth 20 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.

The Challenge

Scenario: You need to run a Node.js web app as a proper system service that auto-restarts on failure and survives reboots.

Write a systemd unit file at /tmp/webapp.service with these exact settings:

[Unit]
Description=DevOps Lab Web Application
After=network.target

[Service]
ExecStart=/usr/bin/node /opt/app/server.js
WorkingDirectory=/opt/app
Restart=always
RestartSec=5
User=labuser

[Install]
WantedBy=multi-user.target

Exactly match the field names and values — the checker validates the structure.

Commands to learn: systemd unit file syntax, systemctl concepts, journalctl

Run check when done.