When restart_on_change runs service restart apache is not waiting for its threads to terminate particularly due to WSGI being involved for openstack-dashboard. When it attempts to restart the ports are already in use and unavailable. This change works around this bug adding a sleep time between stop and start to allow apache time to terminate its threads.