Sha256: 704338e0cf7607ffd20d2725d6f68fc4b82c82c1ca259990d840aa378e0b05cb

Contents?: true

Size: 1.72 KB

Versions: 44

Compression:

Stored size: 1.72 KB

Contents

#!/bin/bash
# Copyright:: Copyright (c) 2014 eGlobalTech, Inc., all rights reserved
#
# Licensed under the BSD-3 license (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the root of the project or at
#
#     http://egt-labs.com/mu/LICENSE.html
#
# 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.
#
# mu-gluster-client		Mounts <%= @path %>
#
# chkconfig: 2345 55 25
# description: Mounts <%= @path %>
#

### BEGIN INIT INFO
# Provides: mu-cluster-client
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mount glusterfs mounts
# Description:       Mount glusterfs mounts
### END INIT INFO

# source function library
. /etc/rc.d/init.d/functions

RETVAL=0

start()
{
	if ! grep ":<%= @volume %> <%= @path %> fuse.glusterfs" /etc/mtab > /dev/null;then
		mount -t glusterfs <%= @servers.map { |server| server.ec2.private_ip_address }.join(',') %>:<%= "#{@volume} #{@path}" %> || exit 1
		#<%= @servers.map { |server| "mount -t glusterfs #{server.ec2.private_ip_address}:#{@volume} #{@path}" }.join(' || ') %> || exit 1
	fi
}

stop()
{
	if grep ":<%= @volume %> <%= @path %> fuse.glusterfs" /etc/mtab > /dev/null;then
		umount <%= @path %>
	fi
}

restart() {
	stop
	start
}

case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart)
		restart
		;;
	*)
		echo $"Usage: $0 {start|stop|restart}"
		RETVAL=2
esac
exit $RETVAL

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
cloud-mu-3.6.10 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.6.9 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.6.8 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.6.7 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.6.5 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.6.4 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.6.3 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.5.1 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.5.0 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.4.0 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.3.2 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.3.1 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.3.0 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.2.0 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.1.6 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.1.5 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.1.4 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.1.3 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.1.2 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
cloud-mu-3.1.2beta2 cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb