PortGate

Blueprints · Systemd & Agents

Beginner 10 min · systemd

systemd private tmp

Stages PrivateTmp so a service cannot read another service temporary files.

Live config

Baked-in protections

Step 1 · ini

Drop-in

/root/portgate-blueprints/private-tmp.conf

Apply it to a unit that does not share /tmp with another process on purpose.

[Service]
PrivateTmp=true

Step 2 · bash

Read-only check

/root/portgate-blueprints/private-tmp-check.sh

Prints status. It does not change the service.

#!/bin/sh
set -eu
systemctl show "app.service" -p PrivateTmp || echo "Unit app.service is not installed."