summaryrefslogtreecommitdiff
path: root/system/conserver
diff options
context:
space:
mode:
authorMenno E. Duursma <druiloor@zonnet.nl>2010-05-11 15:18:35 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-11 15:18:35 +0200
commitaf96e3345ba7d84df21052f349c5991482a43cc5 (patch)
tree21921b8c6cce584135dc7087de6f2fc703b46c2f /system/conserver
parent610f908cb76f8bc1ffca107a00fcc0cf3fc646ed (diff)
downloadslackbuilds-af96e3345ba7d84df21052f349c5991482a43cc5.tar.gz
system/conserver: Initial import
Diffstat (limited to 'system/conserver')
-rw-r--r--system/conserver/README14
-rw-r--r--system/conserver/conserver.SlackBuild129
-rw-r--r--system/conserver/conserver.cf49
-rw-r--r--system/conserver/conserver.info8
-rw-r--r--system/conserver/conserver.passwd5
-rw-r--r--system/conserver/console.cf3
-rw-r--r--system/conserver/doinst.sh23
-rw-r--r--system/conserver/rc.conserver53
-rw-r--r--system/conserver/slack-desc10
9 files changed, 294 insertions, 0 deletions
diff --git a/system/conserver/README b/system/conserver/README
new file mode 100644
index 0000000000..28a06b0c63
--- /dev/null
+++ b/system/conserver/README
@@ -0,0 +1,14 @@
+Conserver is an application that allows multiple users to watch a serial
+console at the same time (serial meaning 'serial data stream' here, not
+necessarily any phisical RS-232 port). It can log the data, allows users
+to take write-access of a console (one at a time), and has a variety
+of bells and whistles to accentuate that basic functionality. The idea is
+that conserver will log all your serial traffic so you can go back and
+review why something crashed, look at changes (if done on the console),
+or tie the console logs into a monitoring system (just watch the logfile
+it creates; for instance using ``dnotify'').
+
+Multi-user capabilities allow you to work on equipment with others, mentor,
+train, etc. It also does all that client-server stuff so that, assuming you
+have a network connection, you can interact with any of the equipment from
+home or wherever.
diff --git a/system/conserver/conserver.SlackBuild b/system/conserver/conserver.SlackBuild
new file mode 100644
index 0000000000..439640f044
--- /dev/null
+++ b/system/conserver/conserver.SlackBuild
@@ -0,0 +1,129 @@
+#!/bin/sh
+
+# Slackware build script for Conserver
+
+# Written by Menno Duursma <druiloor@zonnet.nl>
+# Modified by the SlackBuilds.org project
+
+PRGNAM=conserver
+VERSION=8.1.14
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+CWD=`pwd`
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+# Bail out if we have a problem
+set -e
+
+# Set compiler flags
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
+cd $PRGNAM-$VERSION
+
+chown -R root:root .
+find . -type d -exec chmod 0755 {} \;
+chmod -R a-s,u+w,go+r-w .
+
+# Bake-in: libwrap (TCP Wrapper) and SSL support
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --with-libwrap \
+ --with-openssl \
+ || exit 1
+
+make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Strip binaries and libraries
+( cd $PKG
+ find . -type f | \
+ xargs file | \
+ grep "executable" | \
+ grep ELF | \
+ cut -f 1 -d : | \
+ xargs strip --strip-unneeded \
+ 2> /dev/null
+
+ find . -type f | \
+ xargs file | \
+ grep "shared object" | \
+ grep ELF | \
+ cut -f 1 -d : | \
+ xargs strip --strip-unneeded \
+ 2> /dev/null
+)
+
+if [ -d $PKG/usr/man ]; then
+ gzip -9 $PKG/usr/man/man?/*
+fi
+
+# Documentation :
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp CHANGES FAQ INSTALL LICENSE PROTOCOL README TODO conserver.html \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+# We'll consider this a documentation here
+cp -a autologin $PKG/usr/doc/$PRGNAM-$VERSION
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/conserver.cf
+cd conserver.cf
+cp INSTALL conserver.cf conserver.passwd label.ps test.cf \
+ $PKG/usr/doc/$PRGNAM-$VERSION/conserver.cf
+cp -a samples $PKG/usr/doc/$PRGNAM-$VERSION/conserver.cf
+
+cd ../conserver
+cp Sun-serial $PKG/usr/doc/$PRGNAM-$VERSION
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/contrib
+cd ../contrib
+cp README maketestcerts $PKG/usr/doc/$PRGNAM-$VERSION/contrib
+# We'll consider this a documentation here too
+cp -a chat $PKG/usr/doc/$PRGNAM-$VERSION/contrib
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+# Toss redundant example config files included with source
+rm -rf $PKG/usr/share
+
+## Sample configuration files
+mkdir -p $PKG/etc
+cat $CWD/conserver.cf > $PKG/etc/conserver.cf.new
+cat $CWD/conserver.passwd >$PKG/etc/conserver.passwd.new
+cat $CWD/console.cf >$PKG/etc/console.cf.new
+
+# Include sample rc file
+mkdir -p $PKG/etc/rc.d
+install -m 0755 $CWD/rc.conserver $PKG/etc/rc.d/rc.conserver.new
+
+# Default directory console messages get logged to
+mkdir -p $PKG/var/consoles
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+# Prepend any symlinks and such to the existing doinst.sh file
+cd $PKG
+/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+
+# Clean up the extra stuff
+if [ "$1" = "--cleanup" ]; then
+ rm -rf $TMP/$PRGNAM-$VERSION
+ rm -rf $PKG
+fi
+
diff --git a/system/conserver/conserver.cf b/system/conserver/conserver.cf
new file mode 100644
index 0000000000..296889e7ba
--- /dev/null
+++ b/system/conserver/conserver.cf
@@ -0,0 +1,49 @@
+#
+# Sample conserver.cf file, to give you ideas of what you can do with
+# the various configuration items.
+#
+
+### set up global access
+default full {
+ rw *;
+}
+
+### set the defaults for all the consoles
+# these get applied before anything else
+default * {
+ # The '&' character is substituted with the console name
+ logfile /var/consoles/&;
+ # timestamps every hour with activity and break logging
+ timestamp 1hab;
+ # include the 'full' default
+ include full;
+ # master server is localhost
+ master localhost;
+}
+
+### and now some one-off consoles
+# we still inherit the '*' default set
+# a simple ssh invocation
+console ssh {
+ type exec;
+ exec ssh localhost;
+ # provide a 'message-of-the-day'
+ motd "just a simple ssh to localhost";
+}
+
+# Local COM2: port
+console ttyS1 {
+ master localhost;
+ type device;
+ device /dev/ttyS1;
+ baud 9600;
+ parity none;
+}
+
+### list of clients we allow
+access * {
+ trusted 127.0.0.1;
+ # RFC 1918
+ allowed 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8;
+}
+
diff --git a/system/conserver/conserver.info b/system/conserver/conserver.info
new file mode 100644
index 0000000000..941db213d2
--- /dev/null
+++ b/system/conserver/conserver.info
@@ -0,0 +1,8 @@
+PRGNAM="conserver"
+VERSION="8.1.14"
+HOMEPAGE="http://www.conserver.com/"
+DOWNLOAD="http://www.conserver.com/conserver-8.1.14.tar.gz"
+MD5SUM="f7825728e5af8992ed4a99fb560a3df8"
+MAINTAINER="Menno E. Duursma"
+EMAIL="druiloor@zonnet.nl"
+APPROVED="robw810,alien"
diff --git a/system/conserver/conserver.passwd b/system/conserver/conserver.passwd
new file mode 100644
index 0000000000..f0e1200b2a
--- /dev/null
+++ b/system/conserver/conserver.passwd
@@ -0,0 +1,5 @@
+# Everyone uses their regular login and password.
+# note: the account running conserver needs /etc/shadow privs for this
+#
+*any*:*passwd*
+
diff --git a/system/conserver/console.cf b/system/conserver/console.cf
new file mode 100644
index 0000000000..2a04510fbe
--- /dev/null
+++ b/system/conserver/console.cf
@@ -0,0 +1,3 @@
+config * {
+ master localhost;
+}
diff --git a/system/conserver/doinst.sh b/system/conserver/doinst.sh
new file mode 100644
index 0000000000..b9942d1138
--- /dev/null
+++ b/system/conserver/doinst.sh
@@ -0,0 +1,23 @@
+config() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/conserver.cf.new
+config etc/conserver.passwd.new
+config etc/console.cf.new
+config etc/rc.d/rc.conserver.new
+
+# Make sure there is a service mapping for conserver
+if ! grep -q "^conserver" etc/services ; then
+ printf "conserver\t782/tcp\tconsole\t# Console Server\n" >> etc/services
+fi
+
diff --git a/system/conserver/rc.conserver b/system/conserver/rc.conserver
new file mode 100644
index 0000000000..c5dca028c5
--- /dev/null
+++ b/system/conserver/rc.conserver
@@ -0,0 +1,53 @@
+#!/bin/sh
+# Start/stop/restart the conserver console server daemon.
+
+# Start conserver:
+conserver_start() {
+ if [ -x /usr/sbin/conserver -a -d /var/consoles ]; then
+ echo "Starting conserver: /usr/sbin/conserver -d -v"
+ /usr/sbin/conserver -d -v
+ fi
+}
+
+# Stop conserver:
+conserver_stop() {
+ /bin/killall conserver
+}
+
+# Restart conserver:
+conserver_restart() {
+ conserver_stop
+ /bin/sleep 1
+ conserver_start
+}
+
+# Reread the configuration file
+conserver_reload() {
+ /bin/killall -HUP conserver
+}
+
+# Try and reconnect to any consoles that seem down
+conserver_reconnect() {
+ /bin/killall -USR1 conserver
+}
+
+case "$1" in
+'start')
+ conserver_start
+ ;;
+'stop')
+ conserver_stop
+ ;;
+'restart')
+ conserver_restart
+ ;;
+'reload')
+ conserver_reload
+ ;;
+'reconnect')
+ conserver_reconnect
+ ;;
+*)
+ echo "usage $0 start|stop|restart|reload|reconnect"
+esac
+
diff --git a/system/conserver/slack-desc b/system/conserver/slack-desc
new file mode 100644
index 0000000000..c43a30f2fa
--- /dev/null
+++ b/system/conserver/slack-desc
@@ -0,0 +1,10 @@
+conserver: Conserver (Console server)
+conserver:
+conserver: Conserver is an application that allows multiple users to watch
+conserver: a (serial) console at the same time. It can log the data, allows
+conserver: to take write-access of a console (one at a time), and has a
+conserver: variety of bells and whistles to accentuate that basic
+conserver: functionality. Basically it can consolidate out-off-band
+conserver: management / data. Conserver is maintained by Bryan Stansell.
+conserver: Project homepage: http://www.conserver.com/
+conserver: