linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andrey Borzenkov" <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: [Cooker] strange problem with "hotplug" package
Date: Tue, 06 May 2003 13:45:40 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-105222892315303@msgid-missing> (raw)


> my situation below:
>  when i unplug my usb NIC and plug it back,
>  i found "ifplugd" running at my system.
>  and i have "MII_NOT_SUPPORTED=yes" at ifcfg-eth0,
>  so this souldn't be happened.
>  i trace the script /etc/hotplug/net.agent and
>  found that the "grep" command didn't work as expected.
>
>  i shrink the net.agent script as below:
>
>  #!/bin/bash
>  grep -q '^MII_NOT_SUPPORTED' /etc/sysconfig/network-scripts/ifcfg-eth0
>  echo $? > /tmp/grep_result
>
>  /tmp/grep_result is "0" when run script from command-line.(correct result)
>  /tmp/grep_result is "1" when i plug-in  my usb NIC. (wrong result!!)
>
>  i found if i add ">/dev/null" would solve the strange problem.
>  eg: fix first line to:
>  grep -q '^MII_NOT_SUPPORTED' /etc/sysconfig/network-scripts/ifcfg-eth0 >/dev/null

>  now /tmp/result would be "0" if i plug-in my usb NIC.
>  after fix the original net.agent, add ">/dev/null" to grep,
>  i solve my problem, ifplugd woun't start when i plug-in my usb NIC.
>  i found there are many "grep" at /etc/hotplug/* scripts.
>  maybe all these "grep" would suffer as mine.
>  i m curious what casue "grep" stop working without ">/dev/null".
>  anybody who can tell me ??

bor@cooker% grep -q bor /etc/passwd <&- >&-
grep: write error: Bad file descriptor
bor@cooker% echo $?
1

exec_usermodehelper closes all file descriptors so grep barfs.
Adding > /dev/null makes a valid stdout.

This is om Mandrake 9.0; you say it is on 9.1 ... well, this
definitely makes hotplug life harder. 

i wonder why grep would write to stdout with -q:

-q, --quiet, --silent
    Quiet;  do  not write anything to standard output.  Exit immedi-
    ately with zero status if any match is found, even if  an  error
    was detected.  Also see the -s or --no-messages option.


bor@cooker% uname -a
Linux cooker.mow.siemens.ru 2.4.20-2mdk #1 Mon Dec 9 15:07:53 CET 2002 i686 unknown unknown GNU/Linux
bor@cooker% rpm -q hotplug grep
hotplug-2002_04_01-2mdk
grep-2.5-5mdk


-andrey


-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com 

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

             reply	other threads:[~2003-05-06 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-06 13:45 Andrey Borzenkov [this message]
2003-05-06 15:54 ` [Cooker] strange problem with "hotplug" package Stepan Kasal
2003-05-06 20:12 ` Jim Meyering
2003-05-08 12:24 ` Stepan Kasal
2003-05-08 16:17 ` Jim Meyering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-105222892315303@msgid-missing \
    --to=arvidjaar@mail.ru \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).