LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-19-2011, 04:09 AM   #1
zogthegreat
Member
 
Registered: Apr 2009
Location: Montreal, Canada
Distribution: Fedora, CentOS, Ubuntu
Posts: 47

Rep: Reputation: 16
need help with startup script


Hi everyone,

I need some help with startup script. I have a problem with an error on system boot:

hub 2-0:1.0:unable to enumerate usb device on port 5

This error is continuous, filling up my system logs. It is also a known kernel bug. I found a solution here:

http://www.absolutelytech.com/2010/0...ling-ehci_hcd/

but it is only good after I boot. I have tried to make a startup script in /etc/init.d in the following manner.

sudo mkdir /opt/usb/
sudo gedit /opt/usb/usbproblem.sh

#!/bin/bash
# chkconfig: 345 91 19
# description: stop usb problem on startup

case $1 in
*)

echo "fixing usb problem"
cd /sys/bus/pci/drivers/ehci_hcd
sh -c 'find ./ -name "2-0:1.0" -print| sed "s/\.\///">unbind'
cd ~

esac
exit 0
#End of boot script
##

sudo cp /opt/usb/usbproblem.sh /etc/init.d
cd /etc/init.d
sudo chmod +x usbproblem.sh
sudo update-rc.d usbproblem.sh defaults 92 20

but it does not work.

Does anyone know where I am messing up?

BTW, running Ubuntu 11.04

zog@phoenix:~$ uname -a
Linux phoenix 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Thanks

zog
 
Old 05-19-2011, 08:58 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,837

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
1) Your link is broken.

2) Please use [code][/code] tags around your code, to preserve formatting and to improve readability.

3) Is there any purpose for the (apparently) useless case statement, since there's no situation in which the code wouldn't run? Not to mention launching a subshell to run the find command.

4) How exactly does it "not work"? Have you tried, for example, redirecting the output of the commands in it to a file, so you can see what it's actually doing?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
startup script losintikfos Linux - Newbie 1 08-28-2008 05:32 AM
Help: Startup script aloneattack Red Hat 2 03-06-2008 04:01 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 03:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 10:40 PM
Startup Script LtcJohnson Linux - Newbie 2 10-26-2004 12:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration