(Message inbox:93)
Received: from ATHENA-AS-WELL.MIT.EDU by e40-po.MIT.EDU (5.61/4.7) id AA22719; Wed, 30 Jun 93 04:49:21 EDT
Received: from AUDITORIUM.MIT.EDU by Athena.MIT.EDU with SMTP
	id AA07870; Wed, 30 Jun 93 04:49:18 EDT
Received: by auditorium (5.57/4.7) id AA01546; Wed, 30 Jun 93 04:49:16 -0400
Date: Wed, 30 Jun 93 04:49:16 -0400
Message-Id: <9306300849.AA01546@auditorium>
From: Calvin Clark <ckclark@MIT.EDU>
To: charon-maintainers@Athena.MIT.EDU
Cc: sipb-staff@Athena.MIT.EDU
Subject: mountd restarter for charon  

Following Ted's suggestions, I ported the ninit.c program which is
used to restart named on the mailhubs and nameservers so that it can be
used to restart mountd as well.   I placed the source for a debugging
mountd (one compiled with -g -DDEBUG -DDEBUG_FULL) in
/afs/sipb/project/dec-charon/src/mountd.  I placed the restarter, which
I renamed `minit', in the tools subdirectory of that directory.  You
can look at the source and RCS logs to get an idea of what I changed.
The major new thing is that to check mountd, it makes an rpc call---the
same one made by `showmount -e'---and if the rpc call fails, it restarts
mountd.  Minit will log on the facility local6; I modified nsyslog.conf
accordingly, and restarted the syslog daemon.  The mountd verbose
debugging information prints to stderr rather than syslogging, so in
order to get it, I invoked minit with the -N option, which prevents it
from forking.  I have modified /etc/athena/rc.athena (it was the
quickest way, and it looks like it's been done a lot) to invoke minit
instead of mountd.

A summary of files, for future reference:

/usr/local/etc/minit - the mountd restarter
/usr/local/etc/mountd - the debugging mountd
/usr/adm/minit.log - the stderr of minit(mountd)
/usr/adm/minit.syslog - the syslogs on local6.debug and higher, from minit
/etc/minit.pid - the process id file for minit
/etc/mountd.pid - the process id file for mountd (written by minit)

MAINTENANCE NOTE:

	The only important thing to know is not to start mountd
manually anymore.  Use minit.  If minit is currently running, but mountd
seems wedged, send a hangup signal to the minit process:

	% kill -HUP `cat /etc/minit.pid`

and it will restart mountd for you.  (Sending a SIGTERM will cause minit
to clean up after itself and kill mountd; you normally don't want to do
that, so remember the HUP.)

	If minit is not running at all, invoke it with the same line
as used in /etc/athena/rc.athena, namely (in csh):

 	/usr/local/etc/minit -N >>& /usr/adm/minit.log &

This is a very lightweight way of insuring that the mountd stays
running.
