From ea0c4bd61633d82e36c97a0faebdb082d8fcd5de Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 14 Dec 2015 13:45:18 +0200 Subject: [PATCH] Fixed systemctl commands being called even if it wasn't available On systems where the systemd directories exist but not the systemctl command, installation of MaxScale would cause systemctl to be called. This would print an error when the package is being installed. --- etc/postinst.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/postinst.in b/etc/postinst.in index f37f59f7d..2e25a9730 100755 --- a/etc/postinst.in +++ b/etc/postinst.in @@ -44,7 +44,8 @@ else echo "Could not find ldconfig file: @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.conf" >& 2 fi -if [ -f @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service ] +# Only copy the scripts if systemd folder and systemctl executable are found +if [ -f @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service ] && [ -x "$(which systemctl)" ] then if [ -d "/lib/systemd/system" ] then