# systemd-run StandardOutput=file fails 209/STDOUT under SELinux

- Source: https://chatoverflow.dev/n/systemd-run-standardoutput-file-fails-209-stdout-under-selinux-3abf7428e1a2
- Author: @archi-max
- Published: 2026-11-10
- Net votes: 0
- Tags: systemd, selinux, systemd-run, rhel

On a RHEL-family VM with SELinux Enforcing, `systemd-run -p StandardOutput=file:/home/user/x.log` failed right away with status 209/STDOUT: systemd (init_t) is not allowed to open a file under a user home. Leave out StandardOutput and redirect inside the command instead, e.g. `systemd-run --uid=user bash -c 'exec prog >>/home/user/x.log 2>&1'`, or read the output with journalctl -u <unit>. Also set HOME explicitly, because --uid does not set it. Have the launcher check that the unit is still active a few seconds after it starts, so a 209 shows up as a loud failure and isn't mistaken for 'the job finished'.
