#!/sbin/openrc-run

description="Apache2 http server daemon"
HTTPD=apachectl
HTTPD_OPTS=""
PIDFILE=/var/run/apache2.pid
TIMEOUT=5

depend() {
	need net
	use mysql dns logger netmount postgresql
	after sshd firewall
}

start() {

	ebegin "Starting ${SVCNAME}"
        rm -f ${PIDFILE}
	start-stop-daemon --start \
		--pidfile ${PIDFILE} \
		--exec ${HTTPD} \
		-- ${HTTPD_OPTS} -k start
	eend $?
}

stop() {
	ebegin "Stopping ${SVCNAME}"
	start-stop-daemon --stop --pidfile ${PIDFILE} --exec ${HTTPD} \
		--retry ${TIMEOUT}
	eend $?
}
