Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload with systemctl load-or-restart if available #57

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion manifests/run_service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@
default => 'prometheus',
}

$restart_cmd = $prometheus::init_style ? {
'systemd' => "systemctl reload-or-restart ${init_selector}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work or should it be a fully qualified path?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works on debian jessie, the existing manifests/config.pp also calls systemctl unqualified.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then 👍 because I know the path can differ (/bin/systemctl on Fedora and Jessie, /usr/bin/systemctl on Gentoo).

default => '/usr/bin/pkill -HUP prometheus',
}

if $prometheus::manage_service == true {
service { 'prometheus':
ensure => $prometheus::service_ensure,
name => $init_selector,
enable => $prometheus::service_enable,
hasrestart => true,
restart => '/usr/bin/pkill -HUP prometheus',
restart => $restart_cmd,
}
}
}