Operating System - HP-UX
1819884 Members
2690 Online
109607 Solutions
New Discussion юеВ

Starting process in background

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Starting process in background

Hey Guys,

I am starting the weblogic server process on hpux 11i but whenever i close my terminal the weblogic admin and server process stops.
I tried to start them in background mode but was not able to enter password to start.

Can anyone suggest workaround ?

Thanks,
Shiv

4 REPLIES 4
Senthil Kumar .A_1
Honored Contributor

Re: Starting process in background

Hi Shiv,

Not too sure whether this will healp ,as i do not know how weblogic starts.. but, never the less try this..so assuming command "weblogadmin" is the command to start welogic, username : web, password : pass123

in your prompt..

nohup /opt/weblogic/bin/weblogadmin <web
pass123
EOF

regards..
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Victor Fridyev
Honored Contributor

Re: Starting process in background

Hi,

You have to use "prefix" nohup before the command, which you want to run in background.
You canwrite a script:
command1
command2 << EOF
INPUT
EOF

and run the script as
nohup script &

HTH
Entities are not to be multiplied beyond necessity - RTFM
Ganesha Sridhara
Honored Contributor

Re: Starting process in background

Hello Shiv,

The weblogic server can be started as:
nohup sh ./startWebLogic.sh > wlsa.log &

You can see the status by executing command tail -f wlsa.log

The UserName and password can be stored in file boot.properties of your domain folder e.g. /app/bea/user_projects/domains/mydomain/

------ Steps to create boot.properties file--
Change to the /app/bea/user_projects/domains/mydomain directory
by typing:
cd /app/bea/user_projects/domains/mydomain

Using a text editor (such as vi), edit the boot.properties file by typing:
vi boot.properties [Enter]

Enter the following text; then save and exit the file:
username=system
password=weblogic

------------------

For more detail:
http://e-docs.bea.com/wls/docs81/ConsoleHelp/startstop.html

Regards
Ganesha Sridhara

Ralph Grothe
Honored Contributor
Solution

Re: Starting process in background

Hi Shiv,

starting the weblogic server is indeed quite involved, as is any application written in Java as it seems to me.
Many people frown upon Perl as being too baroque, but boy compare this to the line clutter for the invocation of the java interpreter alone needed to start this beast.

For instance the java interpreter starting command from the wrapper script of one of our Weblogic servers consists of almost 500 characters, with whitespace stripped off of course.

$ grep java startepbndomain.sh|tr -d \\040|wc -c
487

I won't disclose the content of this script here as it contains the password that is required to initiate the startup method,
and because there are too many rather distracting arguments for the Java interpreter probably very special to our weblogic server.
That said however, in that line is the passing of the required password to the method weblogic.management.password to the interpreter by a -D switch.

-Dweblogic.management.password=

I'm not into Java, and in particular Weblogic beans, but I consider this method to be from a basic custom class of the weblogic framework that most weblogic implementations will make use of.

Because of this you should make your wrapper script readable only to the user under whose ID the weblogic server runs.

Because I also had the need to get all weblogic instances started on this box (there are several), as well as stopped, at system startup/shutdown I wrote a little init/rc script that invokes the "hidden" real server startup scripts (the ones with the mentioned line clutter above).

As already the others have replied,
it simply su-es into the account the weblogic server is run under and puts the call under nohup (see man nohup) together with a trailing ampersand.
This will run the job in the background and detach it from the invoking shell.

I simply modified the /sbin/init.d/template
script, and attached the result (with CRs to please Winows Webbrowsers).
As you may notice the template provides a few custom functions (like kill_proc()) which I didn't make use of.
Thus these functions should rather have been removed.
Just have a look at the start) and stop) bodies of the case/switch construct.
For shutdown I also make use of a weblogic shutdown shell script that connects to the running server(s) (so again password is required) and brings them down by invoking a supplied shutdown method.

However this isn't really necessary as I found out.
Is it quite safe for a root process to send the master java thread a SIGTERM to bring down the weblogic server smoothly.
However, logging (n.b. Weblogic is making haevy use of log4j with almost excessive logging) may be a bit more restricted if one stops the server this way.
That's why I use this second method as sort of failback if something's wrong with the shutdown script.
(Apart from this, it's good to know to have this cludge as a sysadmin with little knowledge of Weblogic innards).
Madness, thy name is system administration