LinuxQuestions.org
Review your favorite Linux distribution.
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 02-15-2003, 11:50 PM   #1
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Rep: Reputation: 30
What script for adding an ifconfig command?


What script do I edit and add something for my ifconfig command. I want to do a "ifconfig eth0 trailers" for my network setup at boot. I'm tired of putting that in each time I reboot. Thanks.
 
Old 02-16-2003, 01:33 AM   #2
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
I tried editing /etc/init.d/boot.local and adding the line 'ifconfig eth0 trailers' but didn't work.
 
Old 02-16-2003, 03:19 AM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Look in /etc See if you can find a file named rc.local (it may be a symlink, that's fine). If it's not there, decend into /etc/rc.d and see if you now can locate a rc.local file. This is where I'd place any personal startup scrips/commands.

Cool
 
Old 02-16-2003, 02:29 PM   #4
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
None of those you listed were found, but I did find this readme in my /etc:

Hi!

Some people expect the system startup scripts in /etc/rc.d/.
We use a slightly different structure for better LSB compliance.
You can find the equivalent files in /etc/init.d/.
The behaviour of the scripts can be configured in the files
below the directory /etc/sysconfig/.

For detailed information please have a look into the SuSE Linux manual.
If you don't have a printed manual, you can find the electronic version
in /docu on the first CDROM or in the package 'books.rpm'.

You may also want to read /etc/init.d/README for more information.

Have a lot of fun

Your SuSE Team
 
Old 02-16-2003, 02:51 PM   #5
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
Closest to rc.local is boot.local in /etc/init.d, which it reads:

#! /bin/sh
#
# Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany. All rights reserved.
#
# Author: Werner Fink <werner@suse.de>, 1996
# Burchard Steinbild <feedback@suse.de>, 1996
#
# /etc/init.d/boot.local
#
# script with local commands to be executed from init on system startup
#
# Here you should add things, that should happen directly after booting
# before we're going to the first run level.
#

I tried adding ifconfig eth0 trailers to this, but didn't work as it didn't work in /etc/sysconfig/network/ifcfg-eth0.
 
Old 02-16-2003, 05:43 PM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
What other scripts are in your init.d directory? Post up your ls on that directory, there may be a better place to put it. Here's where I'm going with this:
Maybe whatever ifconfig that gets run normally during startup needs to have already ran when you try running your custom command. In order for that to happen, you may have to find the script where the normal ifconfig is already getting executed, and at the end of that script, add your custom command.

More and more I hope you are seeing how SuSE likes to appear to be a standard "type" linux distro, but does things in it's own little way, more-so than any other distro I've used (one of the biggest reasons I took it off my box).

Anyway, enough of my ranting, if you can locate the script that starts ifconfig go ahead and post that up here so someone can suggest where to add your custom line(s) to.

Cool
 
Old 02-16-2003, 08:44 PM   #7
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
snocked@linux:/etc/init.d> ls
README boot.lvm network rpasswdd
SuSEfirewall2_final boot.md nfs rpmconfigcheck
SuSEfirewall2_init boot.proc nfslock rsyncd
SuSEfirewall2_setup boot.restore_permissions nfsserver setserial
acct boot.scpm nscd single
alsasound boot.swap pcscd skeleton
apmd boot.sysctl portmap smbfs
atd cron postfix smpppd
autofs cups powerfail snmpd
boot fam random splash
boot.clock fbset raw splash_early
boot.crypto gpm rc splash_late
boot.d halt rc0.d sshd
boot.idedma halt.local rc1.d syslog
boot.ipconfig hotplug rc2.d vmware
boot.isapnp hwscan rc3.d xdm
boot.klog inetd rc4.d xfs
boot.ldconfig isdn rc5.d xntpd
boot.local joystick rc6.d ypbind
boot.localfs kbd rcS.d
boot.localnet ksysguardd reboot

Yes, I see what you and others have said about SuSE doing it their own way; but when I asked what distribution was best for people just switching to linux, I was told Mandrake or SuSE.
 
Old 02-17-2003, 12:25 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Ok, can you post up what the contents of 'network' has in it? Un-orthodoxed to add a custom line to another file, but might work in this case.

As for the recommendation for people switching to linux, I still think it's accurate on a large percentage of the time, and maybe even was applicable to you. However, it becomes quickly outgrown and seems to have a very short "half-life". I usually recommend Mandrake because it's not just for n00bs but it works very well for them too. It's a beginner-intermediate distro, where (to me) SuSE is completely n00b directed (doesn't mean a far more advanced user couldn't use it, just means it doesn't cater to them at all). My 2 cents, and all IMO.

What does boot.ipconfig look like as well?

Cool
 
Old 02-17-2003, 12:58 AM   #9
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
linux:/etc/sysconfig/network # ls
. config if-down.d ifcfg-eth0 ifcfg.template routes wireless
.. dhcp if-up.d ifcfg-lo providers scripts



/etc/init.d/boot.ipconfig:

#! /bin/sh
#
# Copyright (c) 2001-2002 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# /etc/init.d/boot.ipconfig
#
### BEGIN INIT INFO
# Provides: boot.ipconfig
# Required-Start:
# X-UnitedLinux-Should-Start: setserial boot.isapnp boot.sysctl
# Required-Stop:
# Default-Start: B
# Default-Stop:
# Description: run ip configuration hooks
### END INIT INFO

. /etc/rc.status
. /etc/sysconfig/sysctl

rc_reset

case "$1" in
start)
#
# Enable "dynamic IP patch"
#
if test -n "$IP_DYNIP" -a "$IP_DYNIP" != no -a \
-e /proc/sys/net/ipv4/ip_dynaddr ; then
echo -n "Enabling dynamic IP patch"
case "$IP_DYNIP" in
yes) echo 7 ; ECHO_RETURN=$rc_done ;;
[1-9]) echo $IP_DYNIP ; ECHO_RETURN=$rc_done ;;
*) ECHO_RETURN=" invalid IP_DYNIP=$IP_DYNIP $rc_skipped" ;;
esac > /proc/sys/net/ipv4/ip_dynaddr || ECHO_RETURN=$rc_failed
echo -e "$ECHO_RETURN"
fi

#
# Enable syn flood protection
#
if test -n "$IP_TCP_SYNCOOKIES" -a "$IP_TCP_SYNCOOKIES" != no -a \
-e /proc/sys/net/ipv4/tcp_syncookies ; then
echo -n "Enabling syn flood protection"
case "$IP_TCP_SYNCOOKIES" in
yes) echo 1 ; ECHO_RETURN=$rc_done ;;
*) ECHO_RETURN=" invalid IP_TCP_SYNCOOKIES=$IP_TCP_SYNCOOKIES $rc_skipped" ;;
esac > /proc/sys/net/ipv4/tcp_syncookies || ECHO_RETURN=$rc_failed
echo -e "$ECHO_RETURN"
fi


#
# Enable IP forwarding ?
#
if test -e /proc/sys/net/ipv4/ip_forward -a -n "$IP_FORWARD" ; then
case $IP_FORWARD in
yes)
echo -n "Enabling IP forwarding"
echo "1" > /proc/sys/net/ipv4/ip_forward
;;
*)
echo -n "Disabling IP forwarding"
echo "0" > /proc/sys/net/ipv4/ip_forward
;;
esac
rc_status -v -r
fi
;;
stop)
rc_failed 3
rc_status -v
;;
status)
rc_failed 4
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 1
;;
esac

rc_exit
 
Old 02-17-2003, 01:48 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Damn another subdirectory... In that subdirectory can you show us what 'scripts' looks like?

And just to let you know, I feel like I am in over my head at this point, but I am going to stick with this thread and help you to get the info out that seems to be "essential" here. I'll PM/email some networking guru's that may be able to assist more at this point

Cool
 
Old 02-17-2003, 01:57 AM   #11
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
snocked@linux:/etc/sysconfig/network/scripts> ls
functions ifdown-route ifstatus-route ifup-route
ifdown-802.1q ifstatus-802.1q ifstatus-wireless ifup-skel
ifdown-connection ifstatus-connection ifup-802.1q ifup-wireless
ifdown-dsl ifstatus-dsl ifup-dsl oldnet2new.sh
ifdown-ippp ifstatus-ippp ifup-ippp
ifdown-isdn ifstatus-isdn ifup-isdn
ifdown-ppp ifstatus-ppp ifup-ppp


Okay! I appreciate it very much.
 
Old 02-17-2003, 03:46 PM   #12
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Ok, I've recieved a suggestion...

Try the full path in your boot.local file for ifconfig (probably /sbin):
/sbin/ifconfig eth0 trailors

Wouldn't that be nice if it's gonna work with just that

BTW, what is that for? What is "trailors"?

Cool
 
Old 02-17-2003, 05:29 PM   #13
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30

trailers: Requests the use of a trailer link-level encapsulation when sending messages. If a network interface supports trailers, the system will, when possible, encapsulate outgoing messages in a manner that minimizes the number of memory-memory copy operations performed by the receiver. On networks that support the Address Resolution Protocol (see arp), this flag indicates that the system should request that other systems use trailers when sending to this host. Similarly, trailer encapsulations will be sent to other hosts that have made such requests. Currently used by Internet protocols only.

Last edited by snocked; 02-17-2003 at 05:34 PM.
 
Old 02-17-2003, 05:33 PM   #14
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Wow, sweet, thanks for that Did the full path suggestion work?

Cool
 
Old 02-17-2003, 05:34 PM   #15
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
Nope; didn't work. This time my eth0 (DHCP) failed at boot, which always does unless I poweroff and power back on the system, but eth0 works fine other than not coming up at boot sometimes. Well thanks for the help.

Last edited by snocked; 02-17-2003 at 05:36 PM.
 
  


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
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 08:58 AM
Adding route and making ifconfig permanent gani *BSD 9 09-21-2004 03:01 AM
IFConfig command dvong3 Linux - Networking 5 01-07-2004 08:44 AM
ifconfig command shoot2kill Linux - Networking 10 10-22-2003 01:50 PM
adding ppp0 to ifconfig rains Linux - Networking 4 09-28-2003 10:00 AM


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