summaryrefslogtreecommitdiffstats
path: root/abs/core/apache/httpd
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-10-23 18:17:40 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-10-23 18:19:39 (GMT)
commitadbcf19958300e9b6598990184c8815b945ba0ee (patch)
treef4283c850ac0ac202c17e78a637ee7ca8147621b /abs/core/apache/httpd
parent61a68250df10d29b624650948484898334ff22d0 (diff)
downloadlinhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.zip
linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.gz
linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.bz2
Removed old core and extra from repo. Renamed -testing to core/extra. This will setup the base for the testing branch.
Diffstat (limited to 'abs/core/apache/httpd')
-rwxr-xr-xabs/core/apache/httpd65
1 files changed, 45 insertions, 20 deletions
diff --git a/abs/core/apache/httpd b/abs/core/apache/httpd
index da4de25..6fa9c3c 100755
--- a/abs/core/apache/httpd
+++ b/abs/core/apache/httpd
@@ -1,40 +1,65 @@
#!/bin/bash
-# general config
+daemon_name=httpd
+
. /etc/rc.conf
. /etc/rc.d/functions
+APACHECTL=/usr/sbin/apachectl
+
case "$1" in
start)
- stat_busy "Starting HTTP Daemon"
- /usr/sbin/apachectl start &>/dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- else
- add_daemon httpd
+ stat_busy "Starting Apache Web Server"
+ [ ! -d /var/run/httpd ] && install -d /var/run/httpd
+ if $APACHECTL start >/dev/null ; then
+ add_daemon $daemon_name
stat_done
+ else
+ stat_fail
+ exit 1
fi
;;
+
stop)
- stat_busy "Stopping HTTP Daemon"
- /usr/sbin/apachectl stop &>/dev/null
- if [ $? -gt 0 ]; then
- stat_fail
+ stat_busy "Stopping Apache Web Server"
+ if $APACHECTL stop >/dev/null ; then
+ rm_daemon $daemon_name
+ stat_done
else
- rm_daemon httpd
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ reload)
+ stat_busy "Reloading Apache Web Server"
+ if $APACHECTL graceful >/dev/null ; then
+ add_daemon $daemon_name
stat_done
+ else
+ stat_fail
+ exit 1
fi
;;
+
restart)
- $0 stop
- sleep 3
- $0 start
- ;;
- reload)
- if [ -f /var/run/httpd/httpd.pid ]; then
- status "Reloading HTTP Configuration" kill -HUP `cat /var/run/httpd/httpd.pid`
+ stat_busy "Restarting Apache Web Server"
+ if $APACHECTL restart >/dev/null ; then
+ add_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
fi
;;
+
+ status)
+ stat_busy "Checking Apache Web Server status";
+ ck_status $daemon_name
+ ;;
+
*)
- echo "usage: $0 {start|stop|restart|reload}"
+ echo "usage: $0 {start|stop|reload|restart|status}"
esac
+
+exit 0