csot/contest

Task 07 — systemd timer for Hello World

Submit a pair of unit files: a oneshot service that prints Hello World, and a timer that triggers it every minute.

Submit as

File Role
07.service Systemd service unit
07.timer Systemd timer unit

Input

No runtime CLI arguments. The grader reads your two files as static INI unit definitions.

07.service (required structure)

Section Required keys
[Unit] Any description is fine
[Service] Type=oneshot
ExecStart= must run /bin/echo "Hello World" or printf equivalent

07.timer (required structure)

Section Required keys
[Unit] Any description is fine
[Timer] Unit=07.service
One of: OnUnitActiveSec=1min, OnCalendar=minutely, OnCalendar=*-*-* *:*:00, OnCalendar=*:0/1
[Install] WantedBy=timers.target

Output

Stream Format
Runtime Not executed in the grader (no PID 1 / systemd in sandbox)
Grader result Pass if both files contain the required directives (grep-based check)

When you test locally, journalctl -u 07.service should show Hello World each time the timer fires.

Example (skeleton — not a complete solution)

Use this as a shape guide only. You must fill in valid ExecStart=, timer schedule, and descriptions yourself.

07.service:

[Unit]
Description=…your description…

[Service]
Type=oneshot
ExecStart=…command that prints Hello World once…

07.timer:

[Unit]
Description=…your description…

[Timer]
Unit=07.service
# pick a 1-minute schedule — see man systemd.timer (OnUnitActiveSec, OnCalendar, …)

[Install]
WantedBy=timers.target

What the grader checks

Visible (5 pts) — requirements from the tables above. On failure you may see which directive was missing (no full “answer key” file).

Check Points
07.service: [Unit], [Service], Type=oneshot 2
ExecStart= prints Hello World 3

Hidden (4 pts) — stricter timer rules, pass/fail only.

Check Points
07.timer: all sections + Unit= + Install 2
Fires about every minute 2

Hints

  • man systemd.service, man systemd.timer
  • Local test: sudo cp 07.{service,timer} /etc/systemd/system/ && sudo systemctl daemon-reload && sudo systemctl enable --now 07.timer

Points: 9 (partial grading)

Other tasks