+2001-08-17 Ragnar Kjørstad <nfs@ragnark.vestdata.no>
+ H.J. Lu <hjl@lucon.org>
+
+ * etc/redhat/nfslock.init (STATDARG): New. Pass it to rpc.statd.
+
+ * utils/statd/statd.c (longopts): Add "name".
+ (usage): Add "-n/--name".
+ (main): Set MY_NAME with "-n/--name".
+
+ * utils/statd/state.c (change_state): Set MY_NAME only if it
+ is NULL.
+
+ * utils/statd/statd.man: Updated for "-n/--name".
+
2001-07-26 H.J. Lu <hjl@lucon.org>
* nfs-utils.spec (Release): Set to 8.
[ -x /sbin/rpc.lockd ] || exit 0
[ -x /sbin/rpc.statd ] || exit 0
+if [ -n "${STATD_HOSTNAME}" ]; then
+ STATDARG="-n ${STATD_HOSTNAME}"
+else
+ STATDARG=""
+fi
+
# See how we were called.
case "$1" in
start)
daemon rpc.lockd
echo
echo -n "Starting NFS statd: "
- daemon rpc.statd
+ daemon rpc.statd ${STATDARG}
echo
touch /var/lock/subsys/nfslock
;;
daemon rpc.lockd
echo -n "rpc.statd "
killproc rpc.statd
- daemon rpc.statd
+ daemon rpc.statd ${STATDARG}
touch /var/lock/subsys/nfslock
echo "done."
;;
{ "version", 0, 0, 'v' },
{ "outgoing-port", 1, 0, 'o' },
{ "port", 1, 0, 'p' },
+ { "name", 1, 0, 'n' },
{ NULL, 0, 0, 0 }
};
fprintf(stderr," -p, --port Port to listen on\n");
fprintf(stderr," -o, --outgoing-port Port for outgoing connections\n");
fprintf(stderr," -V, -v, --version Display version information and exit.\n");
+ fprintf(stderr," -n, --name Specify a local hostname.\n");
}
/*
version_p = VERSION;
}
+ /* Set hostname */
+ MY_NAME = NULL;
+
/* Process command line switches */
- while ((arg = getopt_long(argc, argv, "h?vVFdp:o:", longopts, NULL)) != EOF) {
+ while ((arg = getopt_long(argc, argv, "h?vVFdn:p:o:", longopts, NULL)) != EOF) {
switch (arg) {
case 'V': /* Version */
case 'v':
exit(1);
}
break;
+ case 'n': /* Specify local hostname */
+ MY_NAME = xstrdup(optarg);
+ break;
case '?': /* heeeeeelllllllpppp? heh */
case 'h':
usage();
.SH NAME
rpc.statd \- NSM status monitor
.SH SYNOPSIS
-.B "/sbin/rpc.statd [-F] [-d] [-?] [-o " port "] [-p " port "] [-V]"
+.B "/sbin/rpc.statd [-F] [-d] [-?] [-n " name "] [-o " port "] [-p " port "] [-V]"
.SH DESCRIPTION
The
.B rpc.statd
.B -F
parameter.
.TP
+.BI "\-n," "" " \-\-name " name
+specify a name for
+.B rpc.statd
+to use as the local hostname. By default,
+.BR rpc.statd
+will call
+.BR gethostname (2)
+to get the local hostname. Specifying
+a local hostname may be useful for machines with more than one
+interfaces.
+.TP
.BI "\-o," "" " \-\-outgoing\-port " port
specify a port for
.B rpc.statd
if (close (fd) == -1)
log (L_ERROR, "close (%s): %s", SM_STAT_PATH, strerror (errno));
- if (!restart) {
+ if (MY_NAME == NULL) {
char fullhost[SM_MAXSTRLEN + 1];
struct hostent *hostinfo;