From 21989f7a160f294043257893614d10d8daa4fdfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 5 Feb 2020 15:31:17 +0200 Subject: [PATCH] MXS-2777: Fix installation directory The drop-in directory must be created in /etc. --- etc/postinst.in | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/etc/postinst.in b/etc/postinst.in index d3bd4e947..7cc2435b2 100755 --- a/etc/postinst.in +++ b/etc/postinst.in @@ -46,15 +46,23 @@ then if [ -d "/lib/systemd/system" ] then cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /lib/systemd/system - mkdir -p /lib/systemd/system/maxscale.service.d systemctl daemon-reload elif [ -d "/usr/lib/systemd/system" ] then cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /usr/lib/systemd/system - mkdir -p /usr/lib/systemd/system/maxscale.service.d systemctl daemon-reload fi + # Remove old directories, mistakenly installed by a few versions + if [ -d /lib/systemd/system/maxscale.service.d ] + then + rmdir /lib/systemd/system/maxscale.service.d + elif [ -d /usr/lib/systemd/system/maxscale.service.d ] + then + rmdir /lib/systemd/system/maxscale.service.d + fi + + mkdir -p /etc/systemd/system/maxscale.service.d systemctl enable maxscale.service else if [ -d "/etc/init/" ] && [ -f "@CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/upstart/maxscale.conf" ]