/usr/sbin/crm_master is in pacemaker-cli-utils 1.1.18-0ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 48 49 50 51 52 53 54 | #!/bin/bash
TEMP=`getopt -o qDGQVN:U:v:i:l:r: --long version,help,resource:,node:,uname:,attr-value:,id:,update:,delete-attr,get-value,attr-id:,lifetime:,quiet \
-n 'crm_master' -- "$@"`
if [ $? != 0 ] ; then echo "crm_master - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
while true ; do
case "$1" in
-N|--node|-U|--uname) options="$options $1 $2"; shift; shift;;
-v|--attr-value|--update|-i|--id|--attr-id|-l|--lifetime) options="$options $1 $2"; shift; shift;;
-Q|-q|--quiet|-D|--delete-attr|-G|--get-value|-V) options="$options $1"; shift;;
-r|--resource) OCF_RESOURCE_INSTANCE=$2; shift; shift;;
--version) crm_attribute --version; exit 0;;
--help)
echo "crm_master - A convenience wrapper for crm_attribute";
echo "";
echo "Set, update or delete a resource's promotion score";
echo "";
echo "This program should normally only be invoked from inside an OCF resource agent"
echo "";
echo "Usage: crm_master command [options]";
echo "Options:"
echo " --help This text"
echo " --version Version information"
echo " -V, --verbose Increase debug output"
echo " -q, --quiet Print only the value on stdout"
echo ""
echo "Commands:"
echo " -G, --query Query the current value of the attribute/option"
echo " -v, --update=value Update the value of the attribute/option"
echo " -D, --delete Delete the attribute/option"
echo ""
echo "Additional Options:"
echo " -N, --node=value Set an attribute for the named node (instead of the current one)."
echo " -l, --lifetime=value Until when should the setting take affect."
echo " Valid values: reboot, forever"
echo " -i, --id=value (Advanced) The ID used to identify the attribute"
exit 0;;
--) shift ; break ;;
*) echo "Unknown option: $1. See --help for details." exit 1;;
esac
done
if [ -z "$OCF_RESOURCE_INSTANCE" ]; then
echo "This program should normally only be invoked from inside an OCF resource agent"
echo "To set the promotion/master score from the command line, please specify a resource ID with -r"
exit 1
fi
crm_attribute -n master-$OCF_RESOURCE_INSTANCE $options
|