LinuxQuestions.org
Help answer threads with 0 replies.
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 04-24-2002, 03:05 AM   #1
mimi
Member
 
Registered: Apr 2002
Location: Earth globe
Distribution: Red Hat Linux
Posts: 35

Rep: Reputation: 15
Smile startup scripts


Hi all
I wanna have a small script to give the eth0 multiple address at startup like this:

-----------------------------------------------
#/bin/bash
ifconfig eth0 172.16.204.1
ifconfig eth0 172.16.204.2 alias netmask 255.255.255.0 (it will used to demostrate virtual hosts)
ifconfig eth0 172.16.205.1 alias (the different IP network)
----------------------------------------------------
so i put my scripts in a file called lan_startup.

Now where should I call this scripts?
1-in /etc/bashrc (global functions and aliases)
2-in /etc/profile (system environment and startup programs)
3-/etc/rc.d/rc.local (I know this is used to put specific commands that get executed every time
you boot the computer regardless of runlevel)


Another question: is it possible to put custom scripts in /etc/rc.d/init.d/ and creat a symlink from /etc/rc.d
/rc3.d/ to it or this is only used to put scripts in order to start and stop the
services(servers)like httpd?

Thank u very much in advance.
mimi
 
Old 04-24-2002, 04:42 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Probably adding it to rc.local would be the best quick solution. /etc/profile and /etc/bashrc are used for things that apply to users. So since it's for the whole system rc.local would be better.

A neater solution would probably be to have it in /etc/init.d and then create the proper symbolic links for it. The links in there aren't only used to start and stop daemons. If you look closely you'll see almost everything is started and stopped from there. Including starting and stopping the network.
 
Old 04-24-2002, 05:25 AM   #3
mimi
Member
 
Registered: Apr 2002
Location: Earth globe
Distribution: Red Hat Linux
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks a lot Mik. I got it.

mimi
 
Old 04-24-2002, 10:18 AM   #4
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
Difference in privilege levels...

To sidetrack a little from the original question...

pls correct me if I'm wrong, but this is how I understand it. The the rc.*scripts are executed with root privileges, but the /etc/profile scripts are executed with the user's security tokens?
 
Old 04-25-2002, 12:32 PM   #5
mimi
Member
 
Registered: Apr 2002
Location: Earth globe
Distribution: Red Hat Linux
Posts: 35

Original Poster
Rep: Reputation: 15
Dear ugenn
I think if u wanna put something in /etc/profile or /etc/bashrc you need root permission but if u want to put something in ./bashrc and ./bash_profile you don't need to be the root.
but I'm not sure that my idea will be correct.
mimi
 
Old 04-26-2002, 01:26 AM   #6
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
Quote:
Originally posted by mimi
Dear ugenn
I think if u wanna put something in /etc/profile or /etc/bashrc you need root permission but if u want to put something in ./bashrc and ./bash_profile you don't need to be the root.
but I'm not sure that my idea will be correct.
mimi
I'm aware of that. What I want to know is when the stuff inside /etc/profile runs, does it run with root privileges or with the user's security privileges?
 
Old 04-26-2002, 03:09 AM   #7
mimi
Member
 
Registered: Apr 2002
Location: Earth globe
Distribution: Red Hat Linux
Posts: 35

Original Poster
Rep: Reputation: 15
sorry I can't help you in this case.But would you pls. tell me the answer whenever you find it out.
Thanks

mimi
 
  


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
Startup Scripts?? jimbo-62 Debian 5 07-10-2005 10:23 AM
startup scripts... ValidiusMaximus Linux - Software 8 01-11-2005 05:55 PM
Startup Scripts jhartney Linux - Newbie 3 01-07-2005 01:35 AM
startup scripts mimi Linux - General 1 04-24-2002 03:22 AM
X Startup Scripts JHuizingh Linux - General 1 09-18-2001 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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