LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   need help with startup script (https://www.linuxquestions.org/questions/linux-general-1/need-help-with-startup-script-881552/)

zogthegreat 05-19-2011 03:09 AM

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

David the H. 05-19-2011 07:58 AM

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?


All times are GMT -5. The time now is 11:39 PM.