#HTTPD_RESTART = /usr/local/apache/bin/apachectl stop; sleep 10; /usr/local/apache/bin/apachectl startssl
#(an include directory, not a file, "Include /etc/apache/conf.d" in httpd.conf)
-#deb (3.1+), apache2
-#APACHE_CONF = /etc/apache2/conf.d
#debian unstable/8.0+, apache2.4
-#APACHE_CONF = /etc/apache2/conf-available
-APACHE_CONF := $(shell [ ${APACHE_VERSION} = '2.4' ] && echo '/etc/apache2/conf-available' || echo '/etc/apache2/conf.d')
-
-INSSERV_OVERRIDE = /etc/insserv/overrides
+APACHE_CONF = /etc/apache2/conf-available
FREESIDE_RESTART = ${INIT_FILE} restart
s'%%%MASON_HANDLER%%%'${MASON_HANDLER}'g; \
" ${APACHE_CONF}/freeside-*.conf \
) || true
- [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && ( /usr/sbin/a2enconf freeside-base${APACHE_VERSION} ) || true
- [ -d ${APACHE_CONF} ] && [ ${APACHE_VERSION} = '2.4' ] && [ -x /usr/sbin/a2disconf ] && ( /usr/sbin/a2disconf freeside-base2 ) || true
+ [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && ( /usr/sbin/a2enconf freeside-base2.4 ) || true
+ [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2disconf ] && ( /usr/sbin/a2disconf freeside-base2 ) || true
[ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && [ ${RT_ENABLED} -eq 1 ] && ( /usr/sbin/a2enconf freeside-rt ) || true
- [ -d ${INSSERV_OVERRIDE} ] && [ -x /sbin/insserv ] && ( install -o root -m 755 init.d/insserv-override-apache2 ${INSSERV_OVERRIDE}/apache2 && insserv -d ) || true
+ [ -x /usr/sbin/systemctl ] && mkdir /etc/systemd/system/apache.d/ || true
+ [ -x /usr/sbin/systemctl ] && ( install -o root -m 755 init.d/systemd-apache-override.conf /etc/systemd/system/apache2.d/override.conf && /usr/sbin/systemctl daemon-reload ) || true
install-selfservice:
[ -e ~freeside ] || cp -pr /etc/skel ~freeside && chown -R freeside ~freeside
--- /dev/null
+/usr/local/etc/freeside/profile
+/etc/systemd/system/apache2.d
chown -R freeside /usr/local/etc/freeside
rm -fr /usr/local/etc/freeside/masondata/*
-#XXX systemd equivalent (start apache after postgres)
-/sbin/insserv -d
+/usr/sbin/a2dismod mpm_event || /bin/true
+/usr/sbin/a2dismod mpm_worker || /bin/true
+/usr/sbin/a2enmod mpm_prefork
+#/usr/sbin/service restart apache2
+
+/usr/bin/systemctl daemon-reload
exit 0
install -d $(FREESIDE_DOCUMENT_ROOT)
install -d $(TMP)-webui/usr/local/etc/freeside/
- install -d $(TMP)-webui/etc/insserv/overrides/
+ install -d $(TMP)-webui/etc/systemd/system/apache2.d/
install -d $(TMP)/usr/local/etc/freeside/
install -d $(FREESIDE_CACHE)/masondata #MASONDATA
# install -d $(TMP)-lib/usr/bin
# Create Apache configurations
install -d $(APACHE_CONF)
$(MAKE) -e DESTDIR=$(APACHE_CONF) install-apache
- install -o root -m 755 init.d/insserv-override-apache2 $(TMP)-webui/etc/insserv/overrides/apache2
+ install -o root -m 755 init.d/systemd-apache-override.conf $(TMP)-webui/etc/systemd/system/apache2.d/override.conf
#Hack the build dir out of apache config
+++ /dev/null
-### BEGIN INIT INFO
-# Provides: apache2
-# Required-Start: $local_fs $remote_fs $network $syslog $named
-# Required-Stop: $local_fs $remote_fs $network $syslog $named
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# X-Interactive: true
-# Short-Description: Start/stop apache2 web server
-# Should-Start: postgresql mysql
-# Should-Stop: postgresql mysql
-### END INIT INFO
--- /dev/null
+[Unit]
+After=postgresql.service