// `stopIfChanged = true` is ignored, switch-to-configuration will handle `restartIfChanged =
// false` and `reloadIfChanged = true`. This is the same as specifying a restart trigger in the
71
+
// In addition, switch-to-configuration will handle notSocketActivated=true to disable treatment
72
+
// of units as "socket-activated" even though they might have any associated sockets.
// The reload file asks this program to reload a unit. This is the same as specifying a reload
// trigger in the NixOS module and can be ignored if the unit is restarted in this activation.
// If this unit is socket-activated, then stop the socket unit(s) as well, and
// restart the socket(s) instead of the service.
588
+
// We count as "socket-activated" any unit that doesn't declare itself not so
589
+
// via X-NotSocketActivated, that has any associated .socket units.
let mut socket_activated = false;
if unit.ends_with(".service") {
let mut sockets = if let Some(Some(Some(sockets))) = new_unit_info.map(|info| {
641
+
if parse_systemd_bool(new_unit_info, "Service", "X-NotSocketActivated", false) {
642
+
// If the unit explicitly opts out of socket
643
+
// activation, restart it as if it weren't (but do
644
+
// restart its sockets, that's fine):
645
+
socket_activated = false;
// If the unit is not socket-activated, record that this unit needs to be started