# OF THE POSSIBILITY OF SUCH DAMAGE.
#
-SUBDIRS= common server client relay statmsg systatd
+SUBDIRS= common server client relay statmsg sysconfd
all:
@for dir in ${SUBDIRS}; do \
SRC = raw.c parse.c nit.c icmp.c dispatch.c conflex.c upf.c bpf.c socket.c \
packet.c memory.c print.c options.c inet.c convert.c \
tree.c tables.c hash.c alloc.c errwarn.c inet_addr.c dns.c \
- resolv.c systat.c
+ resolv.c sysconf.c
OBJ = raw.o parse.o nit.o icmp.o dispatch.o conflex.o upf.o bpf.o socket.o \
packet.o memory.o print.o options.o inet.o convert.o \
tree.o tables.o hash.o alloc.o errwarn.o inet_addr.o dns.o \
- resolv.o systat.o
+ resolv.o sysconf.o
DEBUG = -g
INCLUDES = -I.. -I../includes
-/* systat.c
+/* sysconf.c
System status watcher...
#ifndef lint
static char copyright[] =
-"$Id: sysconf.c,v 1.1 1997/09/16 18:15:44 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: sysconf.c,v 1.2 1997/10/20 22:10:59 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
-int systat_initialized;
-int systat_fd;
+int sysconf_initialized;
+int sysconf_fd;
-void systat_startup (handler)
- void (*handler) PROTO ((struct systat_header *, void *));
+void sysconf_startup (handler)
+ void (*handler) PROTO ((struct sysconf_header *, void *));
{
struct sockaddr_un name;
static int once;
- /* Only initialize systat once. */
- if (systat_initialized)
- error ("attempted to reinitialize systat protocol");
- systat_initialized = 1;
+ /* Only initialize sysconf once. */
+ if (sysconf_initialized)
+ error ("attempted to reinitialize sysconf protocol");
+ sysconf_initialized = 1;
- systat_fd = socket (AF_UNIX, SOCK_STREAM, 0);
- if (systat_fd < 0)
- error ("unable to create systat socket: %m");
+ sysconf_fd = socket (AF_UNIX, SOCK_STREAM, 0);
+ if (sysconf_fd < 0)
+ error ("unable to create sysconf socket: %m");
/* XXX for now... */
name.sun_family = PF_UNIX;
- strcpy (name.sun_path, "/var/run/systat");
+ strcpy (name.sun_path, "/var/run/sysconf");
name.sun_len = ((sizeof name) - (sizeof name.sun_path) +
strlen (name.sun_path));
- if (connect (systat_fd, (struct sockaddr *)&name, name.sun_len) < 0) {
+ if (connect (sysconf_fd, (struct sockaddr *)&name, name.sun_len) < 0) {
if (!once)
- warn ("can't connect to systat socket: %m");
+ warn ("can't connect to sysconf socket: %m");
once = 1;
- close (systat_fd);
- systat_initialized = 0;
- add_timeout (cur_time + 60, systat_restart, handler);
+ close (sysconf_fd);
+ sysconf_initialized = 0;
+ add_timeout (cur_time + 60, sysconf_restart, handler);
} else
- add_protocol ("systat", systat_fd, systat_message, handler);
+ add_protocol ("sysconf", sysconf_fd, sysconf_message, handler);
}
-void systat_restart (v)
+void sysconf_restart (v)
void *v;
{
- void (*handler) PROTO ((struct systat_header *, void *)) = v;
+ void (*handler) PROTO ((struct sysconf_header *, void *)) = v;
- systat_startup (handler);
+ sysconf_startup (handler);
}
-void systat_message (proto)
+void sysconf_message (proto)
struct protocol *proto;
{
- struct systat_header hdr;
+ struct sysconf_header hdr;
int status;
char *buf;
- void (*handler) PROTO ((struct systat_header *, void *));
+ void (*handler) PROTO ((struct sysconf_header *, void *));
- status = read (systat_fd, &hdr, sizeof hdr);
+ status = read (sysconf_fd, &hdr, sizeof hdr);
if (status < 0) {
- warn ("systat_message: %m");
+ warn ("sysconf_message: %m");
lose:
- add_timeout (cur_time + 60, systat_restart, proto -> local);
+ add_timeout (cur_time + 60, sysconf_restart, proto -> local);
remove_protocol (proto);
return;
}
if (status < sizeof (hdr)) {
- warn ("systat_message: short message");
+ warn ("sysconf_message: short message");
goto lose;
}
if (hdr.length) {
buf = malloc (hdr.length);
if (!buf)
- error ("systat_message: can't buffer payload");
- status = read (systat_fd, buf, hdr.length);
+ error ("sysconf_message: can't buffer payload");
+ status = read (sysconf_fd, buf, hdr.length);
if (status < 0)
- error ("systat_message payload read: %m");
+ error ("sysconf_message payload read: %m");
if (status != hdr.length)
- error ("systat_message payload: short read");
+ error ("sysconf_message payload: short read");
} else
buf = (char *)0;
echo "System Type: $sysname"
-for foo in . client server relay statmsg systatd common; do
+for foo in . client server relay statmsg sysconfd common; do
(sed -e "/^##--${sysname}--/,/^##--${sysname}--/s/^#//" \
<Makefile.conf; cat $foo/Makefile.dist) \
>$foo/Makefile
#include "tree.h"
#include "hash.h"
#include "inet.h"
-#include "systat.h"
+#include "sysconf.h"
struct option_data {
int len;
struct client_lease *packet_to_lease PROTO ((struct packet *));
void go_daemon PROTO ((void));
void write_client_pid_file PROTO ((void));
-void status_message PROTO ((struct systat_header *, void *));
+void status_message PROTO ((struct sysconf_header *, void *));
void client_location_changed PROTO ((void));
/* db.c */
int inet_aton PROTO ((char *, struct in_addr *));
#endif
-/* systat.c */
-void systat_startup PROTO ((void (*) (struct systat_header *, void *)));
-void systat_restart PROTO ((void *));
-void systat_message PROTO ((struct protocol *proto));
+/* sysconf.c */
+void sysconf_startup PROTO ((void (*) (struct sysconf_header *, void *)));
+void sysconf_restart PROTO ((void *));
+void sysconf_message PROTO ((struct protocol *proto));
#
CATMANPAGES =
-SRCS = systatd.c
-OBJS = systatd.o
-PROG = systatd
+SRCS = sysconfd.c
+OBJS = sysconfd.o
+PROG = sysconfd
MAN =
DEBUG = -g
all: $(PROG) $(CATMANPAGES)
install: $(PROG) $(CATMANPAGES)
- $(INSTALL) systatd $(BINDIR)
- $(CHMOD) 755 $(BINDIR)/systatd
+ $(INSTALL) sysconfd $(BINDIR)
+ $(CHMOD) 755 $(BINDIR)/sysconfd
if [ ! -d $(ADMMANDIR) ]; then \
mkdir $(ADMMANDIR); \
chmod 755 $(ADMMANDIR); \
fi
-# $(MANINSTALL) $(MANFROM) systatd.cat8 $(MANTO) \
-# $(ADMMANDIR)/systatd$(ADMMANEXT)
+# $(MANINSTALL) $(MANFROM) sysconfd.cat8 $(MANTO) \
+# $(ADMMANDIR)/sysconfd$(ADMMANEXT)
clean:
-rm -f $(OBJS)
# macros aren't available on older unices. Catted man pages are
# provided in the distribution so that this doesn't become a problem.
-systatd.cat8: systatd.8
+sysconfd.cat8: sysconfd.8
sed -e "s#ETCDIR#$(ETC)#" -e "s#DBDIR#$(VARDB)#" \
- -e "s#RUNDIR#$(VARRUN)#" < systatd.8 \
- | nroff -man >systatd.cat8
+ -e "s#RUNDIR#$(VARRUN)#" < sysconfd.8 \
+ | nroff -man >sysconfd.cat8
$(PROG): $(OBJS) $(DHCPLIB)
$(CC) $(LFLAGS) -o $(PROG) $(OBJS) $(DHCPLIB) $(LIBS)
/* main.c
- System status daemon...
+ System configuration status daemon...
!!!Boy, howdy, is this ever not guaranteed not to change!!! */
#ifndef lint
static char copyright[] =
-"$Id: sysconfd.c,v 1.1 1997/09/16 18:21:11 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: sysconfd.c,v 1.2 1997/10/20 22:11:44 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
-int systat_fd;
+int sysconf_fd;
-struct systat_client {
- struct systat_client *next;
+struct sysconf_client {
+ struct sysconf_client *next;
int fd;
} *clients;
char **envp;
{
struct sockaddr_un name;
- int systat_fd;
+ int sysconf_fd;
int pid;
#ifdef SYSLOG_4_2
- openlog ("systatd", LOG_NDELAY);
+ openlog ("sysconfd", LOG_NDELAY);
log_priority = LOG_DAEMON;
#else
- openlog ("systatd", LOG_NDELAY, LOG_DAEMON);
+ openlog ("sysconfd", LOG_NDELAY, LOG_DAEMON);
#endif
#if !(defined (DEBUG) || defined (SYSLOG_4_2) || defined (__CYGWIN32__))
#endif
/* Make a socket... */
- systat_fd = socket (AF_UNIX, SOCK_STREAM, 0);
- if (systat_fd < 0)
- error ("unable to create systat socket: %m");
+ sysconf_fd = socket (AF_UNIX, SOCK_STREAM, 0);
+ if (sysconf_fd < 0)
+ error ("unable to create sysconf socket: %m");
/* XXX for now... */
name.sun_family = PF_UNIX;
- strcpy (name.sun_path, "/var/run/systat");
+ strcpy (name.sun_path, "/var/run/sysconf");
name.sun_len = ((sizeof name) - (sizeof name.sun_path) +
strlen (name.sun_path));
unlink (name.sun_path);
/* Bind to it... */
- if (bind (systat_fd, (struct sockaddr *)&name, name.sun_len) < 0)
- error ("can't bind to systat socket: %m");
+ if (bind (sysconf_fd, (struct sockaddr *)&name, name.sun_len) < 0)
+ error ("can't bind to sysconf socket: %m");
/* Listen for connections... */
- if (listen (systat_fd, 1) < 0)
- error ("can't listen on systat socket: %m");
+ if (listen (sysconf_fd, 1) < 0)
+ error ("can't listen on sysconf socket: %m");
/* Stop logging to stderr... */
log_perror = 0;
(void)setsid ();
/* Set up a protocol structure for it... */
- add_protocol ("listener", systat_fd, new_connection, 0);
+ add_protocol ("listener", sysconf_fd, new_connection, 0);
/* Kernel status stuff goes here... */
{
struct sockaddr_un name;
int namelen;
- struct systat_client *tmp;
+ struct sysconf_client *tmp;
int new_fd;
- tmp = (struct systat_client *)malloc (sizeof *tmp);
+ tmp = (struct sysconf_client *)malloc (sizeof *tmp);
if (tmp < 0)
error ("Can't find memory for new client!");
memset (tmp, 0, sizeof *tmp);
void client_input (proto)
struct protocol *proto;
{
- struct systat_header hdr;
+ struct sysconf_header hdr;
int status;
char *buf;
- void (*handler) PROTO ((struct systat_header *, void *));
- struct systat_client *client;
+ void (*handler) PROTO ((struct sysconf_header *, void *));
+ struct sysconf_client *client;
status = read (proto -> fd, &hdr, sizeof hdr);
if (status < 0) {