5 # Copyright (c) 2009 Barton IT-Consulting
6 # Copyright (c) 2004 SUSE LINUX AG, Lars Marowsky-Brée
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of version 2 of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 # Further, this software is distributed without any warranty that it is
18 # free of the rightful claim of any third person regarding infringement
19 # or the like. Any license provided herein, whether implied or
20 # otherwise, applies only to this software file. Patent licenses, if
21 # any, provided herein do not apply to combinations of this program with
22 # other software, or any other product whatsoever.
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write the Free Software Foundation,
26 # Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
30 . ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
32 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
37 <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
38 <resource-agent name="Apache2">
39 <version>1.1</version>
42 This Resource Agent starts and stops the Apache2 web server.
44 <shortdesc lang="en">Apache2 resource agent</shortdesc>
47 <action name="start" timeout="30" />
48 <action name="stop" timeout="30" />
49 <action name="monitor" timeout="20" interval="30" depth="0" start-delay="10" />
50 <action name="meta-data" timeout="5" />
51 <action name="verify-all" timeout="30" />
57 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
59 if [ -r `dirname "$OCF_RESKEY_configfile"`/envvars ]; then
60 # source Apache2 environment variables
61 . `dirname "$OCF_RESKEY_configfile"`/envvars
65 echo "usage: $0 {start|stop|monitor|validate-all|meta-data}"
70 if [ $? = $OCF_SUCCESS ]; then
71 /usr/sbin/apache2ctl start
72 if [ $? = $OCF_SUCCESS ]; then
76 return $OCF_ERR_GENERIC
80 /usr/sbin/apache2ctl stop
81 if [ $? = $OCF_SUCCESS ]; then
84 return $OCF_ERR_GENERIC
88 /usr/sbin/apache2ctl status | grep "Server Version"
89 if [ $? = $OCF_SUCCESS ]; then
92 return $OCF_NOT_RUNNING
122 exit $OCF_ERR_UNIMPLEMENTED
127 ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"