Skip to content

Commit

Permalink
Detect logrotate not installed in /usr/sbin
Browse files Browse the repository at this point in the history
Gentoo started installing the logrotate binary to bin, see
gentoo/gentoo@bc23def
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>
  • Loading branch information
sbraz authored and gunnarbeutner committed Aug 29, 2016
1 parent 51c89fb commit 81f8dc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Expand Up @@ -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})
Expand Down

0 comments on commit 81f8dc2

Please sign in to comment.