From 549a533e952b25eaaea0b6e2a41959faadcfac55 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sat, 7 Mar 2020 18:36:20 +0100 Subject: [PATCH] M #-: Add missing files for FC. Better IM shepherd --- install.sh | 7 +++++ .../host/beacon/collectd-client-shepherd.sh | 30 ++++++++++++++++++- .../host/beacon/collectd-client-shepherd.sh | 30 ++++++++++++++++++- 3 files changed, 65 insertions(+), 2 deletions(-) mode change 120000 => 100755 src/im_mad/remotes/kvm-probes.d/host/beacon/collectd-client-shepherd.sh mode change 120000 => 100755 src/im_mad/remotes/lxd-probes.d/host/beacon/collectd-client-shepherd.sh diff --git a/install.sh b/install.sh index 35fc8866e0..86bb8b31e7 100755 --- a/install.sh +++ b/install.sh @@ -303,6 +303,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/pm/dummy \ $VAR_LOCATION/remotes/pm/packet \ $VAR_LOCATION/remotes/vmm \ + $VAR_LOCATION/remotes/vmm/lib \ $VAR_LOCATION/remotes/vmm/kvm \ $VAR_LOCATION/remotes/vmm/vcenter \ $VAR_LOCATION/remotes/vmm/ec2 \ @@ -510,6 +511,7 @@ INSTALL_FILES=( PM_EXEC_PACKET_SCRIPTS:$VAR_LOCATION/remotes/pm/packet VMM_EXEC_LIB_VCENTER_FILES:$LIB_LOCATION/ruby/vcenter_driver VMM_EXEC_LIB_NSX_FILES:$LIB_LOCATION/ruby/nsx_driver + VMM_EXEC_LIB:$VAR_LOCATION/remotes/vmm/lib VMM_EXEC_KVM_SCRIPTS:$VAR_LOCATION/remotes/vmm/kvm VMM_EXEC_LXD_SCRIPTS:$VAR_LOCATION/remotes/vmm/lxd VMM_EXEC_LXD_LIB:$VAR_LOCATION/remotes/vmm/lxd @@ -861,6 +863,11 @@ PM_EXEC_PACKET_SCRIPTS="src/pm_mad/remotes/packet/cancel \ src/pm_mad/remotes/packet/reset \ src/pm_mad/remotes/packet/shutdown" +#------------------------------------------------------------------------------- +# Common library files for VMM drivers +#------------------------------------------------------------------------------- +VMM_EXEC_LIB="src/vmm_mad/remotes/lib/command.rb" + #------------------------------------------------------------------------------- # VMM Lib vcenter files, used by the vCenter Driver to be installed in # $REMOTES_LOCATION/vmm/lib/vcenter diff --git a/src/im_mad/remotes/kvm-probes.d/host/beacon/collectd-client-shepherd.sh b/src/im_mad/remotes/kvm-probes.d/host/beacon/collectd-client-shepherd.sh deleted file mode 120000 index 2026e90d1a..0000000000 --- a/src/im_mad/remotes/kvm-probes.d/host/beacon/collectd-client-shepherd.sh +++ /dev/null @@ -1 +0,0 @@ -../../../common.d/collectd-client-shepherd.sh \ No newline at end of file diff --git a/src/im_mad/remotes/kvm-probes.d/host/beacon/collectd-client-shepherd.sh b/src/im_mad/remotes/kvm-probes.d/host/beacon/collectd-client-shepherd.sh new file mode 100755 index 0000000000..c3e92d0b47 --- /dev/null +++ b/src/im_mad/remotes/kvm-probes.d/host/beacon/collectd-client-shepherd.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2019, OpenNebula Project, OpenNebula Systems # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +#--------------------------------------------------------------------------- # + +( +[ -f /tmp/one-collectd-client.pid ] || exit 0 +running_pid=$(cat /tmp/one-collectd-client.pid) +pids=$(ps axuwww | grep "/collectd-client.rb kvm" | grep -v grep | awk '{ print $2 }' | grep -v "^${running_pid}$") + +if [ -n "$pids" ]; then + kill -6 $pids +fi + +) > /dev/null + diff --git a/src/im_mad/remotes/lxd-probes.d/host/beacon/collectd-client-shepherd.sh b/src/im_mad/remotes/lxd-probes.d/host/beacon/collectd-client-shepherd.sh deleted file mode 120000 index 2026e90d1a..0000000000 --- a/src/im_mad/remotes/lxd-probes.d/host/beacon/collectd-client-shepherd.sh +++ /dev/null @@ -1 +0,0 @@ -../../../common.d/collectd-client-shepherd.sh \ No newline at end of file diff --git a/src/im_mad/remotes/lxd-probes.d/host/beacon/collectd-client-shepherd.sh b/src/im_mad/remotes/lxd-probes.d/host/beacon/collectd-client-shepherd.sh new file mode 100755 index 0000000000..3bb7e5b2d3 --- /dev/null +++ b/src/im_mad/remotes/lxd-probes.d/host/beacon/collectd-client-shepherd.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2019, OpenNebula Project, OpenNebula Systems # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +#--------------------------------------------------------------------------- # + +( +[ -f /tmp/one-collectd-client.pid ] || exit 0 +running_pid=$(cat /tmp/one-collectd-client.pid) +pids=$(ps axuwww | grep "/collectd-client.rb lxd" | grep -v grep | awk '{ print $2 }' | grep -v "^${running_pid}$") + +if [ -n "$pids" ]; then + kill -6 $pids +fi + +) > /dev/null +