I'm trying to work out an annoying issue. We have our server setup with nginx as the main front end, and then Apache2 as the backend for running our Perl scripts. I'm fighting through rewriting some of the Perl scripts (as they were used to running on a much older version of Perl), but I'm having a hell of a job with Apache. When I run:
service apache2 stop
It appears to run:
root@admin:/home/user/web/example.com/logs# service apache2 stop
root@admin:/home/user/web/example.com/logs#
But in fact, it still seems to be running! The command its triggering is:
/etc/init.d/apache2 stop
If I run this manually, I get:
root@admin:/home/user/web/example.com/logs# /etc/init.d/apache2 stop
[ ok ] Stopping apache2 (via systemctl): apache2.service.
..yet when I go to the browser and reload the page, it still loads!!!!! (which means Apache is running)
Anyone got any suggestions as to where I could look? Its driving me nuts! Please let me know if you need any more information.
I see a few processes running:
[] ps aux
root 5948 1.4 0.7 307664 91548 ? Ss 13:32 0:00 /usr/sbin/apache2 -k start
www-data 5952 0.8 0.9 371080 111964 ? S 13:32 0:00 /usr/sbin/apache2 -k start
www-data 5953 0.6 0.8 369416 110012 ? S 13:32 0:00 /usr/sbin/apache2 -k start
www-data 5954 0.5 0.8 369416 110012 ? S 13:32 0:00 /usr/sbin/apache2 -k start
www-data 5955 0.6 0.8 369416 110012 ? S 13:32 0:00 /usr/sbin/apache2 -k start
www-data 5956 0.1 0.7 343800 90276 ? S 13:32 0:00 /usr/sbin/apache2 -k start
www-data 5959 0.0 0.6 307688 79692 ? S 13:32 0:00 /usr/sbin/apache2 -k start
UPDATE: As suggested, I tried using this to kill it off:
root@admin:~# pgrep apache2 | xargs kill -9
root@admin:~# pgrep apache2 | xargs kill -9
root@admin:~# pgrep apache2 | xargs kill -9
root@admin:~# pgrep apache2 | xargs kill -9
root@admin:~# pgrep apache2 | xargs kill -9
root@admin:~# pgrep apache2 | xargs kill -9
..but right after, I can see it again! (all with the same pid's)
root@admin:~# ps aux | grep apache
root 6080 0.4 0.7 307724 92052 ? Ss 13:34 0:00 /usr/sbin/apache2 -k start
www-data 6084 0.2 0.8 369400 110024 ? S 13:34 0:00 /usr/sbin/apache2 -k start
www-data 6085 0.2 0.8 369400 110024 ? S 13:34 0:00 /usr/sbin/apache2 -k start
www-data 6086 0.1 0.8 369392 110240 ? S 13:34 0:00 /usr/sbin/apache2 -k start
www-data 6087 0.1 0.8 369400 110024 ? S 13:34 0:00 /usr/sbin/apache2 -k start
www-data 6088 0.1 0.8 369400 110244 ? S 13:34 0:00 /usr/sbin/apache2 -k start
www-data 6400 0.3 0.8 369400 110024 ? S 13:35 0:00 /usr/sbin/apache2 -k start
root 6520 0.0 0.0 14224 972 pts/0 S+ 13:37 0:00 grep apache
UPDATE 2:
root@admin:~# killall -9 apache2
apache2: no process found
root@admin:~# ps aux | grep apache2
root 6977 1.2 0.8 315020 99236 ? Ss 13:41 0:00 /usr/sbin/apache2 -k start
www-data 6981 0.4 0.9 376408 117364 ? S 13:41 0:00 /usr/sbin/apache2 -k start
www-data 6982 0.4 0.9 376408 117364 ? S 13:41 0:00 /usr/sbin/apache2 -k start
www-data 6983 0.4 0.9 376408 117364 ? S 13:41 0:00 /usr/sbin/apache2 -k start
www-data 6984 0.5 0.9 376408 117364 ? S 13:41 0:00 /usr/sbin/apache2 -k start
www-data 6985 0.0 0.7 315044 87100 ? S 13:41 0:00 /usr/sbin/apache2 -k start
www-data 6988 0.0 0.7 315044 87100 ? S 13:41 0:00 /usr/sbin/apache2 -k start
root 7048 0.0 0.0 14224 948 pts/0 S+ 13:42 0:00 grep apache2