boot
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > boot




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    boot  
sandhu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-22-06 06:39 AM

i want to run a script that is the first script to be run after
rebooting
where should i add that script.......

like this
a welcome message should be printed after login
i know script ..
but how to make it default........
please help me out,,.........






[ Post a follow-up to this message ]



    Re: boot  
Maxim Yegorushkin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-22-06 12:27 PM


sandhu wrote:

> i want to run a script that is the first script to be run after
> rebooting
> where should i add that script.......
>
> like this
> a welcome message should be printed after login
> i know script ..
> but how to make it default........
> please help me out,,.........

It may depend on the operating system you are using and shell.

For linux you can invoke your script from /etc/rc.local, it is executed
before login prompt.

For bash shell you can use /etc/profile or ~/.bash_profile, they are
executed after logging in. Please see man for bash or other shell you
happen to use.






[ Post a follow-up to this message ]



    Re: boot  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-22-06 12:27 PM

"sandhu" <sandesh.aks@gmail.com> writes:

> i want to run a script that is the first script to be run after
> rebooting
> where should i add that script.......

In sysv-like unix, you can put an entry in /etc/inittab to have init
launch it first thing (before the scripts in /etc/init.d/).
Or you could call your script from /etc/init.d/boot first thing.

In bsd-like unix, call your script from /etc/rc.

In both case, you don't have much to do anything with: no file system
to write to, no service, in some distribution, no device. Only a root
file system mounted read-only.

So I don't know what you may want to do at such an early time...


> like this
> a welcome message should be printed after login

This is something totally different.

When you log in with a shell, most shell program will read a startup
script and execute it before giving a prompt.

Depending on your shell,

echo $SHELL
man bash
man ksh
man sh
...

you can write commands in ~/.bashrc ~/.profile ~/.kshrc ~/.bash_login
~/.login etc...  The exact file(s) are indicated in your shell manual
page.



> i know script ..
> but how to make it default........
> please help me out,,.........

You need to learn more about unix.  Read unix tutorials and unix books...

Also, it will be instructive, knowing that init is the first process
forked by the kernel, to read the its manual page, and from here, to
track down the boot process.  (eg, in sysv, read /etc/inittab, and
check each program or script (reading the man page of the commands,
etc), until you reach the login.



--
__Pascal Bourguignon__                     http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush





[ Post a follow-up to this message ]



    Re: boot  
loic-dev@gmx.net


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-22-06 12:27 PM

Hello,

> like this
> a welcome message should be printed after login

If you just want a message, you could use /etc/motd (message of the
day) or /etc/issue (legal issue regarding usage of the server) and put
your message(s) there.

Cheers,
Loic.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:06 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register