LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Startup Script Doesn't Work. (https://www.linuxquestions.org/questions/linux-newbie-8/startup-script-doesnt-work-427977/)

jonwatson 03-24-2006 06:57 AM

Startup Script Doesn't Work.
 
Hi Guys,

I have the following script on my Kubuntu 5.10 box:

Code:

sudo iwconfig eth1 enc <munged> essid driveon
sudo ifconfig eth1 up
sudo dhclient eth1

When I run it as a normal user in my home directory, it works: the network card comes up, gets an IP and I'm groovy.

However, using the same script in the startup rc* directories fails. To put it in the start up scripts I copied the script into /etc/init.d and ran update-rc.d eth1 defaults (the script is called eth1).

I've also tried it without the 'sudo' bits of each line.

Any ideas why it works when run manually, but not as a startup script?

Thanks!

bathory 03-24-2006 08:49 AM

You should give the full path for the commands you're using, i.e:
Code:

/usr/bin/sudo /sbinifconfig eth1 up
becaue PATH is not set yet on boot.

jonwatson 03-24-2006 08:55 AM

Quote:

Originally Posted by bathory
You should give the full path for the commands you're using, i.e:
Code:

/usr/bin/sudo /sbinifconfig eth1 up
becaue PATH is not set yet on boot.

AHA!

Thanks, bathory. I've been banging my head against the wall for hours. I'll give this a whirl when I get back to my box.

Thanks!


All times are GMT -5. The time now is 04:58 PM.