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:
Markus Mäkelä
2020-04-20 13:42:56 +03:00
parent c3ddcb9056
commit be567b6029
6 changed files with 17 additions and 10 deletions

View File

@ -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)