secret
Created

mcollective 2.2.1-1

  • Download Gist
PGKBUILD
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
# Maintainer: Alexander Baldeck <kth5@archlinuxppc.org>
# Contributor: Jochen Schalanda <jochen+aur@schalanda.name>
pkgname=mcollective
pkgver=2.2.1
pkgrel=1
pkgdesc="Framework to build server orchestration or parallel job execution systems"
arch=(any)
url="http://www.puppetlabs.com/mcollective/"
license=('APACHE')
depends=('ruby>=1.9' 'ruby-stomp' 'ruby-systemu')
source=(http://puppetlabs.com/downloads/mcollective/${pkgname}-${pkgver}.tgz
mcollective.init)
md5sums=('f36b754a4f874525d1f4be31e1e4da4a'
'eded4e2a755bb05cbe0a2a52ec84b4c9')
 
build() {
cd "${srcdir}/${pkgname}-$pkgver"
install -d -m0755 ${pkgdir}/usr/lib/ruby/site_ruby/mcollective
install -d -m0755 ${pkgdir}/usr/bin
install -d -m0755 ${pkgdir}/usr/sbin
install -d -m0755 ${pkgdir}/etc/init.d
install -d -m0755 ${pkgdir}/usr/libexec/mcollective/
install -d -m0755 ${pkgdir}/etc/mcollective
install -d -m0755 ${pkgdir}/etc/mcollective/plugin.d
install -d -m0755 ${pkgdir}/etc/mcollective/ssl
install -d -m0755 ${pkgdir}/etc/mcollective/ssl/clients
install -m0755 bin/mcollectived ${pkgdir}/usr/sbin/mcollectived
install -m0755 bin/mc-call-agent ${pkgdir}/usr/sbin/mc-call-agent
install -m0755 bin/mco ${pkgdir}/usr/sbin/mco
install -m0640 etc/server.cfg.dist ${pkgdir}/etc/mcollective/server.cfg
install -m0644 etc/client.cfg.dist ${pkgdir}/etc/mcollective/client.cfg
install -m0444 etc/facts.yaml.dist ${pkgdir}/etc/mcollective/facts.yaml
install -m0444 etc/rpc-help.erb ${pkgdir}/etc/mcollective/rpc-help.erb
install -D -m0755 ${srcdir}/mcollective.init ${pkgdir}/etc/rc.d/mcollective
 
cp -R lib/* ${pkgdir}/usr/lib/ruby/site_ruby/
cp -R plugins/* ${pkgdir}/usr/libexec/mcollective/
}
 
# vim:set ts=2 sw=2 et:
mcollective.init
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
#!/bin/sh
#
# mcollective Application Server for STOMP based agents
#
# chkconfig: 345 24 76
#
# description: mcollective lets you build powerful Stomp compatible middleware clients in ruby without having to worry too
# much about all the setup and management of a Stomp connection, it also provides stats, logging and so forth
# as a bonus.
#
### BEGIN INIT INFO
# Provides: mcollective
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
 
mcollectived="/usr/sbin/mcollectived"
 
# Lockfile
if [ -d /var/lock/subsys ]; then
# RedHat/CentOS/etc who use subsys
lock="/var/lock/subsys/mcollective"
else
# The rest of them
lock="/var/lock/mcollective"
fi
 
 
# PID directory
pidfile="/var/run/mcollectived.pid"
 
# Source function library.
. /lib/lsb/init-functions
 
# Check that binary exists
if ! [ -f $mcollectived ]
then
echo "mcollectived binary not found"
exit 0
fi
 
# See how we were called.
case "$1" in
start)
echo -n "Starting mcollective: "
 
if [ -f ${lock} ]; then
# we were not shut down correctly
if [ -s ${pidfile} ]; then
kill `cat ${pidfile}` >/dev/null 2>&1
fi
rm -f ${pidfile}
 
rm -f ${lock}
sleep 2
fi
 
rm -f ${pidfile}
 
${mcollectived} --pid=${pidfile} --config="/etc/mcollective/server.cfg"
if [ $? = 0 ]; then
log_success_msg
touch $lock
exit 0
else
log_failure_msg
exit 1
fi
;;
stop)
echo -n "Shutting down mcollective: "
 
if [ -s ${pidfile} ]; then
kill `cat ${pidfile}` >/dev/null 2>&1
fi
rm -f ${pidfile}
 
log_success_msg
rm -f $lock
;;
restart)
$0 stop
sleep 2
$0 start
;;
condrestart)
if [ -f $lock ]; then
$0 stop
# avoid race
sleep 2
$0 start
fi
;;
status)
if [ -f ${lock} ]; then
if [ -s ${pidfile} ]; then
if [ -e /proc/`cat ${pidfile}` ]; then
echo "mcollectived (`cat ${pidfile}`) is running"
exit 0
else
echo "mcollectived (`cat ${pidfile}`) is NOT running"
exit 1
fi
fi
else
echo "mcollectived: service not started"
exit 1
fi
;;
force-reload)
echo "not implemented"
;;
*)
echo "Usage: mcollectived {start|stop|restart|condrestart|status}"
exit 1
;;
esac
exit 0

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.