The restart function of the init script supplied in the
portmap RPM (portmap-4.0-15 for RH 6.1) is severely flawed.
If a killproc of the portmap process is done without using
pmap_dump to save the current port tables, a reboot is in
order. The hapless victim (me) who edits, say, hosts.allow
information and attempts to use
# /etc/rc.d/init.d/portmap restart
to get portmap to read the new access rules quickly finds
that his server needs to be rebooted to get anything to
work. This is certainly unintended behavior of an otherwise
very convenient (restart) service.
My solution (which doubtless could be improved upon) is
to edit the restart function to
rm -f /var/tmp/pmap_table
/usr/sbin/pmap_dump > /var/tmp/pmap_table
if [ -f /var/tmp/pmap_table ] ; then
/usr/sbin/pmap_set < /var/tmp/pmap_table
Note that, so long as the admin is in the habit of using
restart function, rather than separate executions of
start and stop, those functions do not need to be edited.
Indeed, you wouldn't want to save the port table and then
reload it after a reboot. On the other hand, a stop of
portmap probably shouldn't result in having to reboot, but
maybe a slicker job of coding the reload should be
implemented, to take reboots into account.
This may not the cleanest way of doing things, but I
think it ultimately works.
*** This bug has been marked as a duplicate of 14612 ***