3 # OCF RA for User Mode Linux (UML) guests
5 # Copyright (c) 2007-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 export PATH="$PATH:/opt/uml/bin"
34 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
39 <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
40 <resource-agent name="UML">
41 <version>1.1</version>
44 This Resource Agent starts and stops User Mode Linux (UML) guests.
46 <shortdesc lang="en">User Mode Linux (UML) resource agent</shortdesc>
49 <parameter name="umlid" unique="1">
50 <longdesc lang="en">ID of the UML guest</longdesc>
51 <shortdesc lang="en">ID of the UML guest</shortdesc>
52 <content type="string" default="" />
57 <action name="start" timeout="120" />
58 <action name="stop" timeout="90" />
59 <action name="monitor" timeout="20" interval="30" depth="0" start-delay="10" />
60 <action name="meta-data" timeout="5" />
61 <action name="verify-all" timeout="30" />
67 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
70 echo "usage: $0 {start|stop|monitor|validate-all|meta-data}"
74 uml-start "$OCF_RESKEY_umlid"
75 if [ $? = $OCF_SUCCESS ]; then
78 return $OCF_ERR_GENERIC
82 uml-stop "$OCF_RESKEY_umlid"
83 if [ $? = $OCF_SUCCESS ]; then
86 return $OCF_ERR_GENERIC
90 uml-list "$OCF_RESKEY_umlid"
91 if [ $? = $OCF_SUCCESS ]; then
94 return $OCF_NOT_RUNNING
98 if [ -z "$OCF_RESKEY_umid" ]; then
104 case $__OCF_ACTION in
127 exit $OCF_ERR_UNIMPLEMENTED
132 ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"