MXS-2969: Restart MaxScale on upgrade
Renamed the postrm script to prerm since it is executed before uninstallation. Silenced the output of the systemctl disable commands and added a conditional restart of MaxScale if a MaxScale instance is running. Use getent instead of grep to detect if the maxscale user needs to be created.
This commit is contained in:
@ -105,5 +105,5 @@ else()
|
||||
endif()
|
||||
|
||||
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.")
|
||||
message(STATUS "To remove these installed files, run the 'prerm' shell script located in the same folder.")
|
||||
endif()
|
||||
|
||||
@ -6,7 +6,7 @@ set(CPACK_DEBIAN_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
|
||||
|
||||
if(TARGET_COMPONENT STREQUAL "core" OR TARGET_COMPONENT STREQUAL "all")
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/postinst;${CMAKE_BINARY_DIR}/postrm")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/postinst;${CMAKE_BINARY_DIR}/prerm")
|
||||
elseif(TARGET_COMPONENT STREQUAL "devel")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n${DESCRIPTION_TEXT}")
|
||||
endif()
|
||||
|
||||
@ -39,7 +39,7 @@ set(CPACK_RPM_USER_FILELIST "${IGNORED_DIRS}")
|
||||
|
||||
if(TARGET_COMPONENT STREQUAL "core" OR TARGET_COMPONENT STREQUAL "all")
|
||||
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_BINARY_DIR}/postinst)
|
||||
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_BINARY_DIR}/postrm)
|
||||
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_BINARY_DIR}/prerm)
|
||||
endif()
|
||||
|
||||
if(EXTRA_PACKAGE_DEPENDENCIES)
|
||||
|
||||
Reference in New Issue
Block a user