After an update to sys-apps/systemd-240-r3 the systemd-poweroff.service unit lacks a [Service] Section with an ExecStart so I get the following error: # systemctl poweroff Failed to power off system via logind: Unit systemd-poweroff.service has a bad unit file setting. Failed to start poweroff.target: Unit systemd-poweroff.service has a bad unit file setting. See system logs and 'systemctl status poweroff.target' for details. Adding the [Service] section to the file solves the issue. A little more in https://forums.gentoo.org/viewtopic-p-8300586.html#8300586
You can run systemctl daemon-reexec to resolve this. Do you have FEATURES="pid-sandbox" enabled? This breaks the systemctl daemon-reexec in pkg_postinst.
(In reply to Mike Gilbert from comment #1) > You can run systemctl daemon-reexec to resolve this. Thanks, didn't know about this. > > Do you have FEATURES="pid-sandbox" enabled? No I don't. (at least not that I know, meaning explicitly in any file and env of my root user, I checked a couple of build logs under /var/tmp/portage and none of those and my profile does not seem to set it).