Endpreise in CHF – Versand inklusive Schweizer Unternehmen · 076 792 63 50 (WhatsApp/SMS)
Kurse › Raspberry Pi › Stufe 15
Raspberry Pi · Intermediate · Stufe 15 / 40

Services and Scheduling

Make programs start at boot, restart after failure, run on a schedule and log sensibly using systemd and cron.

Intermediate freischalten · CHF 19.90 Stufen 14–26, einmalig, kein Abo

10 Lektionen in dieser Stufe

  1. What systemd Does During Boot
    Describe units, targets and dependencies and inspect the running system. · Lab: List active units, show the dependency tree of the network target and check one service's status.
  2. Writing a Service Unit for a Python Program
    Create, enable and start a unit that runs a script from a venv. · Lab: Write a unit file for the sensor logger, enable it and reboot to confirm it starts.
  3. Reading Logs with journalctl
    Filter the journal by unit, time and priority. · Lab: Find yesterday's errors for one service and follow its live output.
  4. Restart Policies and Start Limits
    Recover from crashes automatically without looping forever. · Lab: Make the logger crash on purpose and tune Restart, RestartSec and the start limit.
  5. Dedicated Service Users and Environment Files
    Run a service with only the rights and settings it needs. · Lab: Create a system user with gpio and i2c access and move settings into an environment file.
  6. Handling SIGTERM for a Clean Stop
    Catch stop signals to flush data and switch outputs off. · Lab: Add a signal handler that closes files and turns off outputs when the service stops.
  7. Scheduling Jobs with cron
    Write crontab entries and avoid environment pitfalls. · Lab: Schedule an hourly CSV rotation and capture its output to a log.
  8. systemd Timers as a cron Alternative
    Schedule work with calendar and monotonic timers that catch up after downtime. · Lab: Convert the cron job to a timer with Persistent=true and list its next run.
  9. Rotating and Capping Logs
    Limit journal size and rotate application log files. · Lab: Set a journal size cap and write a logrotate rule for the application log.
  10. Measuring and Shortening Boot Time
    Find slow units and remove what an appliance does not need. · Lab: Record systemd-analyze blame, disable two unneeded services and measure the gain.

Abschlussprojekt

A sensor-logging appliance that starts on boot under its own user, recovers from crashes, runs nightly maintenance from a timer and keeps its logs within a fixed size.

Teile für diese Stufe

  • 1 × Raspberry Pi 5 or Pi 4 set from Level 1
  • 1 × Sensor node hardware from Level 11

In jeder Lektion legst du die passenden Teile direkt in den Warenkorb. Raspberry Pi →

Voraussetzung: Levels 3, 5 and 10: users and permissions, Python logging and structured projects.

🔒 Sichere Zahlung · 3D Secure 🔐 SSL-verschlüsselt 🚚 Versand in die ganze Schweiz 🇨🇭 Schweizer Unternehmen