From bed6666338a32f2a80de02c5befef2fe81a5791a Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 26 Oct 2015 22:13:33 +0200 Subject: [PATCH] Fix to MXS-367: https://mariadb.atlassian.net/browse/MXS-367 Template config file is copied as maxscale.cnf if no configuration file is found. If /etc/maxscale.cnf is not found, the /etc/maxscale.cnf.template will be copied as /etc/maxscale.cnf. This allows MaxScale to start right after installation if combined with a running and properly configured server. --- etc/postinst.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etc/postinst.in b/etc/postinst.in index dd2b0c11e..93cc768ec 100755 --- a/etc/postinst.in +++ b/etc/postinst.in @@ -46,6 +46,13 @@ then cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /usr/lib/systemd/system systemctl daemon-reload fi + +# If no maxscale.cnf file is found in /etc, copy the template file there +if [ ! -f "@MAXSCALE_CONFDIR@/maxscale.cnf" ] +then + cp -n @MAXSCALE_CONFDIR@/maxscale.cnf.template @MAXSCALE_CONFDIR@/maxscale.cnf +fi + /sbin/ldconfig cat <& 2