Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Aug 1998 14:33:46 +0200 (CEST)
From:      Stefan Eggers <seggers@semyam.dinoco.de>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Cc:        seggers@semyam.dinoco.de
Subject:   i386/7725: /usr/bin/linux can leave garbage in /tmp
Message-ID:  <199808231233.OAA02830@semyam.dinoco.de>

next in thread | raw e-mail | index | archive | help

>Number:         7725
>Category:       i386
>Synopsis:       /usr/bin/linux can leave garbage in /tmp
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 23 05:50:00 PDT 1998
>Last-Modified:
>Originator:     Stefan Eggers
>Organization:
none
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

	-current from two or three weeks ago, verified with sources
CVSUp'ed yesterday.

>Description:

	/usr/bin/linux doesn't test if the linux LKM is already
loaded or not.  It just blindly calls modload to do the work.

	Now the problem is that modload leaves behind the module in
/tmp when the linux LKM is already loaded.  This can happen after
going single user and then back to multi user.

>How-To-Repeat:

	Make sure linux emulation is enabled in /etc/rc.conf and the
linux LKM is loadded.  Go single user, at the password prompt just
press CTRL-D and after being back in multi user look at the contents
of /tmp.

>Fix:

	I just took the test from /etc/rc.i386 which tests for an
already loaded screen blanker and changed it to work for the linux
LKM.  This code I added to /usr/bin/linux.

	Another way to reach the same goal is to modfiy modload to
also delete the temporary module (if the command line flags say to
delete it) even in case of an error.  Then trying to load an already
loaded module would be a NOP with a non-zero exit status.

Index: linux
===================================================================
RCS file: /usr2/FreeBSD/CVSROOT/src/lkm/linux/linux,v
retrieving revision 1.4
diff -u -r1.4 linux
--- linux	1997/02/22 12:48:25	1.4
+++ linux	1998/08/23 12:06:12
@@ -1,3 +1,4 @@
 #!/bin/sh
 # $Id: linux,v 1.4 1997/02/22 12:48:25 peter Exp $
-modload -e linux_mod -u -q -o /tmp/linux_mod /lkm/linux_mod.o
+modstat | grep linux_mod >/dev/null || \
+   modload -e linux_mod -u -q -o /tmp/linux_mod /lkm/linux_mod.o
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808231233.OAA02830>