mirror of https://github.com/Icinga/icinga2.git
Detect logrotate not installed in /usr/sbin
Gentoo started installing the logrotate binary to bin, see gentoo/gentoo@bc23def39c and https://bugs.gentoo.org/show_bug.cgi?id=588156 There might be other systems doing that, which makes it a good idea to stop hardcoding the path. fixes #12535 Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
This commit is contained in:
parent
429d11daa8
commit
e725e6719c
|
@ -99,7 +99,8 @@ endif()
|
|||
|
||||
if(NOT DEFINED LOGROTATE_HAS_SU)
|
||||
set(LOGROTATE_HAS_SU OFF)
|
||||
execute_process(COMMAND "/usr/sbin/logrotate" ERROR_VARIABLE LOGROTATE_OUTPUT)
|
||||
find_program(LOGROTATE_BINARY logrotate)
|
||||
execute_process(COMMAND ${LOGROTATE_BINARY} ERROR_VARIABLE LOGROTATE_OUTPUT)
|
||||
if(LOGROTATE_OUTPUT)
|
||||
string(REGEX REPLACE "^logrotate ([0-9.]*).*" "\\1" LOGROTATE_VERSION
|
||||
${LOGROTATE_OUTPUT})
|
||||
|
|
Loading…
Reference in New Issue