Having problems with rc.local

Rick Stevens rstevens at vitalstream.com
Wed Sep 14 00:28:48 UTC 2005


jim ruxton wrote:
> On Tue, 2005-09-13 at 16:08 -0600, karlp at ourldsfamily.com wrote:
> 
>>On Tue, September 13, 2005 4:05 pm, Bob McClure Jr said:
>>
>>>On Tue, Sep 13, 2005 at 05:46:44PM -0400, jim ruxton wrote:
>>>
>>>>>If you would please, we prefer bottom posting here.
>>>>>
>>>>>http://en.wikipedia.org/wiki/Top-posting
>>>>>
>>>>>I'll rearrange this.
>>>>>
>>>>>On Tue, Sep 13, 2005 at 04:05:21PM -0400, jim ruxton wrote:
>>>>>
>>>>>>>On Tue, Sep 13, 2005 at 02:53:26PM -0400, jim ruxton wrote:
>>>>>>>
>>>>>>>>Hi I'm having a problem with a script I put in rc.local and I
>>>>
>>>>was
>>>>
>>>>>>>>wondering if anyone has any suggestions:
>>>>>>>>Below is my script:
>>>>>>>>
>>>>>>>>touch /var/lock/subsys/local
>>>>>>>>/sbin/rmmod uhci-hcd
>>>>>>>>/sbin/modprobe uhci-hcd
>>>>>>>>su - jim -c /home/jim/capture/camera_start_script.sh &
>>>>>>>>
>>>>>>>>
>>>>>>>>What I want to do is unload and reload uhci-hcd and start
>>>>
>>>>another
>>>>
>>>>>>>>script. I have a camera attached to a usb port and when the pc
>>>>
>>>>boots it
>>>>
>>>>>>>>doesn't load the camera driver correctly
>>>>>>>
>>>>>>>Let's fix the real problem, not the work-around.  Look in
>>>>>>>/var/log/messages for error messages.  Here's a quick way to do
>>>>
>>>>that.
>>>>
>>>>>>>Bring it up with less.  Then hit '>' to go to end of file.  Then
>>>>
>>>>hit
>>>>
>>>>>>>'?' (search backwards) and enter "restart".  That should put you
>>>>
>>>>at
>>>>
>>>>>>>the beginning of the boot process in the log.  Then you can either
>>>>>>>just page through it, or search forward (with '/') for "uhci".
>>>>>>>
>>>>>>>
>>>>>>>>but if after booting I reload
>>>>>>>>the uhci-hcd script all works fine. If I manually run rc.local
>>>>
>>>>this
>>>>
>>>>>>>>script works fine as well. So I thought rc.local was the last
>>>>
>>>>thing to
>>>>
>>>>>>>>to run but for some reason running it manually and letting the
>>>>
>>>>computer
>>>>
>>>>>>>>do it during bootup gives different results any idea why?? I
>>>>
>>>>know this
>>>>
>>>>>>>>is probably confusing. Thanks.
>>>>>>>>Jim
>>>>>>>
>>>>>>>You must remember that when rc.local runs at boot time, it has a
>>>>
>>>>very
>>>>
>>>>>>>austere (assume none) environment.  When you run it by hand you
>>>>
>>>>have
>>>>
>>>>>>>all kinds of goodies in the environment.  But let's not make
>>>>>>>work-arounds (which presently don't work).  Let's fix the root
>>>>>>>problem.  The kernel should load the driver(s) on demand.
>>>>>>>
>>>>>>>Cheers,
>>>>>>
>>>>>>_______________________________________________
>>>>>
>>>>>>Thanks Bob,
>>>>>>Tried as you suggested. Not sure that it tells me much. Below is the
>>>>>>info. from /var/log/messages after booting up. and after that what
>>>>
>>>>was
>>>>
>>>>>>written after doing rc.local manually. It looks like in both cases
>>>>
>>>>the
>>>>
>>>>>>uhci info is being loaded identically ?? Do you see anything
>>>>
>>>>suspicious.
>>>>
>>>>>>My camera is on usb 5-1.
>>>>>>
>>>>>><log posting snipped>
>>>>>>
>>>>>>jim
>>>>>
>>>>>Perhaps we need to back up a little further.  Please describe what
>>>>>happens if you comment out the rc.local dodge and reboot.  What is
>>>>>the end result that fails to happen?  The camera is not acknowledged?
>>>>>What error messages?
>>>>>
>>>>>Also, to Rick Stevens: you may be able to solve this better than I.
>>>>>Feel free to jump in.
>>>>
>>>>Thanks Bob,
>>>>I'm ccing this to the developer of capture in case he has some ideas
>>>>about this.
>>>
>>>I think that's a good idea.
>>>
>>>
>>>>When I reboot without the rc.local dodge if I go to start my camera I
>>>>can't initialize it unless I turn the camera off and back on again once
>>>>the machine has booted. I'm using a program called capture based on
>>>>libptp http://www.ucl.cas.cz/~petr/plant-growth/ .
>>>>
>>>>normally I just issue a:
>>>>$ capture start
>>>>command to initialize the camera. If I turn the camera on boot the
>>>>machine and issue this it doesn't work. I get an error message saying
>>>>"can't initialize the camera" If I boot the machine then turn the camera
>>>>on it works fine. I am trying to build a system that allows someone to
>>>>turn on the camera, boot the machine and walk away. I haven't been able
>>>>to find any error messages in the system logs. Any more thoughts on
>>>>this? Thanks!
>>>>Jim
>>>
>>>Okay, if I understand correctly, after booting, just running "capture
>>>start" doesn't work.  But if you either turn the camera off and back
>>>on, or unload and reload the USB driver, then "capture start" works.
>>>
>>>Hmm.  I dunno.  Someone else have an idea?
>>>
>>>Cheers,
>>>--
>>>Bob McClure, Jr.             Bobcat Open Systems, Inc.
>>>robertmcclure at earthlink.net  http://www.bobcatos.com
>>>Peace at any price is inflationary.
>>>
>>>_______________________________________________
>>>Redhat-install-list mailing list
>>>Redhat-install-list at redhat.com
>>>https://www.redhat.com/mailman/listinfo/redhat-install-list
>>>To Unsubscribe Go To ABOVE URL or send a message to:
>>>redhat-install-list-request at redhat.com
>>>Subject: unsubscribe
>>>
>>
>>I understand the situation the same way, Bob. As I've watched (tail -f
>>/var/log/messages) the log, I see that any activity on the port is only
>>picked up if there's a state change. Just unplugging the camera should
>>also work, if my theory is correct.
> 
> Yes you are both corect. Unplugging the camera from the usb port also
> works.
> 
>> I think this is a function of hotplug.
>>I wonder if running hotplug would work?...
> 
> I can try it but I guess it is a similar dodge to what I was trying
> before.
> Well just tried running hotplug and it didn't work : ( . Any other
> thoughts??

I think I missed which OS this was.  If it's FC4 or a 2.6.11 kernel,
there are issues with udev not enumerating correctly and requiring a
status change on the port (unplug, plug will do it).  Supposedly fixed
in 2.6.12-1.1447, but I won't swear to it.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-           Denial.  It ain't just a river in Egypt anymore!         -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list