Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > dba5202f9855ab5ab578f7251a21d2fd > files > 3

oar-common-2.4.3-1.mga1.noarch.rpm

#!/bin/sh
# oarnodesetting_ssh: oarnodesetting SSH wrapper
# $Id$
# This script is to be called from the node via SSH so that the server performs 
# the oarnodesetting command and changes the state of the calling node.
#
# NB:
# 1- To get this script working, the oar ressource database table must have a  
# `ip' field containing the IP address for all the nodes
# 2- A dedicated SSH key may be configured to restrict the ssh call capability
# from the nodes to the server, by modifying the authorized_keys of oar on the
# serveur as follows:
# command="/usr/lib/oar/oarnodesetting_ssh" [dediacted pub key info]...
# 
# Warning: if $IP does not exist in the database or every corresponding
#          resource states are 'Dead' then this script will return an exit code
#          of 12 not 0 (this is the default behaviour of "oarnodesetting").

IP=$(echo $SSH_CONNECTION | cut -d " " -f 1 )
OARNODESETTINGCMD=/usr/sbin/oarnodesetting
[ -n "$IP" ] || exit 1
# Uncomment if you think that you need core/cpuset matching based on /proc/cpuinfo
#/etc/oar/update_cpuset_id.sh $IP
exec $OARNODESETTINGCMD -s Alive --sql "ip = '$IP' AND state != 'Dead'"
exit 1