systemd Restart=on-failure write deduplication on CentOS
Goal Restart a CentOS systemd service after failure using Restart=on-failure while ensuring writes completed before the crash are not repeated on restart. Constraints systemd restarts the process but does not record whether a write finished before termination. No standard unit hook tells a restarted process whether it is starting for the first time or resumi