From e644debdf7e4f73e76df3f2fd7774871a2c6c60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 15 Aug 2018 13:24:06 +0300 Subject: [PATCH] Fix SLES 15 packaging SLES 15 doesn't have any sort of init functions which is why the error is converted to a status message. A dummy file that just prints an error is placed into /etc/init.d/ to make it clear to the users that they should use systemd to start MaxScale. --- cmake/init_scripts.cmake | 7 +++++-- etc/fallback/maxscale.in | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 etc/fallback/maxscale.in diff --git a/cmake/init_scripts.cmake b/cmake/init_scripts.cmake index 23ab7b8e5..83f8dd138 100644 --- a/cmake/init_scripts.cmake +++ b/cmake/init_scripts.cmake @@ -10,7 +10,7 @@ elseif(EXISTS ${SLES_FNC}) elseif(EXISTS ${DEB_FNC}) set(USE_DEB TRUE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.") else() - message(FATAL_ERROR "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, please confirm that your system files are OK.") + message(STATUS "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, will not install init scripts.") endif() if(USE_DEB) @@ -18,7 +18,10 @@ if(USE_DEB) elseif(USE_RPM) configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) elseif(USE_SLES) - configure_file(${CMAKE_SOURCE_DIR}/etc/sles11/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) + configure_file(${CMAKE_SOURCE_DIR}/etc/sles11/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) +else() + # Use a dummy file that tells the user that init scripts aren't supported on this platform + configure_file(${CMAKE_SOURCE_DIR}/etc/fallback/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) endif() configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf @ONLY) diff --git a/etc/fallback/maxscale.in b/etc/fallback/maxscale.in new file mode 100755 index 000000000..2b368861e --- /dev/null +++ b/etc/fallback/maxscale.in @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "Init scripts are not supported on this platform, use either systemd or launch MaxScale manually" +exit 1