From 5b31f8d47dbb1b2a3aa161a73daf6a4e69371d2d Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Thu, 29 Nov 2001 16:04:51 +0000 Subject: [PATCH] - init script and PLD-compatibility patch for bb4 Changed files: bb4-pld.patch -> 1.1 bb4.init -> 1.1 --- bb4-pld.patch | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++ bb4.init | 71 +++++++++++++++++++++++++ 2 files changed, 215 insertions(+) create mode 100644 bb4-pld.patch create mode 100644 bb4.init diff --git a/bb4-pld.patch b/bb4-pld.patch new file mode 100644 index 0000000..47647e6 --- /dev/null +++ b/bb4-pld.patch @@ -0,0 +1,144 @@ +diff -Nur bb4-1.8c1.orig/bb18c1/install/Makefile.pld bb4-1.8c1/bb18c1/install/Makefile.pld +--- bb4-1.8c1.orig/bb18d/install/Makefile.pld Thu Jan 1 01:00:00 1970 ++++ bb4-1.8c1/bb18d/install/Makefile.pld Wed Nov 14 13:41:21 2001 +@@ -0,0 +1,64 @@ ++SHELL = /bin/sh ++MAKE = make ++CC = cc ++ ++# FLAGS REQUIRED FOR PORTING ++# HPUX 10.0, irix and LINUX NEED NOTHING DEFINED ++# EXCEPT MAYBE THE OPTIMIZER ++# LIBS = -ll -lnsl -lsocket # SOLARIS NEEDS THIS ++LIBS= ++ ++# MISC COMPILER DIRECTIVES ++# -DENABLE_DISABLE - INCLUDE CODE TO TEMPORARELY DISABLE NOTIFICATIONS ON A HOST ++# -DDATAMSG - TO ALLOW data MESSAGES ++# -DNOTESMSG - TO ALLOW notes MESSAGES ++# -DBZERO - IF YOU DON'T HAVE bzero() ++# -DZOMBIE - IF zombie PROCESSES ARE GENERATED ++# -DGETTIMEOFDAY - TO GET DURATION STATISTICS ++# -DREGEXEC - IF YOUR COMPILER SUPPORTS regexec(),regcomp() ++# -DREGEX - IF YOUR COMPILER SUPPORTS regex(),regcmp() ++# -DRE_EXEC - IF YOUR COMPILER SUPPORTS re_exec(),re_comp() ++# -DTIMEH - IF YOUR OS HAS time.h INSTEAD OF sys/time.h ++# -DSIGSETJMP - IF YOUR OS SUPPORTS sigsetjmp() AND ++# DOES NOT HANDLE SIGNALS PROPERLY ++# WITH setjmp() ++ ++# Fixed confusing CFLAGS ++# thanks to Adam Goryachev ++# SOME OS NEEDS SPECIAL ZOMBIE HANDLING (-DZOMBIE) ++# SOME OS DON'T HAVE bzero() (-DBZERO) ++# SOME OS NEEDS SIGSETJMP HANDLING (-DSIGSETJMP) ++# REDHAT NEEDS -DSIGSETJMP ++ ++OPTCFLAGS=-O2 ++CFLAGS=$(OPTCFLAGS) -D&BBOSTYPE -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH ++ ++all: bb bbd bbnet touchtime dumphostsvc getipaddr bbstat ++ ++bb: bb.o bbsend.o utils.o bb.h ++ ${CC} ${CFLAGS} -o $@ bb.o bbsend.o utils.o ${LIBS} ++ ++bbd: dohostsvc.o utils.o bbd.o bbpage.o bbsend.o bb.h ++ ${CC} ${CFLAGS} -o $@ bbd.o dohostsvc.o bbpage.o bbsend.o utils.o ${LIBS} ++ ++bbnet: bbnet.o utils.o bb.h ++ ${CC} ${CFLAGS} -o $@ bbnet.o utils.o ${LIBS} ++ ++touchtime: touchtime.o bb.h ++ ${CC} ${CFLAGS} -o $@ touchtime.o ${LIBS} ++ ++dumphostsvc: dohostsvc.o utils.o dumphostsvc.o bb.h ++ ${CC} ${CFLAGS} -o $@ dumphostsvc.o dohostsvc.o utils.o ${LIBS} ++ ++getipaddr: utils.o getipaddr.o bb.h ++ ${CC} ${CFLAGS} -o $@ getipaddr.o utils.o ${LIBS} ++ ++bbstat: bbstat.o bb.h ++ ${CC} ${CFLAGS} -o $@ bbstat.o ${LIBS} ++ ++install: ++ rm -f *.o ++ mv bb bbd bbnet touchtime dumphostsvc getipaddr bbstat ../bin ++ ++clean: ++ rm -f *.o bb bbd bbnet touchtime dumphostsvc getipaddr bbstat +diff -Nur bb4-1.8c1.orig/bb18d/install/bbconfig bb4-1.8c1/bb18c1/install/bbconfig +--- bb4-1.8c1.orig/bb18d/install/bbconfig Tue Sep 4 05:59:41 2001 ++++ bb4-1.8c1/bb18d/install/bbconfig Wed Nov 14 13:44:23 2001 +@@ -117,6 +117,11 @@ + in + linux ) + # ARE WE A REDHAT MACHINE? ++ grep "PLD" /etc/issue >/dev/null ++ if test "$?" = "0" ++ then ++ MACHINE="pld" ++ fi + grep "Red" /etc/issue >/dev/null + if test "$?" = "0" + then +@@ -185,7 +190,7 @@ + ;; + esac + +-OS="bsdi bsdi4 sco3 sco freebsd solaris hpux9 hpux linux sunos netbsd osf ultrix irix unixware unixware7 redhat aix dynix debian dgux openbsd caldera mandrake sinix suse darwin" ++OS="bsdi bsdi4 sco3 sco freebsd solaris hpux9 hpux linux sunos netbsd osf ultrix irix unixware unixware7 pld redhat aix dynix debian dgux openbsd caldera mandrake sinix suse darwin" + + #-------------------------------------------------------- + # SET UP BBHOME +diff -Nur bb4-1.8c1.orig/bb18d/install/bbsys.pld bb4-1.8c1/bb18c1/install/bbsys.pld +--- bb4-1.8c1.orig/bb18d/install/bbsys.pld Thu Jan 1 01:00:00 1970 ++++ bb4-1.8c1/bb18d/install/bbsys.pld Wed Nov 14 14:07:28 2001 +@@ -0,0 +1,28 @@ ++# ++# bbsys.pld (Linux) ++# ++# BIG BROTHER ++# OPERATING SYSTEM DEPENDENT THINGS THAT ARE NEEDED ++# ++ ++PS="/bin/ps axww" # ++DF="/bin/df -k" ++MSGFILE="/var/log/messages" ++PING="/usr/sbin/ping" ++SED="/bin/sed" ++MAIL="/bin/mail -s" ++GREP="/bin/grep" ++EGREP="/bin/egrep" ++LYNX="/usr/bin/lynx -dump -head" ++AWK="/bin/awk" ++PINGPAR1="-n -c1" # ADDED BY ROB. DON'T RESOLVE NAME ++ # IF -n NOT THERE THAN NEW NETKIT (RH7) PING MAY FAIL ++# ++# From: Martin Richard ++# and others... took forever to make this change! ++# ++TOUCH="/bin/touch" # ADDED ++SORT="/bin/sort" # ADDED ++ ++ID="/bin/id" ++ +--- bb4-1.8c1/bb18d/etc/bbdef.sh.DIST.orig Wed Oct 3 21:07:49 2001 ++++ bb4-1.8c1/bb18d/etc/bbdef.sh.DIST Thu Nov 29 12:30:14 2001 +@@ -73,7 +73,7 @@ + # + # LOCATION OF BBOUT FILE + # +-BBOUT="$BBHOME/BBOUT" ++BBOUT="$BBTMP/BBOUT" + export BBOUT + + # +@@ -308,7 +308,7 @@ + # + # What NET services to check (don't put in dns/dig/http) + # +-BBNETSVCS="smtp telnet ftp pop pop3 pop-3 ssh imap ssh1 ssh2 imap2 imap3 imap4 pop2 pop-2 nntp" ++BBNETSVCS="smtp telnet ftp pop pop3 pop-3 ssh imap ssh1 ssh2 imap2 imap3 imap4 pop2 pop-2 nntp smtps pop3s imaps nntps" + export BBNETSVCS + + # diff --git a/bb4.init b/bb4.init new file mode 100644 index 0000000..083d405 --- /dev/null +++ b/bb4.init @@ -0,0 +1,71 @@ +#!/bin/sh +# +# bb Big Brother System and Network Monitor +# +# chkconfig: 345 99 01 +# description: Big Brother is System and Network Monitoring system +# processname: bbd + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# Get service config +[ -f /etc/sysconfig/bb ] && . /etc/sysconfig/bb + +# Check that networking is up. +if is_no "${NETWORKING}"; then + # nls "ERROR: Networking is down. %s can't be run." + msg_Network_Down httpd + exit 1 +fi + +# See how we were called. +case "$1" in + start) + # Check if the service is already running? + if [ ! -f /var/lock/subsys/bb ]; then + msg_starting bb + su - bb -c '/usr/bin/setsid /usr/lib/bb/runbb.sh start' /dev/null 2>&1 + RETVAL=$? + if [ "$RETVAL" = "0" ]; then + ok + else + fail + fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bb + else + msg_Already_Running bb + exit 1 + fi + ;; + stop) + # Stop daemons. + if [ -f /var/lock/subsys/bb ]; then + msg_stopping bb + su - bb -c '/usr/lib/bb/runbb.sh stop' >/dev/null 2>&1 + if [ "$?" = "0" ]; then + ok + else + fail + fi + rm -f /var/lock/subsys/bb >/dev/null 2>&1 + else + msg_Not_Running bb + exit 1 + fi + ;; + restart|reload) + $0 stop + $0 start + ;; + *) + msg_Usage "$0 {start|stop|restart}" + exit 1 + ;; +esac + +exit $RETVAL + -- 2.43.0