File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Initscript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Initscript" Watch "Initscript" New topic
Author

Initscript

John Ahmadi
Greenhorn

Joined: Oct 24, 2005
Posts: 5
Hi,

We've Weblogic in our Linux server.I can start Admin server manually by using an script "startWebLogic.sh". But now I have been asked to start admin server while system boots. So I need to write an script for that and put it in /etc/init.d/rc3.d.
I have no idea whatsoever how should I do it.

Any help?

Thanks,
Shahrokh
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

a) copy your script to /etc/init.d/
b) create a symbolic link like this:


The S means it is a start-script.
The number (95) is responsible to define the execution-order.
Smaller numbers indicate: execute first.

You should be sure that services, startWebLogic depends on, are executed first (like mounted filesystems, established network-connections).
System-variables like 'JAVA_HOME' used in the script might not be defined. Then replace them with absolut values.


http://home.arcor.de/hirnstrom/bewerbung
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

I don't think I'd recommend simply aliasing to WebLogic's startup script as an initscript. Technically, that's all right, but I don't think WebLogic.sh is written to function well in that role.

An industrial-grade initscript has certain properties. It usually has a case statement at its heart where the start, stop, restart, and status (more or less) command functions are defined. It may look outside itself for environmental info (/etc/sysconfig for redhat, /etc/default for Debian and Solaris), so that site-local config options don't touch executable code (and so that multiple instances of the server are possible). Also, there are certain "magic comments" that programs such as RedHat's chkconfig utility can use to construct the S/K runlevel aliases.

I recommend looking at some of the existing /etc/init.d scripts for ideas and creating a script that invokes the weblogic startup script in a similar way. Although first, I'd check around for some existing WebLogic initscript implementations. WebLogic's been running on Linux and Solaris for years, so there's almost certainly something out there.


Customer surveys are for companies who didn't pay proper attention to begin with.
John Ahmadi
Greenhorn

Joined: Oct 24, 2005
Posts: 5
Hi,

Thank all of you. Although I try to find some existing weblogic script in many places, But I failed, I've beeter idea and that is, I send you here the startup weblogic script. please have a look and if you guys have some idea that how can i change the script let me know. Here is a code:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Initscript