mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-03 20:40:17 -05:00
Merge pull request #10530 from Icinga/kill-drop-permissions
Send signals as Icinga user in safe-reload and logrotate
This commit is contained in:
commit
ce600ce01c
3 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
endscript
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue