[apache2] 01/05: really fix systemd detection

Stefan Fritsch sf at moszumanska.debian.org
Wed Jan 25 23:32:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

sf pushed a commit to branch master
in repository apache2.

commit 7f19c480c9ec73024f7baa9c7b3491f5be0fb12c
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Wed Jan 25 22:36:17 2017 +0100

    really fix systemd detection
    
    I hope...
---
 debian/apache2ctl | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/debian/apache2ctl b/debian/apache2ctl
index 8caa806..f31263b 100755
--- a/debian/apache2ctl
+++ b/debian/apache2ctl
@@ -153,19 +153,26 @@ start)
     # (this is bad if there are several apache2 instances running)
     rm -f ${APACHE_RUN_DIR:-/var/run/apache2}/*ssl_scache*
 
-    case "$(readlink -f /proc/1/exe)" in
-    *systemd*)
+    need_systemd=false
+    if [ -z "$APACHE_STARTED_BY_SYSTEMD" ] ; then
+        case "$(readlink -f /proc/1/exe)" in
+        *systemd*)
+            need_systemd=true
+            ;;
+        *)
+            ;;
+        esac
+    fi
+    if $need_systemd ; then
         # If running on systemd we should not start httpd without systemd
         # or systemd will get confused about the status of httpd.
         echo "Invoking 'systemctl start $APACHE_SYSTEMD_SERVICE'."
         echo "Use 'systemctl status $APACHE_SYSTEMD_SERVICE' for more info."
         systemctl start "$APACHE_SYSTEMD_SERVICE"
-        ;;
-    *)
+    else
         unset APACHE_STARTED_BY_SYSTEMD
         $HTTPD ${APACHE_ARGUMENTS} -k $ARGV
-        ;;
-    esac
+    fi
 
     ERROR=$?
     ;;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-apache/apache2.git



More information about the Pkg-apache-commits mailing list