ExecStart=/usr/bin/systemctl --no-block poweroff
DefaultDependencies=no avoids an implicit
Conflicts=shutdown.target. This means it won't matter if the service is started with the job mode
replace-irreversible. It also avoids an implicit
Wants=sysinit.target; this would be suboptimal e.g. if you wanted to start this service after transitioning to
Before=shutdown.target makes sure the service finishes before systemd-shutdown starts sending signals. If nothing else, this makes the unit simpler to analyze for correctness. We avoid a deadlock by making sure the service does not also wait for the poweroff to complete.
It wouldn't matter if
systemd-shutdown killed the systemctl process with SIGTERM. The process would simply terminate with status
WIFSIGNAL and a
SIGTERM. Systemd treats this as a clean, successful exit. See the definition of SuccessExitStatus in
man systemd.exec. However, if the kernel mysteriously didn't schedule this initial exit before the systemd
DEFAULT_TIMEOUT_USEC, systemd-shutdown would then send the unblockable signal SIGKILL. Systemd would not treat this as a successful exit.