LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 09-11-2006, 07:11 PM   #1
shambler
Member
 
Registered: Sep 2006
Location: Canada
Distribution: openSUSE 11.3, Xubuntu 10.10, Ubuntu 11.04
Posts: 53

Rep: Reputation: 23
Run program a startup automatically


All I want is to have SuSE execute 1 line at root level after it has booted:

/sbin/ifconfig eth0:1 192.168.1.245

(I need multiple ip addresses, and that would be the 2nd one).


Apparently, there is no rc.local in Suse, so I can't use that.

If I had a week to learn how to do it, I too could write one of those 150 line startup scripts in /etc/init.d/ But I don't have the time or the knowledge.

Can't use etc/init.d/boot.local because I need everything else running first (especially networking). A comment in boot.local says it runs before run level one is started.

Is there no file you can just drop a line into and have it run on startup, say around run level 5? How hard does this have to be?
 
Old 09-11-2006, 10:25 PM   #2
igorc
Member
 
Registered: May 2005
Location: Sydney, Australia
Distribution: Ubuntu 5.04, Debian 3.1
Posts: 74

Rep: Reputation: 15
I'm not suse user and I don't know exactly where the network configuration files are. But for quick help you can write a short script like this:

#/usr/bin/bash

/sbin/ifconfig eth0:1 192.168.1.245

and place it in /etc/init.d (as eth0conf.sh e.g).

# chmod +x eth0conf.sh - to make it executable

Then you can create a symlink from runlevel 5 to point to that script and you can create it with some high start number like this:

# cd /etc/init.d/rc5.d
# ln -s ../eth0conf.sh S99eth0conf

and restart. I hope you will find your interface already configured after rebooting. For better solution you have to wait for a reply from some suse users I'm afraid . I'm sure you can put the interface configuration line in the network file, you should just find where it is . I think it is /etc/sysconfig/network/ifconfig-eth0 and there should be something like:

eth0 inet static
ADDRESS 192.168.1.245
NETMASK 255.255.255.0
GATEWAY ...
ONBOOT yes or no
.
..

Maybe writing additional section for eth0:1 in this file???? )

Cheers,
 
Old 09-13-2006, 10:50 AM   #3
shambler
Member
 
Registered: Sep 2006
Location: Canada
Distribution: openSUSE 11.3, Xubuntu 10.10, Ubuntu 11.04
Posts: 53

Original Poster
Rep: Reputation: 23
Thanks igorc.

The init.d script thing did not work.

Your suggestion to look in the network config file was close enough that I was able to sort it out and have it working after a bit more googling. It turns out the YaST tool has a way to add addresses (Network Devices -> Network Card for anyone else who stumbles across this).
 
  


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
Automatically run scripts on startup? Phaethar Fedora 10 09-24-2004 02:35 AM
How can I run a command automatically at startup? luwigie Linux - General 8 08-26-2004 09:05 PM
automatically startup a program after booting? caicai Linux - Software 7 08-12-2004 07:16 AM
How do I get Fedora to automatically run a command during startup? jlsain Linux - Software 2 03-23-2004 04:03 AM
How can the linux OS run script automatically at startup? tommylkc Linux - Newbie 1 06-26-2002 03:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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