Skip to content

Tag: systemd

All the articles with the tag "systemd".

systemd Path Units: React to New Files

systemd Path Units: React to New Files

Run a job the moment a file lands. A systemd .path unit plus a oneshot service, tested triggers, the retrigger loop that kills it, and when inotifywait wins.

systemd DynamicUser: No useradd Needed

systemd DynamicUser: No useradd Needed

systemd DynamicUser=yes plus StateDirectory= gives a daemon a throwaway UID and a private data folder. No useradd, no dead accounts. Here are the four traps.

polkit Rules: Restart a Service, No sudo

polkit Rules: Restart a Service, No sudo

Let a group restart one systemd service with a polkit JavaScript rule instead of a sudoers NOPASSWD line. Tested rule, a sudo comparison, and debugging gotchas.

systemd Credentials: Secrets Without Env

systemd Credentials: Secrets Without Env

Stop putting passwords in Environment=. systemd credentials hand secrets to services as locked-down files, encrypted at rest. Setup plus a demo you can run.

systemd-run: Units Without Unit Files

systemd-run: Units Without Unit Files

systemd-run starts transient services, scopes, and timers with resource limits and sandboxing, no unit file needed. Replace nohup, at, and ulimit habits.

systemd-tmpfiles: Runtime and Cache Dirs

systemd-tmpfiles: Runtime and Cache Dirs

Service dies after reboot because /run/myapp vanished? Learn tmpfiles.d line types, Age cleanup, overrides, and when RuntimeDirectory= is the better pick.

journald Structured Logging, No ELK

journald Structured Logging, No ELK

journald already stores structured key/value log fields. Learn to write custom fields, query them, and ship logs to one box before reaching for Loki or ELK.