summaryrefslogtreecommitdiffstats
path: root/source/n/httpd/rc.httpd
blob: afacffb34463c6c8a858ff4f9f7c56bc280fc41f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#
# /etc/rc.d/rc.httpd
#
# Start/stop/force-restart/restart/graceful[ly restart]/graceful[ly]-stop
# the Apache (httpd) web server.
#
# To make Apache start automatically at boot, make this
# file executable:  chmod 755 /etc/rc.d/rc.httpd
#
# For information on these options, "man apachectl".

case "$1" in
  'start')
    /usr/sbin/apachectl -k start
  ;;
  'stop')
    if [ ! -r /run/httpd.pid ]; then
      pkill -f /usr/sbin/httpd
    else
      /usr/sbin/apachectl -k stop
    fi
    pwait -f /usr/sbin/httpd
  ;;
  'force-restart')
    if [ ! -r /run/httpd.pid ]; then
      pkill -f /usr/sbin/httpd
    else
      /usr/sbin/apachectl -k stop
    fi
    pwait -f /usr/sbin/httpd
    /usr/sbin/apachectl -k start
  ;;
  'restart')
    /usr/sbin/apachectl -k restart
  ;;
  'graceful')
    /usr/sbin/apachectl -k graceful
  ;;
  'graceful-stop')
    /usr/sbin/apachectl -k graceful-stop
  ;;
  *)
    echo "Usage: $0 {start|stop|force-restart|restart|graceful|graceful-stop}"
  ;;
esac