[Pkg-sysvinit-devel] Bug#490893: Bug#490893: initscripts: reboot fails to unmount '/'

Subhashis Roy subhashis3 at fastmail.fm
Mon Sep 15 16:14:26 UTC 2008


Hi Peter,

Thanks for your prompt reply.

I find that '/etc/init.d/portmap' has permission to execute.
However, I checked by writing a small line within '/etc/init.d/portmap' 
Stop that it is not getting called.

Attached is the output of 'ls /etc/rc[06].d'.

Also, 'ls -ltr /etc/rc[06].d/*port*' shows:
lrwxrwxrwx 1 root root 17 Sep 10 11:24 /etc/rc6.d/S32portmap -> ../init.d/portmap*
lrwxrwxrwx 1 root root 17 Sep 10 11:24 /etc/rc0.d/S32portmap -> ../init.d/portmap*

I am also attaching the '/etc/init.d/portmap' (before my change) file as 
in my machine, in case you want to examine it (I can easily circumvent 
this problem by killing 'portmap' separately during 'reboot' in a script, 
but is not a good choice in general).

Subhashis

On Mon, 15 Sep 2008, Petter Reinholdtsen wrote:

> [Subhashis Roy]
>> Following one of the suggestions in one bug report, I added 'fuser
>> -vm / >> /root/umount.root.err; sync' and found that 'portmap' is
>> still running causing the message that root partition is busy.
>
> This lead to the next question, which is why is portmap still running?
> I know portmap make sure it isn't killed by sendsigs, and thus take
> over the responsibility of existing before reboot.  Why does thie
> stopping of portmap fail during reboot?  Is the portmap stop script
> not executed as it should?
>
> Please provide the output from 'ls /etc/rc[06].d'.
>
> Happy hacking,
> -- 
> Petter Reinholdtsen
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ls.rc0.6.d
Type: text/x-dsrc
Size: 2916 bytes
Desc: 
Url : http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20080915/7fd9ff23/attachment.d 
-------------- next part --------------
#!/bin/sh
#
# start/stop portmap daemon.

### BEGIN INIT INFO
# Provides:          portmap
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     S 2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: The RPC portmapper
# Description:       Portmap is a server that converts RPC (Remote
#                    Procedure Call) program numbers into DARPA
#                    protocol port numbers. It must be running in
#                    order to make RPC calls. Services that use
#                    RPC include NFS and NIS.
### END INIT INFO

test -f /sbin/portmap || exit 0

. /lib/lsb/init-functions

OPTIONS=""
if [ -f /etc/default/portmap ]; then
  . /etc/default/portmap
elif [ -f /etc/portmap.conf ]; then
  . /etc/portmap.conf
fi

case "$1" in
    start)
	log_begin_msg "Starting portmap daemon..."
	pid=`pidof portmap`
	if [ -n "$pid" ] ; then
	      log_begin_msg "Already running."
	      log_end_msg 0
	      exit 0
	fi
	start-stop-daemon --start --quiet --oknodo --exec /sbin/portmap -- $OPTIONS
	log_end_msg $?

	if [ -f /var/run/portmap.upgrade-state ]; then
	  log_begin_msg "Restoring old RPC service information..."
	  sleep 1 # needs a short pause or pmap_set won't work. :(
	  pmap_set </var/run/portmap.upgrade-state
	  log_end_msg $?
	  rm -f /var/run/portmap.upgrade-state
	else
	  if [ -f /var/run/portmap.state ]; then
	    sleep 1 # needs a short pause or pmap_set won't work. :(
	    pmap_set </var/run/portmap.state
	    rm -f /var/run/portmap.state
	  fi
	fi

	mkdir -p /lib/init/rw/sendsigs.omit.d
	rm -f /lib/init/rw/sendsigs.omit.d/portmap
	ln -s /var/run/portmap.pid /lib/init/rw/sendsigs.omit.d/portmap

	;;
    stop)
	log_begin_msg "Stopping portmap daemon..."
	pmap_dump >/var/run/portmap.state
	start-stop-daemon --stop --quiet --oknodo --exec /sbin/portmap
	log_end_msg $?
	;;
    force-reload)
	$0 restart
	;;
    restart)
	$0 stop
	$0 start
	;;
    *)
	log_success_msg "Usage: /etc/init.d/portmap {start|stop|force-reload|restart}"
	exit 1
	;;
esac

exit 0



More information about the Pkg-sysvinit-devel mailing list