From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 20573 invoked from network); 21 Apr 1998 11:58:58 -0000 Received: from slip-32-100-110-113.vt.us.ibm.net (HELO air.steve.net) (32.100.110.113) by mail2.redhat.com with SMTP; 21 Apr 1998 11:58:58 -0000 Received: from localhost (localhost [127.0.0.1]) by air.steve.net (8.6.12/8.6.9) with SMTP id IAA02544; Tue, 21 Apr 1998 08:01:40 -0400 Date: Tue, 21 Apr 1998 08:01:39 -0400 (EDT) From: "Steven N. Hirsch" X-Sender: hirsch@air.steve.net To: Mikael Pettersson cc: adam@yggdrasil.com, shirsch@ibm.net, gaz@andrew.cmu.edu, axp-list@redhat.com Subject: Re: daemon-less kmod & Alpha no-go! In-Reply-To: <199804210917.LAA00234@zephir.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 21 Apr 1998, Mikael Pettersson wrote: > On Mon, 20 Apr 1998, Steven H. Hirsch wrote: > > > #!/bin/sh > > echo logging_modprobe $* > /tmp/modprobe.log.$$ > > /usr/bin/strace /sbin/modprobe $* >> /tmp/modprobe.log.$$ 2>&1 > > > > as 'strace' writes to stderr. > > ... > > What is so different about the environment under a subshell? > > Actually, this shell script does a user-space fork() + exec() > to run strace. This would most likely mask any problems in > the kernel thread we created for running the thing. > For comparison, could you please also try running strace as follows: > > #!/bin/sh > echo logging_modprobe $* > /tmp/modprobe.log.$$ > exec /usr/bin/strace /sbin/modprobe $* >> /tmp/modprobe.log.$$ 2>&1 > > (I'm also worried that strace itself will fork/exec modprobe, > but we can't do much about that, can we?) Veerrry interesting. This is all that ends up in the log file: logging_modprobe -s -k char-major-9 execve("/sbin/modprobe", ["/sbin/modprobe", "-s", "-k", "char-major-9"], [/* 7 vars */]) = 0 The result suggests that execve() which is not preceeded by a fork fails (?). Could the kernel be getting confused; perhaps exiting from the thread instead of running the target? > Another interesting possibility would be to have the script > just run insmod on some harmless module, e.g. > > #!/bin/sh > exec /sbin/insmod /lib/modules/2.1.97/misc/loop.o It seems that anything which we try to 'exec' from the script fails. > Also, you could try a simpler kmod without any of the safety > features we put in, i.e. replace exec_modprobe() with: > That was one of the first things I tried last weekend - no change. Steve