LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2006, 07:57 AM   #1
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Rep: Reputation: 30
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!
 
Old 03-24-2006, 09:49 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
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.
 
Old 03-24-2006, 09:55 AM   #3
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Original Poster
Rep: Reputation: 30
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!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'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
Why won’t this init.d startup script work? dholingw Linux - Software 2 06-08-2004 03:40 PM
FALCONS EYE (nethack) FAILS ON STARTUP, use to work, wont work even after reinstall roorings Linux - Software 0 10-08-2003 11:39 PM
What's a startup script? rdaves@earthlink.net Linux - Newbie 1 05-22-2001 04:24 AM


All times are GMT -5. The time now is 01:13 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