LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-17-2008, 09:26 PM   #1
yitzle
Member
 
Registered: Aug 2006
Posts: 50

Rep: Reputation: 15
Interface not working on startup - init.d not running properly?


Twice this past week when I turned on my PC (Debian latest stable build) the internet didn't work.
I ran `ifdown eth1; ifup eth1` and it started working.
(eth0 is Firewire, eth1 ethernet)
Why? How do I fix it?
I'm suspicious that the init.d isn't working properly because I added a script/file to /etc/init.d/ that reads `ntpdate {servers}` and when I booted, my clock was off by a few hours. (`ntpdate {servers}` fixed it.) Unless that's just because I didn't include a shebang and/or path in that script... :innocent:
 
Old 03-18-2008, 02:08 AM   #2
digvijay.gahlot
Member
 
Registered: Mar 2008
Posts: 53

Rep: Reputation: 15
Have do changed the script permission to executable in init.d
chmod +x <script-name>
sorry if you know already
 
Old 03-18-2008, 09:35 AM   #3
yitzle
Member
 
Registered: Aug 2006
Posts: 50

Original Poster
Rep: Reputation: 15
Yup. I actually use chmod 700. Most the time the interface is up. Except twice it wasn't...
I tried making a script (owned by root) that ran `ifdown eth1 ; ifup eth1` and "set user or group ID on execution (s)" using chmod 6755, but I get: "/sbin/ifdown: failed to open statefile /etc/network/run/ifstate: Permission denied"
Shouldn't it be running as root?
I tried making that file read/write accessable to everyone (chmod 666) but that just caused the next file to give a permission error.
Hm. For now I let anyone run the script with sudo. It works, but I'd prefer if the suid worked and I'd prefer if it worked without.
EDIT: No go. Even with SUID, it failed. With sudo it worked. So I may as well stick to the shell script and sudo.

EDIT: According to Wikipedia:
"Due to the increased likelihood of security flaws, many operating systems ignore the setuid attribute when applied to executable shell scripts."
Is there a work around?

EDIT: Is this safe? I'm thinking of wrapping the ifdown/ifup in a C program and using the system() call. That should be OK, right?

Last edited by yitzle; 03-18-2008 at 10:03 AM.
 
  


Reply



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
In what init file are networking interface info called from jchance Mandriva 1 01-20-2007 08:12 AM
Working interface fails to initialize on startup ja203 Linux - Wireless Networking 1 12-10-2006 01:12 PM
[SOLVED] System won't startup properly after power failure MBA Whore Linux - Software 14 08-27-2006 10:14 PM
module-init-tools refuses to install properly positiveinflux Linux - Software 23 05-17-2004 04:42 PM
TOMCAT init script not working on startup -- tomcat 4.x / Mandrake Linux 8.0 jmartinph Mandriva 0 03-08-2004 01:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:44 PM.

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
Open Source Consulting | Domain Registration