diff --git a/Shorewall-core/configure b/Shorewall-core/configure index 046790459..6fb055198 100755 --- a/Shorewall-core/configure +++ b/Shorewall-core/configure @@ -195,6 +195,10 @@ elif [ -n "${options[VARDIR]}" ]; then fi fi +if [ -z "${options[SYSTEMDDIR]}" ]; then + $options[SYSTEMDDIR]="${options[SYSTEMD]}" +fi + for on in \ HOST \ PREFIX \ @@ -209,7 +213,7 @@ for on in \ INITFILE \ AUXINITSOURCE \ AUXINITFILE \ - SYSTEMD \ + SYSTEMDDIR \ SERVICEFILE \ SYSCONFFILE \ SYSCONFDIR \ diff --git a/Shorewall-core/configure.pl b/Shorewall-core/configure.pl index afe078a6f..8ddec6852 100755 --- a/Shorewall-core/configure.pl +++ b/Shorewall-core/configure.pl @@ -154,6 +154,8 @@ if ( $options{VARLIB} ) { $options{VARDIR} = '${VARLIB}/${PRODUCT}'; } +$options{SYSTEMDDIR}=$options{SYSTEMD} unless $options{SYSTEMDDIR}; + for ( qw/ HOST PREFIX SHAREDIR @@ -167,7 +169,7 @@ for ( qw/ HOST INITFILE AUXINITSOURCE AUXINITFILE - SYSTEMD + SYSTEMDDIR SERVICEFILE SYSCONFFILE SYSCONFDIR diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index 152d03e9c..af635bf76 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -329,9 +329,13 @@ if [ -n "${SYSCONFDIR}" ]; then chmod 755 ${DESTDIR}${SYSCONFDIR} fi -if [ -n "${SYSTEMD}" ]; then - mkdir -p ${DESTDIR}${SYSTEMD} - chmod 755 ${DESTDIR}${SYSTEMD} +if [ -z "${SYSTEMDDIR}" ]; then + SYSTEMDDIR="$SYSTEMD" +fi + +if [ -n "${SYSTEMDDIR}" ]; then + mkdir -p ${DESTDIR}${SYSTEMDDIR} + chmod 755 ${DESTDIR}${SYSTEMDDIR} fi mkdir -p ${DESTDIR}${SBINDIR} diff --git a/Shorewall-core/shorewallrc.apple b/Shorewall-core/shorewallrc.apple index e7ced9077..eb422a4ff 100644 --- a/Shorewall-core/shorewallrc.apple +++ b/Shorewall-core/shorewallrc.apple @@ -14,7 +14,7 @@ INITDIR= #Unused on OS X INITFILE= #Unused on OS X INITSOURCE= #Unused on OS X ANNOTATED= #Unused on OS X -SYSTEMD= #Unused on OS X +SYSTEMDDIR= #Unused on OS X SERVICEFILE= #Unused on OS X SYSCONFDIR= #Unused on OS X SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR. diff --git a/Shorewall-core/shorewallrc.archlinux b/Shorewall-core/shorewallrc.archlinux index 725d6db9b..dd1375d80 100644 --- a/Shorewall-core/shorewallrc.archlinux +++ b/Shorewall-core/shorewallrc.archlinux @@ -15,7 +15,7 @@ INITFILE= #Name of the product's installed SysV ini INITSOURCE= #Name of the distributed file to be installed as the SysV init script ANNOTATED= #If non-zero, annotated configuration files are installed SYSCONFDIR= #Directory where SysV init parameter files are installed -SYSTEMD=/usr/lib/systemd/system #Directory where .service files are installed (systems running systemd only) +SYSTEMDDIR=/usr/lib/systemd/system #Directory where .service files are installed (systems running systemd only) SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/var/lib #Directory where product variable data is stored. diff --git a/Shorewall-core/shorewallrc.cygwin b/Shorewall-core/shorewallrc.cygwin index e3f477169..72994d46e 100644 --- a/Shorewall-core/shorewallrc.cygwin +++ b/Shorewall-core/shorewallrc.cygwin @@ -14,7 +14,7 @@ INITDIR=/etc/init.d #Unused on Cygwin INITFILE= #Unused on Cygwin INITSOURCE= #Unused on Cygwin ANNOTATED= #Unused on Cygwin -SYSTEMD= #Unused on Cygwin +SYSTEMDDIR= #Unused on Cygwin SERVICEFILE= #Unused on Cygwin SYSCONFDIR= #Unused on Cygwin SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR. diff --git a/Shorewall-core/shorewallrc.debian b/Shorewall-core/shorewallrc.debian index e814a8a91..345aff337 100644 --- a/Shorewall-core/shorewallrc.debian +++ b/Shorewall-core/shorewallrc.debian @@ -17,7 +17,7 @@ ANNOTATED= #If non-zero, annotated configuration fi SYSCONFFILE=default.debian #Name of the distributed file to be installed in $SYSCONFDIR SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service SYSCONFDIR=/etc/default #Directory where SysV init parameter files are installed -SYSTEMD= #Directory where .service files are installed (systems running systemd only) +SYSTEMDDIR= #Directory where .service files are installed (systems running systemd only) SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/var/lib #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. diff --git a/Shorewall-core/shorewallrc.default b/Shorewall-core/shorewallrc.default index 1d7e89906..5f875bad0 100644 --- a/Shorewall-core/shorewallrc.default +++ b/Shorewall-core/shorewallrc.default @@ -14,7 +14,7 @@ INITDIR=/etc/init.d #Directory where SysV init scripts are i INITFILE=$PRODUCT #Name of the product's installed SysV init script INITSOURCE=init.sh #Name of the distributed file to be installed as the SysV init script ANNOTATED= #If non-zero, annotated configuration files are installed -SYSTEMD= #Directory where .service files are installed (systems running systemd only) +SYSTEMDDIR= #Directory where .service files are installed (systems running systemd only) SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR SYSCONFDIR= #Directory where SysV init parameter files are installed diff --git a/Shorewall-core/shorewallrc.redhat b/Shorewall-core/shorewallrc.redhat index 2960dec4a..dfc8d1189 100644 --- a/Shorewall-core/shorewallrc.redhat +++ b/Shorewall-core/shorewallrc.redhat @@ -14,7 +14,7 @@ INITDIR=/etc/rc.d/init.d #Directory where SysV init scripts are i INITFILE=$PRODUCT #Name of the product's installed SysV init script INITSOURCE=init.fedora.sh #Name of the distributed file to be installed as the SysV init script ANNOTATED= #If non-zero, annotated configuration files are installed -SYSTEMD=/lib/systemd/system #Directory where .service files are installed (systems running systemd only) +SYSTEMDDIR=/lib/systemd/system #Directory where .service files are installed (systems running systemd only) SYSCONFFILE=sysconfig #Name of the distributed file to be installed as $SYSCONFDIR/$PRODUCT SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter files are installed diff --git a/Shorewall-core/shorewallrc.slackware b/Shorewall-core/shorewallrc.slackware index e0dd0a8ce..4a9a0b0b9 100644 --- a/Shorewall-core/shorewallrc.slackware +++ b/Shorewall-core/shorewallrc.slackware @@ -15,7 +15,7 @@ AUXINITSOURCE=init.slackware.firewall.sh #Name of the distributed file to be i AUXINITFILE=rc.firewall #Name of the product's installed SysV init script INITSOURCE=init.slackware.$PRODUCT.sh #Name of the distributed file to be installed as a second SysV init script INITFILE=rc.$PRODUCT #Name of the product's installed second init script -SYSTEMD= #Name of the directory where .service files are installed (systems running systemd only) +SYSTEMDDIR= #Name of the directory where .service files are installed (systems running systemd only) SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR SYSCONFDIR= #Name of the directory where SysV init parameter files are installed. diff --git a/Shorewall-core/shorewallrc.suse b/Shorewall-core/shorewallrc.suse index 558180364..54f35e69a 100644 --- a/Shorewall-core/shorewallrc.suse +++ b/Shorewall-core/shorewallrc.suse @@ -14,7 +14,7 @@ INITDIR=/etc/init.d #Directory where SysV init INITFILE=$PRODUCT #Name of the product's SysV init script INITSOURCE=init.suse.sh #Name of the distributed file to be installed as the SysV init script ANNOTATED= #If non-zero, annotated configuration files are installed -SYSTEMD= #Directory where .service files are installed (systems running systemd only) +SYSTEMDDIR= #Directory where .service files are installed (systems running systemd only) SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service SYSCONFFILE=sysconfig #Name of the distributed file to be installed in $SYSCONFDIR SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter files are installed diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index f3709978e..0f37b5707 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -330,12 +330,16 @@ fi # # Install the .service file # -if [ -n "$SYSTEMD" ]; then - mkdir -p ${DESTDIR}${SYSTEMD} +if [ -z "${SYSTEMDDIR}" ]; then + SYSTEMDDIR="$SYSTEMD" +fi + +if [ -n "$SYSTEMDDIR" ]; then + mkdir -p ${DESTDIR}${SYSTEMDDIR} [ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service - run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service - [ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service - echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service" + run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service + [ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service + echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service" if [ -n "$DESTDIR" ]; then mkdir -p ${DESTDIR}${SBINDIR} chmod 755 ${DESTDIR}${SBINDIR} @@ -515,7 +519,7 @@ if [ -z "$DESTDIR" ]; then # not by the installer /bin/true else - if [ -n "$SYSTEMD" ]; then + if [ -n "$SYSTEMDDIR" ]; then if systemctl enable shorewall-init.service; then echo "Shorewall Init will start automatically at boot" fi diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index abb74c0cd..3cc17033b 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -392,12 +392,16 @@ fi # # Install the .service file # -if [ -n "$SYSTEMD" ]; then - mkdir -p ${DESTDIR}${SYSTEMD} +if [ -z "${SYSTEMDDIR}" ]; then + SYSTEMDDIR="$SYSTEMD" +fi + +if [ -n "$SYSTEMDDIR" ]; then + mkdir -p ${DESTDIR}${SYSTEMDDIR} [ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service - run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service - [ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service - echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service" + run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service + [ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service + echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service" fi # # Install the config file @@ -539,7 +543,7 @@ if [ ${SHAREDIR} != /usr/share ]; then fi if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then - if [ -n "$SYSTEMD" ]; then + if [ -n "$SYSTEMDDIR" ]; then if systemctl enable ${PRODUCT}.service; then echo "$Product will start automatically at boot" fi diff --git a/Shorewall/install.sh b/Shorewall/install.sh index 9761d636e..147a27013 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -425,12 +425,16 @@ fi # # Install the .service file # -if [ -n "$SYSTEMD" ]; then - mkdir -p ${DESTDIR}${SYSTEMD} +if [ -z "${SYSTEMDDIR}" ]; then + SYSTEMDDIR="$SYSTEMD" +fi + +if [ -n "$SYSTEMDDIR" ]; then + mkdir -p ${DESTDIR}${SYSTEMDDIR} [ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service - run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service - [ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service - echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service" + run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service + [ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service + echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMDDIR}/$PRODUCT.service" fi # @@ -1176,7 +1180,7 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PR fi if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then - if [ -n "$SYSTEMD" ]; then + if [ -n "$SYSTEMDDIR" ]; then if systemctl enable ${PRODUCT}.service; then echo "$Product will start automatically at boot" fi