rc script running twice ???

Drew Van Zandt drew.vanzandt at gmail.com
Thu Jan 27 14:53:47 EST 2011


Two distinct copies; when I run it from the command line, it backgrounds the
services I'm trying to start, and works quite well.  I do know that if one
runs the script twice in parallel (e.g. start a second copy before the first
finishes) that they both hang and never finish.  (There are also two
identical copies of one of the commands in the script in the process table,
hung and waiting).  Everything the script runs is run as a daemon.  (They do
need to be started in order, though.... hardware init for 8 UARTS
implemented in an FPGA.)

--DTVZ

On Thu, Jan 27, 2011 at 2:38 PM, Kyle Smith <askreet at gmail.com> wrote:

> On Thu, Jan 27, 2011 at 2:26 PM, Drew Van Zandt <drew.vanzandt at gmail.com>wrote:
>
>> Debian Linux (embedded), I'm in runlevel 2, and I'm seeing this when I run
>> ps aux:
>>
>> root       496  0.0  1.9   2808  1232 ttyS0    S+   00:00   0:00 /bin/sh
>> /etc/rc2.d/S40init_xuarts start
>> root       498  0.0  0.8   2808   504 ttyS0    S+   00:00   0:00 /bin/sh
>> /etc/rc2.d/S40init_xuarts start
>>
>> S40init_xuarts is a script of mine that I just put in /etc/init.d/ and
>> linked from rc2.d.
>>
>> Why is it running twice?  I've gone through the first page of
>> possibilities from a google search, I'm hoping one of you can point out my
>> obvious silly mistake,
>>
> since I'm blanking.
>>
>
> Is 496 the parent of 498, or are they two distinct copies?  If so, it's
> probably because it starts with #!/bin/sh.
>
> Typically your S* scripts should exec and background whatever service
> you're trying to start, not stay running once the system is loaded.
>  Otherwise ps aux would be full of S* scripts.  You might want to look at
> start-stop-daemon in Debian.
>
> - Kyle
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20110127/6bcbf363/attachment.html 


More information about the gnhlug-discuss mailing list