"/etc/init.d/apache2 restart" can become totally confused about apache2's state if apache2 does not shutdown fast enough. "apache2 -k stop" can return before apache2 is fully stopped. The following patch fixes this behaviour by ensuring that apache2 has no processes left running. As I am no gentoo runscript.sh expert, there are some todos left but it should give the clue and is in productive usage on our servers.
Created attachment 95480 [details, diff] patch to check apache2 shutdown state /etc/init.d/apache2
*** This bug has been marked as a duplicate of 110556 ***