Bug 9875 - portmap init.d script restart option obliterates current portmap tables
Summary: portmap init.d script restart option obliterates current portmap tables
Status: CLOSED DUPLICATE of bug 14612
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: portmap (Show other bugs)
(Show other bugs)
Version: 6.1
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact:
URL: http://citusc.usc.edu/~rcorrado/portm...
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-03-01 02:32 UTC by Richard Corrado
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-03-01 02:32:38 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Richard Corrado 2000-03-01 02:32:38 UTC
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

restart|reload)
	rm -f /var/tmp/pmap_table
        /usr/sbin/pmap_dump > /var/tmp/pmap_table
	$0 stop
	$0 start
	if [ -f /var/tmp/pmap_table ] ; then
                /usr/sbin/pmap_set < /var/tmp/pmap_table
        fi
	;;

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.

Comment 1 Jeff Johnson 2000-07-27 21:44:56 UTC

*** This bug has been marked as a duplicate of 14612 ***


Note You need to log in before you can comment on or make changes to this bug.