byobu-classroom should scale

Bug #899391 reported by Mark Mims on 2011-12-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu-classroom (Juju Charms Collection)
Undecided
Unassigned

Bug Description

add multinode support

Mark Mims (mark-mims) wrote :

Just a reminder:

- use a head

- byobu-classroom peers have a leader running the primary screen... other peers simply change init scripts to redirect to the master upon guest login

update /etc/default/ajaxterm
-------------------8<-------------------------
# Default start options for Ajaxterm
# Sourced by /etc/init.d/ajaxterm

#
# This is a POSIX shell fragment
#

# Set the daemon's user id (ajaxterm by default)
# If run as root ajaxterm will run `/bin/login',
# otherwise it will run `ssh localhost'.
#AJAXTERM_UID="ajaxterm"

# Allow to change the default port used by Ajaxterm
#PORT="8022"

# Allow to use a different port than 22 to connect to the ssh server
#SERVERPORT="22"
COMMAND='ssh -l guest ec2-75-101-209-36.compute-1.amazonaws.com -oPreferredAuthentications=keyboard-interactive,password -oNoHostAuthenticationForLocalhost=yes -oLogLevel=FATAL -F/dev/null'

-------------------8<-------------------------

updated /etc/init.d/ajaxterm
-------------------8<-------------------------
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: ajaxterm
# Required-Start: $syslog $local_fs $remote_fs
# Required-Stop: $syslog $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts/stops ajaxterm
# Description: starts and stops Ajaterm,
# a web based terminal written in Python
### END INIT INFO

PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
DAEMON=/usr/bin/ajaxterm
PORT=8022
SERVERPORT=22
PIDFILE=/var/run/ajaxterm.pid
NAME=ajaxterm
DESC="web based terminal"
AJAXTERM_UID=ajaxterm
AJAXTERM_GID=ajaxterm

if [ $(id -u) != 0 ]; then
  echo "You should run this program as root"
  exit 1
fi

[ -x "$DAEMON" ] || exit 0

[ -f "/etc/default/ajaxterm" ] && . /etc/default/ajaxterm

. /lib/lsb/init-functions

case "$1" in
 start)
  log_begin_msg "Starting $DESC:" "$NAME"
  if [ -f $PIDFILE ]; then
   log_action_cont_msg " already running"
   log_end_msg 1
  else
   start-stop-daemon --start --group=$AJAXTERM_GID --pidfile $PIDFILE --exec $DAEMON -- --daemon --port=$PORT --serverport=$SERVERPORT \
    --uid=$AJAXTERM_UID --command="$COMMAND" >/dev/null
   log_end_msg $?
  fi
 ;;
 stop)
  log_begin_msg "Stopping $DESC:" "$NAME"
  start-stop-daemon --stop --pidfile $PIDFILE
  rm -f $PIDFILE
  log_end_msg $?
 ;;
 restart|force-reload)
  $0 stop
  $0 start
 ;;
 *)
  echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  exit 3
 ;;
esac
-------------------8<-------------------------

Clint Byrum (clint-fewbar) wrote :

Another note, because we don't know at start time if we are multi-node or not, need to add a multi-node config option which delays starting ajaxterm and apache until at least one peer relationship is established. This will prevent people being exposed to an ajaxterm which shows the ssh to localhost instead of the "leader" node.

affects: charm → byobu-classroom (juju Charms Collection)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers