Fixing postrotate apache script.

- logrotate should not execute any self healing actions
- logrotate should respect service stopped state
- logrotate should get pid from pidfile and send USR1 kill
  signal to gracefully reload running apache workers

Prod-Related: PROD-19346
Prod-Related: PROD-32539
Change-Id: Ife1dd70d4711aab09c20bc767fc539f7031dbb18
diff --git a/apache/meta/logrotate.yml b/apache/meta/logrotate.yml
index 7fd6e20..0d297f9 100644
--- a/apache/meta/logrotate.yml
+++ b/apache/meta/logrotate.yml
@@ -11,12 +11,4 @@
         - delaycompress
         - notifempty
         - sharedscripts
-        - prerotate:
-              RANDOM=$(( $(dd if=/dev/urandom bs=2 count=1 2> /dev/null | cksum | cut -d' ' -f1) % 32767 ));
-              RANDOM_START={{ server.logrotate.start_period }};
-              RANDOM_END={{ server.logrotate.end_period }};
-              RANGE=$(( $RANDOM_END - $RANDOM_START ));
-              RESULT=$(( $RANDOM % $RANGE));
-              RESULT=$(( $RESULT + $RANDOM_START ));
-              sleep $RESULT
-        - postrotate: "if /etc/init.d/apache2 status > /dev/null; then (/usr/sbin/apachectl graceful > /dev/null) || (/usr/sbin/apachectl restart > /dev/null); fi"
+        - postrotate: "test -f /var/run/apache2/apache2.pid && kill -USR1 $(cat /var/run/apache2/apache2.pid)"