/*
- * $Id: cnid_metad.c,v 1.1.4.6 2003-11-25 13:28:54 lenneis Exp $
+ * $Id: cnid_metad.c,v 1.1.4.7 2003-12-01 22:23:12 lenneis Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#define MAXSPAWN 3 /* Max times respawned in.. */
#define TESTTIME 20 /* this much seconds */
+#define DEFAULTHOST "localhost"
+#define DEFAULTPORT 4700
+
struct server {
char *name;
pid_t pid;
int len;
pid_t pid;
int status;
- char *dbdpn = NULL;
- char *host = NULL;
- int port = 0;
+ char *dbdpn = _PATH_CNID_DBD;
+ char *host = DEFAULTHOST;
+ int port = DEFAULTPORT;
struct db_param *dbp;
int i;
int cc;
}
}
- if (err || !host || !port || !dbdpn) {
+ if (err) {
LOG(log_error, logtype_cnid, "main: bad arguments");
exit(1);
}
<$< >$@
NONGENERATED_MANS = timelord.8
-GENERATED_MANS = afpd.8 atalkd.8 papd.8 papstatus.8 psf.8
+GENERATED_MANS = afpd.8 atalkd.8 cnid_dbd.8 cnid_metad.8 papd.8 papstatus.8 psf.8
TEMPLATE_FILES = $(foreach f,$(GENERATED_MANS),$(f).tmpl)
man_MANS = $(GENERATED_MANS) $(NONGENERATED_MANS)
--- /dev/null
+.TH CNID_METAD 8 "28 Nov 2003" ":NETATALK_VERSION:"
+
+.SH NAME
+cnid_metad \- start cnid_dbd daemons on request
+.SH SYNOPSIS
+.B cnid_metad
+[
+.B -d
+]
+[
+.B -h
+.I hostname
+]
+[
+.B -p
+.I port
+]
+[
+.B -u
+.I user
+]
+[
+.B -g
+.I group
+]
+[
+.B -s
+.I cnid_dbd pathname
+]
+.SH DESCRIPTION
+.B cnid_metad
+waits for requests from
+.BR afpd
+to start up instances of the
+.BR cnid_dbd
+daemon. It keeps track of the status of a
+.BR cnid_dbd
+instance once started and will restart it if necessary.
+.B cnid_metad
+is normally started at boot time from
+.BR /etc/rc
+or equivalent and runs until shutdown.
+.BR afpd
+needs to be configured with the
+.B -cnidserver
+option in
+.BR afpd.conf
+in order to access
+.B cnid_metad.
+It is possible to run more than one instance of
+.B cnid_metad
+on the same machine if different values for the interface and/or port are specified with the
+.B -h
+and
+.B -p
+options.
+
+.SH OPTIONS
+.TP
+.B \-d
+.B cnid_metad will remain in the foreground and
+will also leave the standard input, standard output and standard error
+file descriptors open. Useful for debugging.
+.TP
+.BI \-h " hostname"
+Use
+.I hostname
+as the network interface for requests as opposed to
+the default
+.B "localhost".
+.TP
+.BI \-p " port"
+Use
+.I port
+as the
+port number for reqests. Default is 4700.
+.TP
+.BI \-u " user"
+Switch to the userid of
+.I user
+before serving requests. This userid will be
+inherited by all
+.BR cnid_dbd
+daemon processes started.
+.TP
+.BI \-u " group"
+Switch to the groupid of
+.I group
+before serving requests. This groupid will be inherited by all
+.BR cnid_dbd
+daemon processes started. Both
+.I user
+and
+.I group
+must be specified as strings.
+.TP
+.BI \-s " cnid_dbd pathname"
+Use
+.I cnid_dbd pathname
+as the pathname
+of the executeable of the
+.BR cnid_dbd
+daemon. The default is
+.IR :SBINDIR:/cnid_dbd.
+.SH CAVEATS
+The number of
+.BR cnid_dbd
+subprocecesses is currently limited to 128. This restriction will be
+lifted in the future.
+.LP
+.B cnid_metad
+does not block or catch any signals apart from SIGPIPE. It will
+therefore exit on most signals received. This will also cause all instances of
+.BR cnid_dbd's
+started by that
+.B cnid_metad
+to exit gracefully.
+Since state about and IPC access to the
+subprocesses is only maintained in memory by
+.B cnid_metad
+this is desired behaviour. As soon as
+.B cnid_metad
+is restarted
+.BR afpd
+processes will transparently reconnect.
+
+.SH SEE ALSO
+.BR cnid_dbd (1),
+.BR afpd (8)
+
+
+
+
+
+