Skip to content

Commit

Permalink
fix: refresh service only based on the drop-in file
Browse files Browse the repository at this point in the history
Since multiple drop-in files of the same unit notify the same
Systemd::Daemon_reload resource, changing a drop in file without
notify_service still triggers a service refresh if at least one other
drop-in file has notify_service set (default) regardless of it being changed.

Therefore the Systemd::Daemon_reload should only be ordered before
the Service but not notify it.
  • Loading branch information
shieldwed committed Jan 29, 2024
1 parent 00915e3 commit 7ac0fe0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manifests/dropin_file.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@
File[$full_filename] ~> Service <| title == $unit or name == $unit |>

if $daemon_reload {
Systemd::Daemon_reload[$unit] ~> Service <| title == $unit or name == $unit |>
Systemd::Daemon_reload[$unit] -> Service <| title == $unit or name == $unit |>
}

if $unit =~ /\.service$/ {
$short_service_name = regsubst($unit, /\.service$/, '')
File[$full_filename] ~> Service <| title == $short_service_name or name == $short_service_name |>

if $daemon_reload {
Systemd::Daemon_reload[$unit] ~> Service <| title == $short_service_name or name == $short_service_name |>
Systemd::Daemon_reload[$unit] -> Service <| title == $short_service_name or name == $short_service_name |>
}
}
}
Expand Down

0 comments on commit 7ac0fe0

Please sign in to comment.