[comp.os.minix] /etc/umount & /etc/update

csrobe@cs.wm.edu (Chip Roberson) (12/15/88)

Can someone explain the following...

	I had a bug that caused /etc/update to hang
	I then killed /etc/update
	I then restarted update (/etc/update &)
		while cd'd into a /usr subdir
	I then cd'd to / and tried to
		/etc/umount /dev/at0	(where /usr was mounted)
	which told me that it was busy.

I had no other processes running.  I then killed /etc/update
and I could umount /dev/at0.

Can someone please explain to me why umount thought /dev/at0 was busy.

cheers,
-c
-------------------------------------------------------------------------
Chip Roberson                ARPANET:  csrobe@cs.wm.edu
1328-F Mt. Vernon Ave.       BITNET:   #csrobe@wmmvs.bitnet
Williamsburg, VA 23185       UUCP:     ...!uunet!pyrdc!gmu90x!wmcs!csrobe
-------------------------------------------------------------------------

br@laura.UUCP (Bodo Rueskamp) (12/16/88)

In article <5982@louie.udel.EDU> csrobe@cs.wm.edu (Chip Roberson) writes:
#I had no other processes running.  I then killed /etc/update
#and I could umount /dev/at0.
#
#Can someone please explain to me why umount thought /dev/at0 was busy.

The current directory of /etc/update was on /dev/at0.

--
Bodo Rueskamp
br@unido.uucp

ast@cs.vu.nl (Andy Tanenbaum) (12/20/88)

In article <5982@louie.udel.EDU> csrobe@cs.wm.edu (Chip Roberson) writes:
>Can someone please explain to me why umount thought /dev/at0 was busy.

/etc/mount and /etc/umount keep track of what is mounted in /etc/mtab.
That file just contains strings.  If you type:
   /etc/mount /dev/fd0 /usr
   /etc/umount /dev/at0

the mount system call will work and it will unmount, but /etc/mtab will be
messed up.  I suspect something like this happened.

Andy Tanenbaum (ast@cs.vu.nl)

brucee@runx.ips.oz (Bruce Evans) (12/21/88)

Chip Roberson writes:
>	I then restarted update (/etc/update &)
>		while cd'd into a /usr subdir
>	I then cd'd to / and tried to
>		/etc/umount /dev/at0	(where /usr was mounted)
>	which told me that it was busy.
>
>I had no other processes running.  I then killed /etc/update
>and I could umount /dev/at0.
>
>Can someone please explain to me why umount thought /dev/at0 was busy.

Updates's current directory was still active.

I fixed this by putting

	chdir("/");

in update.c. Cron.c has the same problem. I had previously wondered why
cron was locking my /usr partition. But it must be something else, cron
started from /etc/rc (it is an old unofficial version anyway).

When I tried the fix for cron.c (both versions), I had to fix some other
problems. Cron.c closes stdio rather than fclosing it. This confused my
version of stdio (probably my fault). Then cron couldn't handle leading
white space. My usual crontab is empty, so I copied one of the examples,
but this exposed the bug.

Bruce Evans
Internet: brucee@runx.ips.oz.au    UUCP: uunet!runx.ips.oz.au!brucee