lkml.org 
[lkml]   [1998]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: daemon-less kmod & Alpha no-go!


On Mon, 20 Apr 1998, Adam J. Richter wrote:

> How about trying the following:

(snip)

Actually, needs to be:

#!/bin/sh
echo logging_modprobe $* > /tmp/modprobe.log.$$
/usr/bin/strace /sbin/modprobe $* >> /tmp/modprobe.log.$$ 2>&1
as 'strace' writes to stderr.

Interestingly enough, it starts working when run indirectly <g>. The
trace is attached for loading of the SCSI tape driver.

> You might also try modifying that shell script to echo something
> to standard output, so that you can verify that modprobe has gotten
> init's file descriptors.

I did this. Nothing makes it to the screen or logs.

The success of modprobe under the shell script started me thinking. I
renamed /sbin/modprobe to /sbin/modprobe.real and created a stub
/sbin/modprobe like this:

#!/bin/sh
shift
/sbin/modprobe.real $*


Lo and behold, this does the trick. Sort of bizarre (and possibly a
security hole?), but functional. The question of the hour is:

What is so different about the environment under a subshell?

Perhaps those more knowledgeable can glean some clues from the strace
output.

Steve




logging_modprobe -s -k char-major-9
execve("/sbin/modprobe", ["/sbin/modprobe", "-s", "-k", "char-major-9"], [/* 8 vars */]) = 0
brk(0) = 0x12010857c
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 0
fstat(0, {st_mode=01, st_size=893125961, ...}) = 0
mmap(0, 4831835984, PROT_READ, 0 /* MAP_??? */, 0, 0) = 0x20000010000
close(0) = 0
open("/lib/libc.so.6.1", O_RDONLY) = 0
mmap(0, 0, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x20000012000
mmap(0, 0, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x20000014000
munmap(0x20000012000, 8192) = 0
mmap(0, 8192, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x20000110000
mprotect(0x200001dc000, 1154856, PROT_NONE) = 0
mmap(0x200002d0000, 1154856, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x200002d0000
mmap(0x200002ec000, 1154856, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x200002ec000
close(0) = 0
personality(0 /* PER_??? */) = 0
osf_getsysinfo(0x2d, 0x11ffffd90, 0x11ffffe10, 0, 0x300000000) = 0
osf_setsysinfo(0xe, 0x11ffffd90, 0x11ffffe10, 0, 0x300000000) = 0
getxpid() = 547
brk(0) = 0x12010857c
brk(0x1201085bc) = 0x1201085bc
brk(0x12010a000) = 0x12010a000
uname({sys="Linux", node="alpha.fast.net", ...}) = 0
access("/etc/modules.conf", R_OK) = 0
stat("/etc/modules.conf", {st_mode=01, st_size=893125769, ...}) = 0
open("/etc/modules.conf", O_RDONLY) = 0
fstat(0, {st_mode=01, st_size=893125769, ...}) = 0
mmap(0, 4831828304, PROT_WRITE|PROT_EXEC|0x1b0, 0 /* MAP_??? */, 12884901888, 0) = 0x20000012000
read(0, "alias eth0 tulip\nalias eth1 tul"..., 8192) = 117
read(0, "", 8192) = 0
close(0) = 0
munmap(0x20000012000, 8192) = 0
uname({sys="Linux", node="alpha.fast.net", ...}) = 0
stat("/lib/modules/2.1.97/modules.dep", {st_mode=01, st_size=893125769, ...}) = 0
open("/lib/modules/2.1.97/modules.dep", O_RDONLY) = 0
fstat(0, {st_mode=01, st_size=893125769, ...}) = 0
mmap(0, 4831828720, PROT_WRITE|PROT_EXEC|0x1b0, 0 /* MAP_??? */, 12884901888, 0) = 0x20000012000
read(0, "/lib/modules/2.1.97/fs/binfmt_mi"..., 8192) = 680
read(0, "", 8192) = 0
close(0) = 0
munmap(0x20000012000, 8192) = 0
SYS_347(0, 0, 0, 0, 0) = 0
open("/lib/modules/2.1.97/ipv6", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
open("/lib/modules/2.1.97/ipv4", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
open("/lib/modules/2.1.97/cdrom", O_RDONLY|O_NONBLOCK) = 0
fcntl(0, F_SETFD, FD_CLOEXEC) = 0
fstat(0, {st_mode=02, st_size=893125769, ...}) = 0
brk(0x12010e000) = 0x12010e000
lseek(0, 0, SEEK_CUR) = 0
getdents(0, /* 3 entries */, 7944) = 80
stat("/lib/modules/2.1.97/cdrom/.", {st_mode=02, st_size=893125961, ...}) = 0
stat("/lib/modules/2.1.97/cdrom/..", {st_mode=010, st_size=893031120, ...}) = 0
stat("/lib/modules/2.1.97/cdrom/cdrom.o", {st_mode=01, st_size=1524253315, ...}) = 0
access("/lib/modules/2.1.97/cdrom/cdrom.o", R_OK) = 0
lseek(0, 0, SEEK_CUR) = 1024
getdents(0, /* 0 entries */, 7944) = 0
open("/lib/modules/2.1.97/block", O_RDONLY|O_NONBLOCK) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
fstat(3, {st_mode=02, st_size=893125769, ...}) = 0
lseek(3, 0, SEEK_CUR) = 0
getdents(3, /* 4 entries */, 7944) = 104
stat("/lib/modules/2.1.97/block/.", {st_mode=02, st_size=893125961, ...}) = 0
stat("/lib/modules/2.1.97/block/..", {st_mode=010, st_size=893031120, ...}) = 0
stat("/lib/modules/2.1.97/block/rd.o", {st_mode=01, st_size=1524253315, ...}) = 0
access("/lib/modules/2.1.97/block/rd.o", R_OK) = 0
stat("/lib/modules/2.1.97/block/loop.o", {st_mode=01, st_size=1524253315, ...}) = 0
access("/lib/modules/2.1.97/block/loop.o", R_OK) = 0
lseek(3, 0, SEEK_CUR) = 1024
getdents(3, /* 0 entries */, 7944) = 0
open("/lib/modules/2.1.97/scsi", O_RDONLY|O_NONBLOCK) = 4
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
fstat(4, {st_mode=02, st_size=893125769, ...}) = 0
brk(0x120112000) = 0x120112000
lseek(4, 0, SEEK_CUR) = 0
getdents(4, /* 4 entries */, 7944) = 104
stat("/lib/modules/2.1.97/scsi/.", {st_mode=02, st_size=893125961, ...}) = 0
stat("/lib/modules/2.1.97/scsi/..", {st_mode=010, st_size=893031120, ...}) = 0
stat("/lib/modules/2.1.97/scsi/st.o", {st_mode=01, st_size=1524253315, ...}) = 0
access("/lib/modules/2.1.97/scsi/st.o", R_OK) = 0
SYS_347(0, 0x1, 0x12010f800, 0x400, 0x11ffffcb0) = 0
sigaction(SIGINT, {SIG_IGN}, {SIG_DFL}) = 0
sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}) = 0
sigprocmask(SIG_BLOCK, [CHLD]) = 0 (old mask [])
fork() = 548
wait4(548, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 548
sigaction(SIGINT, {SIG_DFL}, NULL) = 0
sigaction(SIGQUIT, {SIG_DFL}, NULL) = 0
sigprocmask(SIG_SETMASK, []) = 0x80000 (old mask [CHLD])
--- SIGCHLD (Child exited) ---
exit(0) = ?
\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.230 / U:0.176 seconds]
©2003-2011 Jasper Spaans. Advertise on this site