Installing Punjab connection manager
Using Punjab is optional and is useful to manage XMPP connections. Punjab is a HTTP jabber client interface. It is a BOSH connection manager that allows persistent client connections to a XMPP server. It is supported only on Linux.
Install Punjab for connection manager.
- Download the installation files available at http://github.com/twonds/punjab
- Untar the punjab-X.X.tar.gz file in a directory you want Punjab to reside.
shell>tar vxzf punjab-X.X.tar.gz - Run setup to install.
shell>python setup.py install - Run punjab
shell>twistd punjab
Run "twistd punjab --help" for options.
To create a Punjab service, create a Punjab file in /etc/init.d/ and add the following script to the Punjab file:
#!/bin/sh
ROOT_DIR="/opt/punjab-master"
get_punjab_pid() {
echo `ps aux | grep "punjab" | grep $ROOT_DIR | grep -v grep | awk '{ print $2 }'`
}
do_start()
{
pid=$(get_punjab_pid)
if [ -z $pid ] ; then
echo -n $"Starting Punjab "
twistd -y $ROOT_DIR/punjab.tac && echo "Started !"|| echo "Failed!"
RETVAL=$?
else
echo "Punjab is running with PID : $pid"
RETVAL=1
fi
}
do_stop()
{
echo -n $"Stopping $SERVER: "
pid=$(get_punjab_pid)
kill -9 $pid > /dev/null 2>&1 && echo "Punjab is stopped" || echo "Failed to stop punjab!"
RETVAL=$?
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
do_start
;;
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVALTo start Punjab: /etc/init.d/punjab start
To stop punjab : /etc/init.d/punjab stop
To restart punjab : /etc/init.d/punjab restart
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*