conserver port.

This commit is contained in:
angelos 1998-04-29 03:31:56 +00:00
parent 0c8d8634e4
commit 30ff4e39b6
13 changed files with 307 additions and 0 deletions

44
comms/conserver/Makefile Normal file
View File

@ -0,0 +1,44 @@
# OpenBSD makefile for: conserver
# Version required: 5.21-Beta
# Date created: 28 April 1998
# Whom: Angelos D. Keromytis
#
# $OpenBSD: Makefile,v 1.1.1.1 1998/04/29 03:31:56 angelos Exp $
#
DISTNAME= conserver-5.21-Beta
PKGNAME= conserver-5.21
CATEGORIES= comms
MASTER_SITES= ftp://ftp.uu.net/vendor/bitsko/config-mgmt/ \
ftp://unix.hensa.ac.uk/mirrors/uunet/vendor/bitsko/config-mgmt/
EXTRACT_SUFX= .shar.gz
MAINTAINER= angelos@openbsd.org
EXTRACT_CMD= zcat
EXTRACT_BEFORE_ARGS=
EXTRACT_AFTER_ARGS= |sh
NO_WRKSUBDIR= yes
NO_CONFIGURE= yes
MAN5= conserver.cf.5
MAN8= console.8 conserver.8
# Set this to where you want console(8) to connect to by default
# or use something like ``make DEFAULTHOST=myserver.mydomain.net''
DEFAULTHOST?= localhost
MAKE_ENV+= DEFAULTHOST="${DEFAULTHOST}"
post-extract:
cp ${FILESDIR}/Makefile ${WRKSRC}
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/conserver.sh ]; then \
echo "Installing ${PREFIX}/etc/rc.d/conserver.sh startup file."; \
echo "#!/bin/sh" > ${PREFIX}/etc/rc.d/conserver.sh; \
echo "if [ -x /usr/local/sbin/conserver -a -f /usr/local/etc/conserver.cf ]; then" >> ${PREFIX}/etc/rc.d/conserver.sh; \
echo " /usr/local/sbin/conserver -d -n ; echo -n ' conserver'" >> ${PREFIX}/etc/rc.d/conserver.sh; \
echo "fi" >> ${PREFIX}/etc/rc.d/conserver.sh; \
chmod 751 ${PREFIX}/etc/rc.d/conserver.sh; \
fi
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
SUBDIR= conserver.cf conserver console
.include <bsd.subdir.mk>

View File

@ -0,0 +1 @@
MD5 (conserver-5.21-Beta.shar.gz) = f19d56fba0c85d8b2c680c4b630f1a1b

View File

@ -0,0 +1,33 @@
--- conserver/Makefile.orig Sat Nov 22 20:42:18 1997
+++ conserver/Makefile Sat Nov 22 20:43:24 1997
@@ -8,6 +8,6 @@
# I would not change the name, you have to much with the docs then...
PROG= conserver
-ETC= ${DESTDIR}/usr/local/etc
-DOC= ${DESTDIR}/usr/local/man
+ETC= ${DESTDIR}/usr/local/sbin
+DOC= ${DESTDIR}/usr/local/man/man8
# if we have to PUCC ptyd daemon we can use it to get ptys, else use fallback.o
@@ -25,5 +25,5 @@
INCLUDE=
DEBUG=-O
-CDEFS= -DSUN5 -DHAVE_PTYD=0 -DDO_VIRTUAL=1
+CDEFS= -DOPENBSD -DHAVE_PTYD=0 -DDO_VIRTUAL=1 -DPORT=782
CFLAGS= ${DEBUG} ${CDEFS} ${INCLUDE}
@@ -42,5 +42,5 @@
${PROG}:$P ${OBJ}
- ${CC} -o $@ ${CFLAGS} ${OBJ} ${PUCCLIB} -lsocket -lnsl
+ ${CC} -o $@ ${CFLAGS} ${OBJ} ${PUCCLIB}
clean: FRC
@@ -60,5 +60,6 @@
install: all dirs FRC
- install -c -s ${PROG} ${ETC}/${PROG}
+ install -c -s -o bin -g bin -m 555 ${PROG} ${ETC}/${PROG}
+ install -c -o bin -g bin -m 444 ${MAN} ${DOC}/conserver.8
lint: ${HDR} ${SRC} FRC

View File

@ -0,0 +1,44 @@
--- ./conserver/cons.h Sat Nov 22 20:11:48 1997
+++ ./conserver/cons.h Sat Aug 23 17:40:11 1997
@@ -54,5 +54,5 @@
#endif
#if !defined(HAVE_UWAIT)
-#define HAVE_UWAIT !(defined(IBMR2)||defined(SUN5)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5))
+#define HAVE_UWAIT !(defined(IBMR2)||defined(SUN5)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5)||defined(OPENBSD))
#endif
@@ -86,5 +86,5 @@
*/
#if !defined(CONFIG)
-#define CONFIG "/usr/local/lib/conserver.cf"
+#define CONFIG "/usr/local/etc/conserver.cf"
#endif
@@ -171,5 +171,5 @@
#if !defined(HAVE_SETSID)
-#define HAVE_SETSID (defined(IBMR2)||defined(SUN5)||defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5))
+#define HAVE_SETSID (defined(IBMR2)||defined(SUN5)||defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5)||defined(OPENBSD))
#endif
@@ -193,5 +193,5 @@
#endif
#if !defined(USE_TERMIOS)
-#define USE_TERMIOS (defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(SUN5)||defined(PTX)||defined(IRIX5))
+#define USE_TERMIOS (defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(OPENBSD))
#endif
#if !defined(USE_TCBREAK)
@@ -258,5 +258,5 @@
/* which type signal handlers return on this machine
*/
-#if defined(sun) || defined(NEXT2) || defined(SUN5) || defined(PTX) || defined(IRIX5)
+#if defined(sun) || defined(NEXT2) || defined(SUN5) || defined(PTX) || defined(IRIX5) || defined(OPENBSD)
#define SIGRETS void
#else
@@ -273,5 +273,5 @@
*/
#if !defined(HAVE_STRERROR)
-#define HAVE_STRERROR (defined(IBMR2)||defined(ETA10)||defined(V386)||defined(SUN5)||defined(NEXT2)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5))
+#define HAVE_STRERROR (defined(IBMR2)||defined(ETA10)||defined(V386)||defined(SUN5)||defined(NEXT2)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5)||defined(OPENBSD))
#endif
#if ! HAVE_STRERROR

View File

@ -0,0 +1,24 @@
--- ./conserver/group.c Sat Nov 22 20:11:49 1997
+++ ./conserver/group.c Sat Aug 23 17:19:13 1997
@@ -750,5 +750,5 @@
CSTROUT(pCLServing->fd, "- ");
if (-1 == tcsendbreak(pCEServing->fdtty, 9)) {
- CSTROUT(pCLServing->fd, "failed]\r\n");
+ CSTROUT(pCLServing->fd, "tcsendbreak failed]\r\n");
continue;
}
@@ -1119,11 +1119,9 @@
}
#if !defined(XTABS) /* XXX hack */
-#define XTABS TAB3
+#define XTABS OXTABS
#endif
- if (XTABS == (TABDLY&sbuf.c_oflag)) {
- sbuf.c_oflag &= ~TABDLY;
- sbuf.c_oflag |= TAB0;
+ if (XTABS & sbuf.c_oflag) {
+ sbuf.c_oflag &= ~XTABS;
} else {
- sbuf.c_oflag &= ~TABDLY;
sbuf.c_oflag |= XTABS;
}

View File

@ -0,0 +1,34 @@
--- ./conserver/consent.c Sat Nov 22 20:21:46 1997
+++ ./conserver/consent.c Sat Aug 23 18:05:11 1997
@@ -206,5 +206,5 @@
* Don't bother with the control characters as they are not used
*/
- termp.c_cc[VMIN] = 128;
+ termp.c_cc[VMIN] = 1;
termp.c_cc[VTIME] = 1;
@@ -425,13 +425,13 @@
#if USE_TERMIOS
- if (0 != ioctl(0, TCGETS, & n_tio)) {
+ if (0 != tcgetattr(0, & n_tio)) {
fprintf(stderr, "%s: iotcl: getsw: %s\n", progname, strerror(errno));
exit(1);
}
- n_tio.c_iflag &= ~(IGNCR|IUCLC);
+
+ n_tio.c_iflag &= ~(IGNCR);
n_tio.c_iflag |= ICRNL|IXON|IXANY;
- n_tio.c_oflag &= ~(OLCUC|ONOCR|ONLRET|OFILL|NLDLY|CRDLY|TABDLY|BSDLY);
n_tio.c_oflag |= OPOST|ONLCR;
- n_tio.c_lflag &= ~(XCASE|NOFLSH|ECHOK|ECHONL);
+ n_tio.c_lflag &= ~(NOFLSH|ECHOK|ECHONL);
n_tio.c_lflag |= ISIG|ICANON|ECHO;
n_tio.c_cc[VEOF] = '\004';
@@ -445,5 +445,5 @@
n_tio.c_cc[VSTOP] = '\023';
n_tio.c_cc[VSUSP] = '\032';
- if (0 != ioctl(0, TCSETS, & n_tio)) {
+ if (0 != tcsetattr(0, TCSANOW, & n_tio)) {
fprintf(stderr, "%s: getarrt: %s\n", progname, strerror(errno));
exit(1);

View File

@ -0,0 +1,41 @@
--- console/Makefile.orig Sat Nov 22 23:02:48 1997
+++ console/Makefile Sat Nov 22 23:03:45 1997
@@ -6,8 +6,8 @@
# edit the ETC directory below to change where the console client
# is installed.
PROG= console
-ETC= ${DESTDIR}/usr/local/etc
-DOC= ${DESTDIR}/usr/local/man
+ETC= ${DESTDIR}/usr/local/sbin
+DOC= ${DESTDIR}/usr/local/man/man8
I=/usr/include
S=/usr/include/sys
@@ -17,7 +17,7 @@
INCLUDE= -I$C
DEBUG=-O
-CDEFS= -DSUN5
+CDEFS= -DOPENBSD -DHOST=\"${DEFAULTHOST}\" -DPORT=782
CFLAGS= ${DEBUG} ${CDEFS} ${INCLUDE}
HDR=
@@ -29,7 +29,7 @@
all: ${PROG}
${PROG}:
- ${CC} -o $@ ${CFLAGS} ${ONEC} -lsocket -lnsl
+ ${CC} -o $@ ${CFLAGS} ${ONEC}
clean: FRC
rm -f Makefile.bak ${PROG} a.out *.o core errs lint.out tags
@@ -47,7 +47,8 @@
distrib -c ${ETC}/${PROG}
install: all dirs FRC
- install -cs ${PROG} ${ETC}/${PROG}
+ install -c -s -o bin -g bin -m 555 ${PROG} ${ETC}/${PROG}
+ install -c -o bin -g bin -m 444 ${MAN} ${DOC}/console.8
lint: ${HDR} ${ONEC} FRC
lint -h ${CDEFS} ${INCLUDE} ${ONEC}

View File

@ -0,0 +1,28 @@
--- ./console/console.c Sat Nov 22 20:11:48 1997
+++ ./console/console.c Sat Aug 23 17:40:44 1997
@@ -367,15 +367,15 @@
#if USE_TERMIOS
- if (0 != ioctl(0, TCGETS, & o_tios)) {
+ if (0 != tcgetattr(0, & o_tios)) {
fprintf(stderr, "%s: iotcl: getsw: %s\n", progname, strerror(errno));
exit(10);
}
n_tios = o_tios;
- n_tios.c_iflag &= ~(INLCR|IGNCR|ICRNL|IUCLC|IXON);
+ n_tios.c_iflag &= ~(INLCR|IGNCR|ICRNL|IXON);
n_tios.c_oflag &= ~OPOST;
n_tios.c_lflag &= ~(ICANON|ISIG|ECHO);
n_tios.c_cc[VMIN] = 1;
n_tios.c_cc[VTIME] = 0;
- if (0 != ioctl(0, TCSETS, & n_tios)) {
+ if (0 != tcsetattr(0, TCSANOW, & n_tios)) {
fprintf(stderr, "%s: getarrt: %s\n", progname, strerror(errno));
exit(10);
@@ -453,5 +453,5 @@
return;
#if USE_TERMIOS
- (void)ioctl(0, TCSETS, (char *)&o_tios);
+ (void)tcsetattr(0, TCSANOW, &o_tios);
#else
#if USE_TERMIO

View File

@ -0,0 +1,36 @@
--- conserver.cf/Makefile.orig Sat Nov 22 22:25:19 1997
+++ conserver.cf/Makefile Sat Nov 22 22:29:15 1997
@@ -4,18 +4,19 @@
#
# if you edit LIB below you have to change cons.hs default config define.
-PROG= conserver.cf
-LIB= ${DESTDIR}/usr/local/lib
-DOC= ${DESTDIR}/usr/man
+PROG= conserver.cf.eg
+LIB= ${DESTDIR}/usr/local/etc
+DOC= ${DESTDIR}/usr/local/man/man5
SRCs= conserver.cf
MAN= conserver.cf.5l
OTHER= README
SOURCE= Makefile ${OTHER} ${MAN} ${SRCl} ${SRCs}
-all: ${SRCl} ${PROG}
+all: ${PROG}
${PROG}: ${SRCs}
+ sed -e '/^[^#]/s/^/#/' < ${SRCs} > ${PROG}
clean: FRC
rm -f Makefile.bak a.out core errs lint.out tags
@@ -29,7 +30,8 @@
dirs: ${LIB} ${DOC}
install: all dirs FRC
- install -c ${PROG} ${LIB}/${PROG}
+ install -c -o bin -g bin -m 444 ${PROG} ${LIB}
+ install -c -o bin -g bin -m 444 ${MAN} ${DOC}/conserver.cf.5
lint: FRC

View File

@ -0,0 +1 @@
Manage remote serial consoles via TCP/IP

11
comms/conserver/pkg/DESCR Normal file
View File

@ -0,0 +1,11 @@
This program provides a convenient way to manage many remote serial
consoles for machines. A server (conserver(8)) runs on each server
machine and it connects to the specified serial port. It can log,
provide shared access to remote consoles, etc. If there are multiple
machines running conserver(8), a master conserver(8) can be run to
connect to all the slave servers, providing a single point of access
to the entire cluster.
This is very handy for remote unattended OpenBSD servers. It can
send serial break signals (if the driver supports it, cy does not!)
which is useful for breaking into DDB on hung machines.

View File

@ -0,0 +1,7 @@
etc/conserver.cf.eg
etc/rc.d/conserver.sh
man/man5/conserver.cf.5
man/man8/conserver.8
man/man8/console.8
sbin/conserver
sbin/console