Units, services, ordering and dependencies — enable, start, repair and verify.
- Cap Journal Disk Useeasy · in-browser
Write /etc/systemd/journald.conf.d/storage.conf with a [Journal] section that stores logs persistently (Storage=persistent), caps total journal disk usage at SystemMaxUse=500M, and retains entries no longer than MaxRetentionSec=1month.
(Authored config, graded structurally — the engine isn't run here.)
- Enable and start a serviceeasy
The cron daemon (crond) must be enabled at boot AND running right now.
- Inspect the default targeteasy
Write the systemd default target name to /home/player/t.txt.
- Laptop Lid & Idle Policyeasy · in-browser
Write /etc/systemd/logind.conf.d/power.conf with a [Login] section so closing the lid does nothing (HandleLidSwitch=ignore) and an idle session locks (IdleAction=lock) after 15 minutes (IdleActionSec=15min).
(Authored config, graded structurally — the engine isn't run here.)
- Resource-Limit Drop-Ineasy · in-browser
Write the drop-in /etc/systemd/system/web.service.d/limits.conf that constrains web.service. Include a [Service] section setting CPUQuota=50%, MemoryMax=512M, and TasksMax=100.
(Authored config, graded structurally — the engine isn't run here.)
- Sandbox a Serviceeasy · in-browser
Write /etc/systemd/system/myd.service. It only needs a [Service] section that runs ExecStart=/usr/bin/myd and applies four sandboxing directives: ProtectSystem=strict, ProtectHome=true, PrivateTmp=true, and NoNewPrivileges=yes.
(Authored config, graded structurally — the engine isn't run here.)
- tmpfiles.d Runtime Direasy · in-browser
Write /etc/tmpfiles.d/myapp.conf with two entries so systemd-tmpfiles recreates state at boot. Line 1: type 'd' for directory /run/myapp, mode 0755, owned by user myapp and group myapp, with age '-' (no cleanup). Line 2: type 'f' for file /var/log/myapp/app.log, mode 0640, owned by user myapp and group adm. Columns are space-separated: type, path, mode, owner, group, age.
(Authored config, graded structurally — the engine isn't run here.)
- Auto-restart a servicemedium
Create and enable a service flapper.service (it runs sleep 1) configured to always restart (Restart=always, RestartSec=1).
- Boot + Interval Timermedium · in-browser
Write the timer /etc/systemd/system/cache-prune.timer that runs its service 5 minutes after boot and then once an hour thereafter, catching up on missed runs. In [Timer] set OnBootSec=5min, OnUnitActiveSec=1h, and Persistent=true. Add an [Install] section with WantedBy=timers.target.
(Authored config, graded structurally — the engine isn't run here.)
- Calendar timermedium
Create report.timer (OnCalendar=daily) + report.service; enable the timer.
- Cap a service's memorymedium
Create+enable capped.service (sleep 60) with MemoryMax=64M.
- Condition-Gated Unitmedium · in-browser
Write /etc/systemd/system/run-on-ac.service so it only starts when the machine is on AC power AND a feature file exists. In [Unit] set ConditionACPower=true and ConditionPathExists=/etc/app/enabled. In [Service] set Type=oneshot and ExecStart=/usr/local/bin/run-on-ac.
(Authored config, graded structurally — the engine isn't run here.)
- Conditional unitmedium
Create+enable a NEW unit cond.service with ConditionPathExists=/etc/enable-cond (it only runs if that file exists). Careful: cond.service, not the existing crond.service.
- Create a oneshot unitmedium
Create a systemd oneshot service 'seed.service' that creates the file /var/tmp/seeded when started. Enable it and start it so the file exists.
- Disable default depsmedium
Create+enable early.service with DefaultDependencies=no.
- Drop-in adds Environmentmedium
Without editing crond's unit, add a drop-in so crond has Environment=TZ=UTC (systemctl show shows it).
- Enable a disabled servicemedium
A oneshot service 'beacon' is installed but stopped & disabled. Enable and start it so it creates /run/beacon.ok.
- ExecStartPre stepmedium
Create+enable prep.service (oneshot, RemainAfterExit) with an ExecStartPre that mkdirs /run/prep and ExecStart that touches /run/prep/done.
- Inject an environment variablemedium
Service 'greeter' writes $GREETING to /run/greeting. Make it write exactly "hello" by setting the env var (drop-in), then restart it.
- Mask a servicemedium
A bogus service noisy.service is installed. Mask it so it can never start.
- Native .mount Unitmedium · in-browser
Write the mount unit /etc/systemd/system/srv-data.mount. Its [Mount] section must set What=/dev/disk/by-label/DATA, Where=/srv/data, Type=ext4, and Options=defaults,noatime. Add an [Install] section with WantedBy=multi-user.target. (The filename intentionally matches the systemd-escaped mount point /srv/data.)
(Authored config, graded structurally — the engine isn't run here.)
- On-Demand Automountmedium · in-browser
Write /etc/systemd/system/mnt-backup.automount so /mnt/backup is mounted on first access and unmounted when idle. Include an [Automount] section with Where=/mnt/backup and TimeoutIdleSec=120, plus an [Install] section with WantedBy=multi-user.target. (A matching mnt-backup.mount provides the actual mount.)
(Authored config, graded structurally — the engine isn't run here.)
- Order after networkmedium
Create web2.service that is ordered After=network-online.target (and Wants= it). Enable it.
- Override a unit with a drop-inmedium
Without editing crond's unit file, make crond restart automatically on failure: add a systemd drop-in so `systemctl show -p Restart crond` reports Restart=always.
- Path-Activated Unitmedium · in-browser
Write /etc/systemd/system/process-spool.path, a .path unit that starts work when a trigger file appears. Include a [Path] section with PathExists=/var/spool/incoming/trigger and Unit=process-spool.service, plus an [Install] section with WantedBy=multi-user.target.
(Authored config, graded structurally — the engine isn't run here.)
- Per-Connection Socketmedium · in-browser
Write the socket unit /etc/systemd/system/ftpish.socket that listens on TCP port 2121 and spawns a fresh service instance per connection. In [Socket] set ListenStream=2121 and Accept=yes. Add an [Install] section with WantedBy=sockets.target. (systemd will start ftpish@.service per connection.)
(Authored config, graded structurally — the engine isn't run here.)
- Persistent journaldmedium
Configure journald for persistent storage (Storage=persistent in /etc/systemd/journald.conf or a drop-in).
- Repair a broken unitmedium
The 'reporter' service fails to start: its ExecStart points to a script that doesn't exist. The real script is /opt/reporter/run.sh. Fix the unit and start it so /run/reporter.ok appears.
- Restart with delaymedium
Create+enable loop2.service (ExecStart sleep 1) with Restart=on-failure and RestartSec=5.
- Schedule a cron jobmedium
Install cron, then add a job (any user) that appends to /var/tmp/tick every minute. crond must be enabled and running.
- Service with Environmentmedium
Create+enable greet.service (oneshot, RemainAfterExit) with Environment=GREETING=hi that writes $GREETING to /run/greet.
- Stop a runaway servicemedium
A service 'hog' keeps a busy process alive and restarts it. Stop AND disable it so no 'academy-hog' process is running.
- Watchdog-Supervised Servicemedium · in-browser
Write /etc/systemd/system/healthd.service for a daemon that pings the systemd watchdog. Use [Service] with Type=notify, ExecStart=/usr/local/bin/healthd, WatchdogSec=30, and Restart=on-failure so systemd restarts it if it stops pinging. Add an [Install] section with WantedBy=multi-user.target.
(Authored config, graded structurally — the engine isn't run here.)
- Build a systemd timerpro
Create 'beacon.service' (writes the current date into /var/tmp/beacon) and 'beacon.timer' that fires every minute. Enable the timer and trigger one run so /var/tmp/beacon exists.
- Build a systemd timer pipelinepro
Create a systemd timer + service that moves any files from /srv/in to /srv/out. A file /srv/in/job1 is waiting — get it delivered to /srv/out/job1 (timer enabled, and one run performed).
- Custom target wiringpro
Create a target batch.target and a service worker.service that is WantedBy=batch.target; enable worker so the wants symlink exists.
- Debug a broken cronpro
A job should write /var/tmp/cronok every minute but never does. crond is disabled and the schedule is malformed. Fix both so the file gets created.
- DynamicUser State Dirpro · in-browser
Write /etc/systemd/system/appsvc.service that runs with an automatically managed transient account. In [Service] set User=appsvc, Group=appsvc, DynamicUser=yes, StateDirectory=appsvc (so /var/lib/appsvc is created and owned for it), ReadWritePaths=/var/lib/appsvc, and ExecStart=/usr/bin/appsvc.
(Authored config, graded structurally — the engine isn't run here.)
- Fix service orderingpro
Service 'svc-b' only works if 'svc-a' ran first (a writes /run/A.ok, then b needs it to write /run/B.ok). Add the correct ordering/dependency so starting svc-b succeeds from a clean boot.
- Forking Daemon Unitpro · in-browser
Write /etc/systemd/system/legacyd.service for a classic double-forking daemon. In [Unit] order it after the network: After=network-online.target and Requires=network-online.target. In [Service] set Type=forking, PIDFile=/run/legacyd.pid, ExecStart=/usr/sbin/legacyd, and ExecReload=/bin/kill -HUP $MAINPID. Add [Install] WantedBy=multi-user.target.
(Authored config, graded structurally — the engine isn't run here.)
- OnFailure handlerpro
Create flap.service (ExecStart=/bin/false) with OnFailure=alert.service, and an alert.service oneshot writing /run/alerted. Trigger flap once so /run/alerted appears.
- Regenerate a deleted configpro
Service 'webapp' won't start: /etc/webapp/config.ini was deleted. A template /opt/webapp/config.template exists with a {{PORT}} placeholder. Render it with PORT=9090 so webapp starts (/run/webapp.ok).
- Repair a failing unitpro
The unit broken.service is installed and failing. Fix it so `systemctl is-active broken.service` is active (do not disable or mask it).
- Socket-activated unitpro
Create echo.socket (ListenStream=7777) plus echo.service; enable the socket so it's listening.
- Templated Worker Unitpro · in-browser
Write the template unit /etc/systemd/system/worker@.service. Use the %i instance specifier: load a per-instance EnvironmentFile=/etc/worker/%i.env, run ExecStart=/usr/local/bin/worker --id %i, and set Restart=always. Add [Install] WantedBy=multi-user.target so each enabled instance (e.g. worker@3) wires in.
(Authored config, graded structurally — the engine isn't run here.)