OBJS=bosserver.o bnode.o ezbnodeops.o fsbnodeops.o bosint.ss.o bosint.xdr.o \
bosoprocs.o cronbnodeops.o
-all: bosserver ${TOP_INCDIR}/afs/bosint.h bos ${TOP_LIBDIR}/libbos.a bos_util
+all: bosserver ${TOP_INCDIR}/afs/bosint.h bos ${TOP_LIBDIR}/libbos.a bos_util \
+ smail-notifier
generated: bosint.ss.c bosint.xdr.c bosint.cs.c bosint.h bnode.h boserr.c
bosserver: $(OBJS) $(LIBS)
${CC} $(CFLAGS) -o bosserver $(OBJS) ${TOP_LIBDIR}/libaudit.a $(LIBS) ${XLIBS} ${KRB5_LIBS}
+smail-notifier.o: smail-notifier.c ${INCLS}
+
+smail-notifier: smail-notifier.o $(LIBS)
+ ${CC} $(CFLAGS) -o smail-notifier smail-notifier.o $(LIBS) ${XLIBS}
+
#
# Install targets
#
# Misc. targets
#
clean:
- $(RM) -f *.a *.o bos bosserver testproc bos_util \
+ $(RM) -f *.a *.o bos bosserver smail-notifier bos_util \
bosint.cs.c bosint.ss.c bosint.xdr.c bosint.h \
core boserr.c bnode.h AFS_component_version_number.c
#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <afs/afsutil.h>
+#include <fcntl.h>
/*
* XXX CHANGE the following depedent stuff XXX
#include "AFS_component_version_number.c"
-main(argc, argv)
- int argc;
- char **argv;
+int
+main(int argc, char **argv)
{
struct stat tstat;
FILE *fin = stdin;
char buf[BUFSIZ], *bufp, *bufp1, *typep, *cmd, *bp;
- afs_int32 code, c, fd, id, pflags = -1, len, core = 0, lastE = 0;
- char comLine[60], coreName[40], name[40], lastErrorName[50];
- afs_int32 pid = -1, lastExit = -1, lastSignal = -1, rsCount = -1;
+ afs_int32 code, c, fd, pflags = -1, len, core = 0;
+ char comLine[60], coreName[40], name[40];
+ afs_int32 pid = -1, rsCount = -1;
afs_int32 procStarts = -1;
afs_int32 errorCode = -1, errorSignal = -1, goal = -1;
time_t procStartTime = -1, rsTime = -1, lastAnyExit = -1, lastErrorExit = -1;
strcpy(coreName, cmd);
else if (!strcmp(typep, "pid:"))
pid = atoi(cmd);
-#ifdef notdef
- else if (!strcmp(typep, "lastExit:"))
- lastExit = atoi(cmd);
- else if (!strcmp(typep, "lastSignal:"))
- lastSignal = atoi(cmd);
-#endif
else if (!strcmp(typep, "flags:"))
pflags = atoi(cmd);
else if (!strcmp(typep, "END")) {
(core ? (c ? "a recent " : "an 'old' ") : "no "),
(core ? bp : ""));
bufp += strlen(bufp);
-#ifdef notdef
- (void)sprintf(bufp, "Last Exit code %d\n", lastExit);
- bufp += strlen(bufp);
- (void)sprintf(bufp, "Last Signal number %d\n", lastSignal);
- bufp += strlen(bufp);
-#endif
if (pflags == 1)
strcpy(bp, "PROCESS STARTED");
else if (pflags == 2)
bufp += strlen(bufp);
(void)sprintf(bufp, "Last process terminating signal %d\n", errorSignal);
bufp += strlen(bufp);
-#ifdef notdef
- if (strcmp(lastErrorName, "(null)"))
- lastE = 1;
- if (lastE) {
- (void)sprintf(bufp,
- "Short name of process that failed last in this bnode is: %s\n",
- lastErrorName);
- bufp += strlen(bufp);
- }
-#endif
(void)sprintf(bufp, "The server is now %srunning\n",
(goal ? "" : "not "));
bufp += strlen(bufp);