Fix SELinux backup execution context and probe source metadata before downtime

This commit is contained in:
admin committed 2026-09-10 15:11:10 +02:00
1 parent 5c8a7a30be
commit c0a24b63fc
9 files changed
+193 -14

No files matched your search

+8 -1
View File
@@ -5,7 +5,14 @@ After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/app-backup.sh
# Bash is an allowed entry point for this SELinux service domain. Running rsync
# directly as the entry point can fail even when child execution is permitted.
ExecStart=/bin/bash /usr/local/sbin/app-backup.sh
# A privileged backup crosses web/mail/user labels and preserves those labels.
# Keep enforcing globally; scope unconfined execution to this backup service.
# This deliberately removes SELinux confinement for this unit and its children.
# No '-' prefix: an unavailable/denied context must fail visibly.
SELinuxContext=system_u:system_r:unconfined_service_t:s0
# Timeout sends TERM: Bash runs its recovery trap; grace time permits service restart.
TimeoutStartSec=12h
TimeoutStopSec=5min