From 21d157abaaffe41382ccb0524d8f255f79bec8b1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 8 Sep 2018 19:42:53 +0200 Subject: MDEV-14560 Extra engines enabled through additional config are not loaded on first installation RPM solution: Make all server plugins to restart the server when installed. To avoid multiple server restarts, do it only once in posttrans scriptlet. Add support for CPACK_RPM__POST_TRANS_SCRIPT_FILE --- support-files/rpm/plugin-postin.sh | 2 ++ support-files/rpm/server-posttrans.sh | 11 +++++++++++ support-files/rpm/server-postun.sh | 8 ++------ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 support-files/rpm/plugin-postin.sh create mode 100644 support-files/rpm/server-posttrans.sh (limited to 'support-files') diff --git a/support-files/rpm/plugin-postin.sh b/support-files/rpm/plugin-postin.sh new file mode 100644 index 00000000000..6be31a35f8e --- /dev/null +++ b/support-files/rpm/plugin-postin.sh @@ -0,0 +1,2 @@ +# request the server restart +echo > %{restart_flag} diff --git a/support-files/rpm/server-posttrans.sh b/support-files/rpm/server-posttrans.sh new file mode 100644 index 00000000000..0d242596185 --- /dev/null +++ b/support-files/rpm/server-posttrans.sh @@ -0,0 +1,11 @@ +if [ -r %{restart_flag} ] ; then + rm %{restart_flag} + if [ -x /usr/bin/systemctl ] ; then + /usr/bin/systemctl daemon-reload > /dev/null 2>&1 + fi + + # only restart the server if it was alredy running + if %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then + %{_sysconfdir}/init.d/mysql restart + fi +fi diff --git a/support-files/rpm/server-postun.sh b/support-files/rpm/server-postun.sh index 412c6f4c67b..b1aa0ea4393 100644 --- a/support-files/rpm/server-postun.sh +++ b/support-files/rpm/server-postun.sh @@ -1,10 +1,6 @@ if [ $1 -ge 1 ]; then - if [ -x %{_sysconfdir}/init.d/mysql ] ; then - # only restart the server if it was alredy running - if %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then - %{_sysconfdir}/init.d/mysql restart - fi - fi + # request the server restart + echo > %{restart_flag} fi if [ $1 = 0 ] ; then -- cgit v1.2.1 From 61a6f4bd962dc9c4e36e827bf5897327a85b7f52 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 21 Sep 2018 20:38:14 +0200 Subject: MDEV-14560 Extra engines enabled through additional config are not loaded on first installation Use RedHat-recommended /var/lib/rpm-state/mariadb/ for restart flag. This also fixes SUSE where /var/lib/rpm-state doesn't necessarily exist. --- support-files/rpm/plugin-postin.sh | 1 + support-files/rpm/server-postun.sh | 1 + 2 files changed, 2 insertions(+) (limited to 'support-files') diff --git a/support-files/rpm/plugin-postin.sh b/support-files/rpm/plugin-postin.sh index 6be31a35f8e..1844de1b4f2 100644 --- a/support-files/rpm/plugin-postin.sh +++ b/support-files/rpm/plugin-postin.sh @@ -1,2 +1,3 @@ # request the server restart +mkdir -p %{restart_flag_dir} echo > %{restart_flag} diff --git a/support-files/rpm/server-postun.sh b/support-files/rpm/server-postun.sh index b1aa0ea4393..27e1125b78f 100644 --- a/support-files/rpm/server-postun.sh +++ b/support-files/rpm/server-postun.sh @@ -1,5 +1,6 @@ if [ $1 -ge 1 ]; then # request the server restart + mkdir -p %{restart_flag_dir} echo > %{restart_flag} fi -- cgit v1.2.1