LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-27-2005, 03:02 AM   #1
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Rep: Reputation: 15
write to syslog during boot and rc.local


I have tried putting in my own IFCONFIG commands in /etc/rc.local to set up a static IP address on eth0. After boot I check it using the ifconfig cmd but it doen't appear to have worked.
I would like to write my own message from rc.local to make sure my part is getting executed but gprintf doesn't appear to do it.
After a lot of heartache I finally worked out that my D-Link D504T router is NOT populating the DNS of my eth0 device. I would also like to do this during boot but can't find what command to use. MAN IFCONFIG shows nothing? Currently I use the Mandrake Control Centre's Network & Internet Internet access to do this but don't know how to find what command IT uses.

Can someone plese help me out?
 
Old 07-27-2005, 08:03 AM   #2
pats
Member
 
Registered: Jul 2005
Distribution: Debian Sarge/Etch, (K)Ubuntu, FC6, AIX5.3, VMWare ESXServer
Posts: 159

Rep: Reputation: 30
if you can find out the ip address of your isps dns servers just put them in your /etc/resolv.conf
nameserver blah.balh.aasdf.sdff

if your with me....
errm.
auto setup. mandrake. hmm. i don't like mandrake because if abused me when i was young and linux innocent but i know the RH based distros keep their network config scripts in /etc/sysconfig/network-scripts/

the file i nthere you need to edit is called ifcfg-DEVICENAME ie ifcfg-eth0

google that and see what it comes up with.
g luck
 
Old 07-27-2005, 08:09 AM   #3
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Original Poster
Rep: Reputation: 15
thanks, but I do

have to put the DNS in every boot.
I'd like to know how to write to syslog when rc.local runs as I want to be sure that rc.local is working. If so then the commands I've put ibn there aren't working.
Thanks anyway, can you answer this for me please.

Cheers
 
Old 07-27-2005, 08:32 AM   #4
pats
Member
 
Registered: Jul 2005
Distribution: Debian Sarge/Etch, (K)Ubuntu, FC6, AIX5.3, VMWare ESXServer
Posts: 159

Rep: Reputation: 30
you shouldn't really be running network setup commands from rc.local. not sure where the network scripts on mandrake are.
don't know how to send stuff to the syslog
have you tried looking in some of the other logfiles to see if there are any messages
/var/log/
you shouldn't have to put the dns in every time unless something else is changing your resolv.conf
it should say at the top of your resolv.conf what has changed it. (maybe not in mandrake)
 
Old 07-27-2005, 08:43 AM   #5
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Original Poster
Rep: Reputation: 15
yes, its

the D-link D504T / driver that changes it back. Whatever it is it means that I have to put it in over the top.
I read other posts that said to put things in rc.local. I only want the 3 ifconfigs I need
ifconfig eth0 down
ifconfig eth0 192.168.3.1
ifconfig up
but they don't seem to be executed as once I log-in I su & ifconfig only to find eth0 still has not been sorted.
I don't care really where they go so long as they get exexcuted.

Any advice gratefully received.

PS yes, thats where I saw gprintf & action ...

Last edited by turnbui; 07-27-2005 at 08:44 AM.
 
Old 07-27-2005, 08:48 AM   #6
pats
Member
 
Registered: Jul 2005
Distribution: Debian Sarge/Etch, (K)Ubuntu, FC6, AIX5.3, VMWare ESXServer
Posts: 159

Rep: Reputation: 30
have you tried doing them afterwards when your booted and it works right?

also what is the output from /sbin/route

you could try putting 'exec' infront of the commands in rc.local
 
Old 07-27-2005, 09:20 AM   #7
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Original Poster
Rep: Reputation: 15
After a boot

After a boot
and i've su'd all the cmds work fine
only then does route -n show what i need and only then can i browse internet and local lan.
I will try exec on next boot

Thanks.
 
Old 07-27-2005, 11:45 AM   #8
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Original Poster
Rep: Reputation: 15
unfortunately

putting exec in front didn't seem to do it.
Thanks for the suggestion though.
Tink I'll try writing to a file from inside rc.local ie.

cat /proc/devices > /var/log/ianian.log
or
echo "++++" >> /var/log/ianian.log

instead!
 
Old 07-29-2005, 02:30 PM   #9
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Original Poster
Rep: Reputation: 15
Hmmm! I thouht I had explained that silly ol' me had edited rc.local and lost the x-ecute bit. No wonder it wasn't working.
Sorry to waste eveyones time.
 
  


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
SAMBA - VFAT local mount for all user write access... dolvmin Linux - Software 13 12-21-2006 04:50 PM
Syslog & Named Fails At Boot? ACR Fedora 1 03-31-2005 02:18 PM
syslog local facilities mozilla Linux - General 1 03-11-2005 02:10 PM
NTPD - add to rc.local or write a script downinthemine Linux - Software 0 04-21-2004 10:52 AM
Write permissions in local on ML 9.1 sw4eternity Linux - Newbie 1 11-03-2003 12:56 PM


All times are GMT -5. The time now is 12:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration