daemonizing. This is more portable and avoids zombie "rpc.statd"
processes after an NFS client running e.g. Mac OS X shuts down.
Reviewed by christos@.
space, or the database will be corrupted (noticed when the database is
updated in reset_host()). Change change_host() to copy hostname and HostInfo
to local storage before calling db->put().
Change notify_one() to use change_host() instead of calling db->put()
directly.
memory copy of the file is dirty, is will be synced when the child exists.
But the parent may have done changes to the database in the meantime, resulting
in a db corruption.
Fix this by calling sync_file() just before the fork. The child will still have
a reference to the db, but won't try to write it on exit.
with both names. So log the "Unsolicited notification" with LOG_DEBUG
instead of LOG_ERR.
Don't return failure if we received a notification for which the host is
unknown, or we don't have outstanding requests. The remote host will retry
forever otherwise.
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
Stopgap fix for PR 4225 by Matthias Scheler (rpc.statd doesn't run on m68k).
XXX This should be done in a different way. XXX
Matthias proposes to use a PMAP capable of mapping more than 256 MB
per user process (You can do this by changing your vm_param constants
even now).
However, statd could use saner data structure to save on address space
easily. E.g., most host names will be much smaller than the allocated
1024(+1 for trailing zero) bytes. Using variable length names would
allow, depending on environment, a factor of 30 more hosts per address
space.
Btw, if anybody really needs more than 16k hosts handled by statd, the
data structure is unsuable anyway; currently, the array of entries is
linearly searched. Something like a DB_BTREE should be used.
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.