Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion etc/initsystem/safe-reload.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if [ ! -e "$ICINGA2_PID_FILE" ]; then
fi

pid=`cat "$ICINGA2_PID_FILE"`
if ! kill -HUP "$pid" >/dev/null 2>&1; then
if ! "$DAEMON" internal signal --sig SIGHUP --pid "$pid" >/dev/null 2>&1; then
echo "Error: Icinga not running"
exit 7
fi
Expand Down
2 changes: 1 addition & 1 deletion etc/logrotate.d/icinga2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
missingok
notifempty@LOGROTATE_CREATE@
postrotate
/bin/kill -USR1 $(cat @ICINGA2_INITRUNDIR@/icinga2.pid 2> /dev/null) 2> /dev/null || true
@CMAKE_INSTALL_FULL_SBINDIR@/icinga2 internal signal --sig SIGUSR1 --pid "$(cat @ICINGA2_INITRUNDIR@/icinga2.pid 2> /dev/null)" 2> /dev/null || true
Copy link
Member

Choose a reason for hiding this comment

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

Be aware that this is a config file which we've currently told the package manager not to override by %config(noreplace).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunate, but not much we can do about it except mentioning it in the changelog. I've added a corresponding hint to the PR description.

Copy link
Member

Choose a reason for hiding this comment

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

That's not true! We can at least consider %config, i.e w/o (noreplace).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the file was modified, there was probably a reason for doing so. Just overwriting it would likely break something.

Copy link
Member

Choose a reason for hiding this comment

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

And just keeping it leaves a security hole(?) for all who don't read the changelog, but modified stuff. Also, %config makes a backup of your modifications.

Copy link
Member

Choose a reason for hiding this comment

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

@dgoetz:

  • This is a valid reason for %config
  • Needs proper upgrade log, though (breaking changes awareness)
  • Also %config must be kept long enough, as users may skip a version

endscript
}

Expand Down
2 changes: 2 additions & 0 deletions lib/cli/internalsignalcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ int InternalSignalCommand::Run(const boost::program_options::variables_map& vm,
return kill(vm["pid"].as<int>(), SIGCHLD);
if (signal == "SIGHUP")
return kill(vm["pid"].as<int>(), SIGHUP);
if (signal == "SIGUSR1")
return kill(vm["pid"].as<int>(), SIGUSR1);

Log(LogCritical, "cli") << "Unsupported signal \"" << signal << "\"";
#else
Expand Down
Loading