fix apache starting before postgres or mysql, RT#18983
authorIvan Kohler <ivan@freeside.biz>
Thu, 23 Aug 2012 01:29:34 +0000 (18:29 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 23 Aug 2012 01:29:34 +0000 (18:29 -0700)
Makefile
init.d/insserv-override-apache2 [new file with mode: 0644]

index 4c0f712..208398a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -67,6 +67,7 @@ HTTPD_RESTART = /etc/init.d/apache2 restart
 #(an include directory, not a file, "Include /etc/apache/conf.d" in httpd.conf)
 #deb (3.1+), apache2
 APACHE_CONF = /etc/apache2/conf.d
+INSSERV_OVERRIDE = /etc/insserv/overrides
 
 FREESIDE_RESTART = ${INIT_FILE} restart
 
@@ -272,6 +273,7 @@ install-apache:
              s'%%%MASON_HANDLER%%%'${MASON_HANDLER}'g; \
            " ${APACHE_CONF}/freeside-*.conf \
          ) || true
+       [ -d ${INSSERV_OVERRIDE} ] && [ -x /sbin/insserv ] && ( install -o root -m 755 init.d/insserv-override-apache2 ${INSSERV_OVERRIDE}/apache2 && insserv -d ) || true
 
 install-selfservice:
        [ -e ~freeside ] || cp -pr /etc/skel ~freeside && chown -R freeside ~freeside
diff --git a/init.d/insserv-override-apache2 b/init.d/insserv-override-apache2
new file mode 100644 (file)
index 0000000..1b333e8
--- /dev/null
@@ -0,0 +1,11 @@
+### 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