[ClusterLabs] generic 'initscript' resource agent that passes arguments?

bergman at merctech.com bergman at merctech.com
Mon Aug 29 13:41:11 EDT 2016

I've got a number of scripts that are based on LSB compliant scripts,
but which also accept arguments & values. For example, a script to manage
multiple virtual machines has a command-line in the form:

	vbox_init --vmname $VMNAME [-d|--debug] [start|stop|status|restart]

I'd like to manage these services as cluster resources, ideally without
modifying the existing (tested, functioning) init scripts.

For example, I do not want to create individual vbox_init script with
hard-coded values for the virtual machine name (and I'd strongly prefer
not to do a hack using $0 to lookup the vm name, as in calling the scripts
"vbox_init.$NAME1" and "vbox_init.$NAME2", etc).

Similarly, I don't want to create individual resource agents with
hard-coded values.

Is there an existing varient on the /usr/share/cluster/script.sh resource
that enables passing arbitrary argument+value pairs and flags to the
actual init script? Continuing the above example, the new resource
("scriptArgs") would appear in cluster.conf something like:

                        <scriptArgs file="/usr/local/etc/init.d/vbox_init" name="vbox_init"/>

                <service max_restarts="2" name="fooBarVM" recovery="restart" restart_expire_time="180">
                        <ip ref=""/>
                        <scriptArgs ref="vbox_init" args="--vmname fooBarVM">

                <service max_restarts="2" name="snafuVM" recovery="restart" restart_expire_time="180">
                        <ip ref=""/>
                        <scriptArgs ref="vbox_init" args="--vmname snafuVM --debug">

I'm using CentOS6 and:



More information about the Users mailing list