From 72066a4262325545f6ac190ef0abfcda186c5d2c Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 22 May 2015 14:12:40 +0300 Subject: [PATCH] Added a conditional for systemd script installation and changed directory rights for the maxscale user. --- etc/postinst.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/etc/postinst.in b/etc/postinst.in index dca7215df..abf2db1ef 100755 --- a/etc/postinst.in +++ b/etc/postinst.in @@ -24,9 +24,16 @@ chown maxscale:maxscale @MAXSCALE_VARDIR@/log/maxscale chown maxscale:maxscale @MAXSCALE_VARDIR@/lib/maxscale chown maxscale:maxscale @MAXSCALE_VARDIR@/cache/maxscale chown maxscale:maxscale @MAXSCALE_VARDIR@/run/maxscale +chmod 0755 @MAXSCALE_VARDIR@/log/maxscale +chmod 0755 @MAXSCALE_VARDIR@/lib/maxscale +chmod 0755 @MAXSCALE_VARDIR@/cache/maxscale +chmod 0755 @MAXSCALE_VARDIR@/run/maxscale # Copy init.d script and ldconfig file cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale /etc/init.d/ cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.conf /etc/ld.so.conf.d/ -cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /usr/lib/systemd/system +if [ -d "/usr/lib/systemd/system" ] +then + cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /usr/lib/systemd/system +fi /sbin/ldconfig