Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 1 | Define CMake variables to indicate init system for target |
| 2 | incase of cross compile, detecting systemd support based on |
| 3 | host directory structure is not right thing to do |
| 4 | |
| 5 | Upstream-Status: Pending |
| 6 | Signed-off-by: Khem Raj <raj.kheem@gmail.com> |
| 7 | |
| 8 | --- a/src/CMakeLists.txt |
| 9 | +++ b/src/CMakeLists.txt |
| 10 | @@ -317,7 +317,7 @@ if(FLB_BINARY) |
| 11 | install(TARGETS fluent-bit-bin RUNTIME DESTINATION ${FLB_INSTALL_BINDIR}) |
| 12 | |
| 13 | # Detect init system, install upstart, systemd or init.d script |
| 14 | - if(IS_DIRECTORY /lib/systemd/system) |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 15 | + if(FLB_SYSTEMD) |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 16 | set(FLB_SYSTEMD_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.service") |
| 17 | configure_file( |
| 18 | "${PROJECT_SOURCE_DIR}/init/systemd.in" |
| 19 | @@ -325,7 +325,7 @@ if(FLB_BINARY) |
| 20 | ) |
| 21 | install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system) |
| 22 | install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR}) |
| 23 | - elseif(IS_DIRECTORY /usr/share/upstart) |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 24 | + elseif(FLB_UPSTART) |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 25 | set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf") |
| 26 | configure_file( |
| 27 | "${PROJECT_SOURCE_DIR}/init/upstart.in" |
| 28 | --- a/CMakeLists.txt |
| 29 | +++ b/CMakeLists.txt |
| 30 | @@ -70,6 +70,8 @@ option(FLB_RECORD_ACCESSOR "Enable re |
| 31 | option(FLB_SYSTEM_STRPTIME "Use strptime in system libc" Yes) |
| 32 | option(FLB_STATIC_CONF "Build binary using static configuration") |
| 33 | option(FLB_STREAM_PROCESSOR "Enable Stream Processor" Yes) |
| 34 | +option(FLB_SYSTEMD "Enable systemd init system" No) |
| 35 | +option(FLB_UPSTART "Enable upstart init system" No) |
| 36 | option(FLB_CORO_STACK_SIZE "Set coroutine stack size") |
| 37 | |
| 38 | # Metrics: Experimental Feature, disabled by default on 0.12 series |