Exclude systemd-nspawn@* services from restart
As of c984b75c, systemd package upgrades now restart systemd services.
The restarted services include system-nspawn containers running as systemd-nspawn@*.service
, which fail to restart correctly when restarted at this specific point:
( 7/26) Restarting marked services...
Job for systemd-nspawn@grafana.service failed because the control process exited with error code.
See "systemctl status systemd-nspawn@grafana.service" and "journalctl -xeu systemd-nspawn@grafana.service" for details.
Job for systemd-nspawn@mastodon.service failed because the control process exited with error code.
See "systemctl status systemd-nspawn@mastodon.service" and "journalctl -xeu systemd-nspawn@mastodon.service" for details.
Job for systemd-nspawn@prometheus.service failed because the control process exited with error code.
See "systemctl status systemd-nspawn@prometheus.service" and "journalctl -xeu systemd-nspawn@prometheus.service" for details.
error: command failed to execute correctly
Jan 02 10:31:32 hailey-arch systemd[1]: Starting Container grafana...
Jan 02 10:31:32 hailey-arch systemd-nspawn[431718]: Mount point '/run/systemd/nspawn/unix-export/grafana' exists already, refusing.
Jan 02 10:31:32 hailey-arch systemd[1]: systemd-nspawn@grafana.service: Main process exited, code=exited, status=1/FAILURE
Jan 02 10:31:32 hailey-arch systemd[1]: systemd-nspawn@grafana.service: Failed with result 'exit-code'.
Jan 02 10:31:32 hailey-arch systemd[1]: Failed to start Container grafana.
Restarting these services manually later on does work correctly, however the current behaviour means these services remain failed until manual restart.
I am strongly of the view that restarting systemd-nspawn services is not desirable behaviour: they are more like user services than system services, and restarting containers can cause other problems - even if the surface bug here is fixed and nspawn containers can be restarted without failing.
In general, services are not restarted on package upgrade in Arch Linux, and restarting containers running as systemd-nspawn services is inconsistent with that expectation.