Skip to content

Commit

Permalink
* Added Gentoo related installation document.
Browse files Browse the repository at this point in the history
* Added Gentoo init scripts for vpoller-proxy and vpoller-worker.
  • Loading branch information
blackcobra1973 committed Aug 22, 2014
1 parent 5e5c7cd commit db7295d
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.gentoo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Dependencies:

- Make sure you have python 2.7 installed on your system

- Unmask the following packages:

net-libs/zeromq
dev-libs/libsodium (required for version 4.x of zeromq)
dev-python/docopt
dev-python/tabulate

- Emerge the packages:

emerge pyzmq docopt tabulate zeromq jq

- Switch to python 2.7 to install the manually requirements for the right python or use the right python binary.

- Install pyVmomi

git clone https://github.com/vmware/pyvmomi.git

cd pyvmomi
python2.7 setup.py install

- Install pv-vconnector

git clone https://github.com/dnaeon/py-vconnector.git

cd py-vconnector
python2.7 setup.py install

- Create needed directories:

mkdir /var/lib/vconnector /var/log/vpoller /var/log/vconnector /etc/vpoller /var/run/vpoller

- Install py-vpoller

git clone https://github.com/blackcobra1973/py-vpoller.git

cd py-vpoller
python2.7 setup.py install

cp src/conf/vpoller.conf /etc/vpoller/

- Compile the c-client

cd src/vpoller-cclient/
make
mv vpoller-cclient /usr/local/bin/

- Install init scripts

cp src/init.d/vpoller-proxy.gentoo /etc/init.d/vpoller-proxy
cp src/init.d/vpoller-worker.gentoo /etc/init.d/vpoller-worker
9 changes: 9 additions & 0 deletions src/conf/vpoller.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[proxy]
frontend = tcp://*:10123
backend = tcp://*:10124
mgmt = tcp://*:9999

[worker]
db = /var/lib/vconnector/vconnector.db
proxy = tcp://localhost:10124
mgmt = tcp://*:10000
53 changes: 53 additions & 0 deletions src/init.d/vpoller-proxy.gentoo
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

. /etc/init.d/functions.sh

extra_started_commands="fullstatus"

description_fullstatus="Gives the full status of the server."

DESC="vpoller-proxy daemon"
DAEMON=/usr/bin/vpoller-proxy
MGMT_INTERFACE="tcp://localhost:9999"
CONF_DIR=/etc/vpoller
CONF_FILE=${CONF_DIR}/vpoller.conf
PID_DIR=/var/run/vpoller
LOG_DIR=/var/log/vpoller

depend() {
use logger net
}

checkconfig() {
checkpath --directory ${PID_DIR}
checkpath --directory ${LOG_DIR}
}

start() {
checkconfig || return 1

ebegin "Starting ${DESC}"
if [ ! -d ${CONF_DIR} ]; then
eend 1 "${CONF_DIR} does not exist"
return 1
fi
if [ ! -f ${CONF_FILE} ]; then
eend 1 "${CONF_FILE} does not exist"
return 1
fi
$DAEMON -d start >/dev/null 2>&1
eend $?
}

stop() {
ebegin "Stopping ${DESC}"
${DAEMON} -e ${MGMT_INTERFACE} stop >/dev/null 2>&1
eend
}

fullstatus() {
${DAEMON} -e ${MGMT_INTERFACE} status
}

54 changes: 54 additions & 0 deletions src/init.d/vpoller-worker.gentoo
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

. /etc/init.d/functions.sh

extra_started_commands="fullstatus"

description_fullstatus="Gives the full status of the server."

DESC="vpoller-worker daemon"
DAEMON=/usr/bin/vpoller-worker
MGMT_INTERFACE="tcp://localhost:10000"
CONF_DIR=/etc/vpoller
CONF_FILE=${CONF_DIR}/vpoller.conf
PID_DIR=/var/run/vpoller
LOG_DIR=/var/log/vpoller

depend() {
use logger net
after vpoller-proxy
}

checkconfig() {
checkpath --directory ${PID_DIR}
checkpath --directory ${LOG_DIR}
}

start() {
checkconfig || return 1

ebegin "Starting ${DESC}"
if [ ! -d ${CONF_DIR} ]; then
eend 1 "${CONF_DIR} does not exist"
return 1
fi
if [ ! -f ${CONF_FILE} ]; then
eend 1 "${CONF_FILE} does not exist"
return 1
fi
$DAEMON -d start >/dev/null 2>&1
eend $?
}

stop() {
ebegin "Stopping ${DESC}"
${DAEMON} -e ${MGMT_INTERFACE} stop >/dev/null 2>&1
eend
}

fullstatus() {
${DAEMON} -e ${MGMT_INTERFACE} status
}

0 comments on commit db7295d

Please sign in to comment.