Script doesn't keep running from other script

Alan Dayley adayley at gmail.com
Wed May 14 16:31:45 UTC 2008


On Wed, May 14, 2008 at 8:41 AM, Lombard, David N
<dnlombar at ichips.intel.com> wrote:
>> setsid /bin/sh /mnt/FlashMemory/usbmountd >/dev/null 2>&1 </dev/null &
>
> Wouldn't this be better to start via inittab?  Could also handle restart
> on failure...

Yes, it would.  However, expediency and lack of knowledge on my part
are at play here.

I am an embedded software engineer but most of my experience is on
platforms other than Linux.  My experience with the Linux boot
process, especially in embedded, is shallow.  The one source of
information on how to do this using inittab and/or udev did not work
for me so I went for the brute force method.

The goal is to sense when a USB storage device is inserted and
automatically mount it.  My script already did standard USB flash
drives just fine.  The tricky part is USB flash card readers.  They
may or may not have a flash card inserted and the flash cards come and
go.  This thread was a result of trying to come up with a way of
knowing when an SD card is inserted in an already attached reader and
then mounting that card.  It also needs to clean up if the USB drive,
reader or just the card is suddenly removed.

If you have some knowledge or resources on how to accomplish this
through the kernel infrastructure, I'm all for reading about it!

In the mean time, I started a different thread which led to the use of
"hdparm -z /dev/sda" as the way to see if a partition is available.
I'm taking that path for now.

Thanks.

Alan



More information about the busybox mailing list