Operating System - Linux
1753775 Members
7279 Online
108799 Solutions
New Discussion юеВ

How can i add a application startup script while booting

 
SOLVED
Go to solution
Mohammed Haris Khan
Occasional Advisor

How can i add a application startup script while booting

Hi,

I have a weblogic application startup script with me, The senario is everytime the server maintenance activity rebooting i need to start the script and wait for the application to get started.

These isint should happen, I need to add the script while booting

Please suggest me how can i do this


Eg :

Path :
#cd /weblogic/user-projects/domain/KYEDomain

#nohup ./startWebLogic.sh


Needs to be added in /etc/inittab

How can i do this ,Your ans is appriciated

Haris
8 REPLIES 8
Ivan Ferreira
Honored Contributor
Solution

Re: How can i add a application startup script while booting

Probably, the easiest option is to add the script to the rc.local file.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
avizen9
Esteemed Contributor

Re: How can i add a application startup script while booting

Hello Haris,
yes you can put this scrip in rc.local which will execute after all other system init scripts.

if you are not really sure go through below sample script you can modify acordingly, thanks,

http://www.comptechdoc.org/os/linux/startupman/linux_surclocal.html
Nuwan Alwis
Valued Contributor

Re: How can i add a application startup script while booting

Hi Khan,
You got the right answer from all above. "/etc/rc.local" is the final place that kernel look for any startup scripts during the boot process.
you can put your commands on this file

writing all the commands you want to execute at the boot time as a shell script and put that shell script path on rc.local file is what i do and recommend.

Good Luck..!
Mohammed Haris Khan
Occasional Advisor

Re: How can i add a application startup script while booting

Hi,

But i have only these files with me. do i need to create the file as "/etc/rc.d/rc.local" and "/etc/rc.d/rc3.d/S99.local"

lrwxrwxrwx 1 root root 6 Feb 11 2008 rc.d -> init.d
-rw-r--r-- 1 root root 611 May 21 2002 rc.d.README
-rw-r--r-- 1 root root 8548 Aug 18 2003 rc.status

As im new to SUSE linux please help me out.

Thanks
Harish
Nuwan Alwis
Valued Contributor

Re: How can i add a application startup script while booting

Hi Khan,
rc.local file is already there and all you need to add your commands to that file or add the paths to shell scripts on that files.

by the way please show some appreciation for all that gave you answers with points.

Good Luck..!
Suraj K Sankari
Honored Contributor

Re: How can i add a application startup script while booting

Hi,
The easiest way to add startup things open /etc/rc.d/rc.local and add what you want to this is the startup file for user.

[root@rspc521 rc.d]# ll rc.local
-rwxr-xr-x 1 root root 220 Jun 24 2003 rc.local

Suraj
Fredrik.eriksson
Valued Contributor

Re: How can i add a application startup script while booting

As the others said, the easiest way is to add it to rc.local.

But! if you need it to execute on a specific position in the startup sequence then you need probably need to study the method used to start and shutdown services for that particular distribution.

If you just need it to start without any other dependencies or anything then rc.local version is just fine and probably the most simple one.

Best regards
Fredrik Eriksson
Sajjad Sahir
Honored Contributor

Re: How can i add a application startup script while booting

Dear Mohammed

Normaly doing by making an entry in
/etc/rc.d/rc.local file this easiest and most simple way.


thanks and regards

Sajjad Sahir