]> git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/init.d/apache
apache: sync filesystem after key generating.
[ipfire-2.x.git] / src / initscripts / init.d / apache
1 #!/bin/sh
2 # Begin $rc_base/init.d/apache
3
4 # Based on sysklogd script from LFS-3.1 and earlier.
5 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
6
7 . /etc/sysconfig/rc
8 . $rc_functions
9
10 case "$1" in
11 start)
12 if [ -f /etc/httpd/server.key -a -f /etc/httpd/server.crt -a -f /etc/httpd/server.csr ]; then
13 /usr/local/bin/httpscert read >/dev/null 2>&1
14 else
15 boot_mesg "Generating https host certificate... this may take some minutes..."
16 /usr/local/bin/httpscert new >/dev/null 2>&1
17 sync
18 evaluate_retval
19 fi
20 boot_mesg "Starting Apache daemon..."
21 /usr/sbin/apachectl -k start
22 evaluate_retval
23 ;;
24
25 stop)
26 boot_mesg "Stopping Apache daemon..."
27 /usr/sbin/apachectl -k stop
28 evaluate_retval
29 ;;
30
31 restart)
32 boot_mesg "Restarting Apache daemon..."
33 /usr/sbin/apachectl -k restart
34 evaluate_retval
35 ;;
36
37 reload)
38 boot_mesg "Reloading Apache daemon..."
39 /usr/sbin/apachectl -k graceful
40 evaluate_retval
41 ;;
42
43 status)
44 statusproc /usr/sbin/httpd
45 ;;
46
47 *)
48 echo "Usage: $0 {start|stop|restart|status}"
49 exit 1
50 ;;
51 esac
52
53 # End $rc_base/init.d/apache