2003-02-24 16:06:33

by Stelian Pop

[permalink] [raw]
Subject: modutils: FATAL: Error running install...

With the latest 2.5-bk (and module-init-tools), my logs
are polluted with lines like:
FATAL: Error running install command for block_major_2
triggered with
# cat /dev/fd0
where the corresponding line in modprobe.conf is:
install block-major-2 /bin/true

The problem is reproductible with any 'install' command in
modprobe.conf.

Looking at modprobe source, it fails on the system() call. The
fork()/exec() part works corectly (/bin/true get executed),
but wait4() fails with -ECHILD.

Running 'modprobe block-major-2' from the console works as
expected.

I believe this is once again related to the exec_usermodehelper()
routines...

Stelian.
--
Stelian Pop <[email protected]>


2003-02-24 16:17:41

by Stelian Pop

[permalink] [raw]
Subject: Re: modutils: FATAL: Error running install...

On Mon, Feb 24, 2003 at 05:16:27PM +0100, Stelian Pop wrote:

> With the latest 2.5-bk (and module-init-tools), my logs
> are polluted with lines like:
> FATAL: Error running install command for block_major_2

And replying to my own message after reading the latest posts
on lkml, I confirm that Mikael Pettersson's patch works for me.

I rediffed it below against the latest bk.

Linus, please apply.

Stelian.

===== kernel/kmod.c 1.24 vs edited =====
--- 1.24/kernel/kmod.c Mon Feb 24 04:18:09 2003
+++ edited/kernel/kmod.c Mon Feb 24 17:19:39 2003
@@ -154,6 +154,7 @@

/* Unblock all signals. */
flush_signals(current);
+ current->sighand->action[SIGCHLD-1].sa.sa_handler = SIG_DFL;
spin_lock_irq(&current->sighand->siglock);
flush_signal_handlers(current);
sigemptyset(&current->blocked);

--
Stelian Pop <[email protected]>

2003-02-25 01:20:11

by Rusty Russell

[permalink] [raw]
Subject: Re: modutils: FATAL: Error running install...

In message <[email protected]> you write:
> ===== kernel/kmod.c 1.24 vs edited =====
> --- 1.24/kernel/kmod.c Mon Feb 24 04:18:09 2003
> +++ edited/kernel/kmod.c Mon Feb 24 17:19:39 2003
> @@ -154,6 +154,7 @@
>
> /* Unblock all signals. */
> flush_signals(current);
> + current->sighand->action[SIGCHLD-1].sa.sa_handler = SIG_DFL;
> spin_lock_irq(&current->sighand->siglock);
> flush_signal_handlers(current);
> sigemptyset(&current->blocked);

Is there really no cleaner way that this?

Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

2003-02-25 13:14:56

by Mikael Pettersson

[permalink] [raw]
Subject: Re: modutils: FATAL: Error running install...

Rusty Russell writes:
> In message <[email protected]> you write:
> > ===== kernel/kmod.c 1.24 vs edited =====
> > --- 1.24/kernel/kmod.c Mon Feb 24 04:18:09 2003
> > +++ edited/kernel/kmod.c Mon Feb 24 17:19:39 2003
> > @@ -154,6 +154,7 @@
> >
> > /* Unblock all signals. */
> > flush_signals(current);
> > + current->sighand->action[SIGCHLD-1].sa.sa_handler = SIG_DFL;
> > spin_lock_irq(&current->sighand->siglock);
> > flush_signal_handlers(current);
> > sigemptyset(&current->blocked);
>
> Is there really no cleaner way that this?

Linus cleaned it up in 2.5.63 -- he added a flag to flush_signal_handlers().