From b6d743fd03ac1ca6257dd86e54c31b5d97cb3525 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 9 Sep 2016 11:00:06 +0300 Subject: [PATCH] Create MaxScale directories If the installation directory is something else than /usr, then the directories /var/cache/maxscale /var/log/maxscale /var/run/maxscale will be created at installation time. --- CMakeLists.txt | 8 ++++++++ server/include/gwdirs.h.in | 2 ++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3762c85c..6da4daeea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -357,3 +357,11 @@ if(PACKAGE) message(STATUS "You can install startup scripts and system configuration files for MaxScale by running the 'postinst' shell script located at ${CMAKE_INSTALL_PREFIX}.") message(STATUS "To remove these installed files, run the 'postrm' shell script located in the same folder.") endif() + +# NOTE: If you make changes here, ensure they are compatible with the +# situation in gwdirs.h.in. +if (NOT CMAKE_INSTALL_PREFIX EQUAL "/usr") + install(DIRECTORY DESTINATION var/cache/maxscale) + install(DIRECTORY DESTINATION var/log/maxscale) + install(DIRECTORY DESTINATION var/run/maxscale) +endif() diff --git a/server/include/gwdirs.h.in b/server/include/gwdirs.h.in index 3c53d4cb6..0a2c0dab1 100644 --- a/server/include/gwdirs.h.in +++ b/server/include/gwdirs.h.in @@ -21,6 +21,8 @@ EXTERN_C_BLOCK_BEGIN +// NOTE: If you make changes here, ensure they are compatible with the +// situation in /CMakeLists.txt, where directories are installed. #define MXS_DEFAULT_PID_SUBPATH "run/maxscale" #define MXS_DEFAULT_LOG_SUBPATH "log/maxscale" #define MXS_DEFAULT_DATA_SUBPATH "lib/maxscale"