Startup Script for OpenMeetings Open-Source Video Conferencing Server

/etc/init.d/openmeetings startup script for Ubuntu Server 12.04.2
OpenMeetings Version 2.0-INCUBATING

A few notes:
– Make sure to change path for RED5_HOME variable
– Make sure to chmod +x the init script
– This assumes openmeetings is running under a user/group with the same name
– This assumes you are using libreoffice (not openoffice) for the whiteboard file import service

#!/bin/bash
#
# Author: Nathan Thomas
#
### BEGIN INIT INFO
# Provides:          red5
# Required-Start:    $local_fs $remote_fs $network $syslog $named $time
# Required-Stop:     $local_fs $remote_fs $network $syslog $named $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Start/stop OpenMeetings java based conferencing webapp
### END INIT INFO
PROG=red5
DESC="Red5 flash streaming server"
RED5_HOME=/usr/local/openmeetings
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
# Plugin Variables
#OO_HOME=/usr/lib/openoffice/program
OO_HOME=/usr/lib/libreoffice/program

OO_DAEMON=$OO_HOME/soffice
OO_PIDFILE=/var/run/ooimport.pid
# Include init-functions
. /lib/lsb/init-functions
case "$1" in
	'start')
		SERVICES=('OpenOffice' 'Red5')
		COUNT=0
		for i in ${SERVICES[@]}
		do
			case $i in
				'OpenOffice')
					log_daemon_msg "Starting OOImport Listener Service" || true
					if start-stop-daemon --start -c openmeetings --pidfile $OO_PIDFILE --make-pidfile --background --exec $OO_DAEMON -- "--accept=socket,host=127.0.0.1,port=8100,tcpNoDelay=1;urp;" --headless --nodefault --nofirststartwizard --nolockcheck --nologo --norestore; then
						log_end_msg 0 || true
						((COUNT++))
					else
						log_end_msg 1 || true
					fi
					;;
				'Red5')
					log_daemon_msg "Starting $PROG Server" || true
					if start-stop-daemon --start -c openmeetings --pidfile $PIDFILE --chdir $RED5_HOME --background --make-pidfile --exec $DAEMON; then
                                                log_end_msg 0 || true
                                        	((COUNT++))
					else
                                                log_end_msg 1 || true
                                        fi
					;;
				*)
					exit 1
					;;
			esac
		done
		case $COUNT in
				'2')
					echo "All services for $PROG Server started successfully."
					echo "Webapp should now be accessible via http://$HOSTNAME:5080/openmeetings"
					exit 0
					;;
				*)
					echo "Not all of the required services for $PROG Server started successfully. Please check the log files."
					exit 1
		esac
		;;
	'stop')
		COUNT=0
	        log_daemon_msg "Stopping OOImport Listener Service" || true
      		if start-stop-daemon --stop --quiet --oknodo --pidfile $OO_PIDFILE; then
			log_end_msg 0 || true
			rm -f $OO_PIDFILE
			((COUNT++))
	        else
	        	log_end_msg 1 || true
	        fi
                log_daemon_msg "Stopping $PROG Server" || true
                if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE; then
                        log_end_msg 0 || true
			rm -f $PIDFILE
			((COUNT++))
                else
                        log_end_msg 1 || true
                fi
                case $COUNT in
                                '2')
                                        echo "All services for $PROG Server shutdown successfully."
					exit 0
                                        ;;
                                *)
                                        echo "Was unable to properly shutdown all of the services for $PROG Server."
					echo "Try killing the following processes manually: "
					cat $PIDFILE $OO_PIDFILE
					exit 1
                esac
	        ;;
	'restart')
		/etc/init.d/openmeetings stop
		sleep 2
		/etc/init.d/openmeetings start
		;;
	'status')
		status_of_proc -p $OO_PIDFILE $OO_DAEMON OOImport
		status_of_proc -p $PIDFILE $DAEMON $PROG
		;;
	*)
		echo "Usage:  {start|stop|restart|status}"
		exit 1
		;;
esac
exit $?

One Reply to “Startup Script for OpenMeetings Open-Source Video Conferencing Server”

  1. One thing I did notice is that the only way to get user uploads to work was by running OpenMeetings as the root user. It did not matter even if the user/group we created had the proper permissions to the upload directory.

Leave a Reply