Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

start a process

 
SOLVED
Go to solution
adarsh_4
Frequent Advisor

start a process

i have a alpha box with vms 7.3 loaded on it. i have also setup oracle rdbjdbc on it, everything works fine except after submitting this command "spawn/nowait/proc=rdbthinsrv java -jar RDB$JDBC_HOME:rdbthinsrv.jar" and i log out the process stop.

i need the process rdbthinsrv to be running even though i log out. please advice.
4 REPLIES 4
John Gillings
Honored Contributor
Solution

Re: start a process

adarsh,

As you've discovered, subprocesses stop when the parent process stops.

You have a number of choices for a process that is not dependent on an interactive process. Start by placing your command in a procedure. Perhaps,

RDBTHINSRV.COM
$ SET PROCESS/NAME=RDBTHINSRV
$ java -jar RDB$JDBC_HOME:rdbthinsrv.jar

One simple option is to use a batch job:

$ SUBMIT RDBTHINSRV

Another option is a detached process:

$ RUN SYS$SYSTEM:LOGINOUT /AUTHORIZE /INPUT=RDBTHINSRV.COM /OUTPUT=RDBTHINSRV.OUT /ERROR=RDBTHINSRV.ERR

Once you have one or other working, you can worry about what username the process needs to run under, privileges, log file locations and rollover, how you start this process when the system boots, how you recover from failure, monitoring, access controls, etc...
A crucible of informative mistakes
Hein van den Heuvel
Honored Contributor

Re: start a process

Hmmm.

Just check the FAQ on the Oracle site?

Google: +site:oracle.com rdbthinsrv -->

http://www.oracle.com/technology/products/rdb/htdocs/rdb_jdbc/rdbjdbc_faq.html

"This can be done by running the following:
$java -jar rdbthinsrv.jar
Issuing this command in a terminal window is not appropriate for a production environment because a prompt will not be returned. It will tie up the terminal window until the server is stopped.

A better way to start the Rdb JDBC Thin Server process would be as a spawned subprocess, for example:
$spawn/nowait/proc=Rdb_Thin java -jar rdbthinsrv.jar
The best solution is to start the Rdb JDBC Thin Server process as a detached process.

Example:

Create a command procedure:
$ create thin_server.com
$ @sys$library:rdb$setver 7.1
$ @sys$startup:JAVA$122_SETUP.COM
$ define my_classes disk:[classes_directory]
$ define JAVA$CLASSPATH [],my_classes:rdbnative.jar,my_classes:rdbthin.jar
$ java -jar my_classes:rdbthinsrv.jar
Then submit the command file as follows:
$ run/detached/input=thin_server.com/error=thin_server_error.log -
/output=thin_server.log/process_name=rdb_thin -
sys$system:loginout.exe
The ability to start the Rdb JDBC Thin Server process as a TCP/IP service is under investigation."
Rick Retterer
Respected Contributor

Re: start a process

OpenVMS 7.3.2 - How to Start a Java Application as a DETACHED Process on OpenVMS

Description: The purpose of this document is to demonstrate one method for starting Java applications as a DETACHED process on OpenVMS systems.

Document #: N/A

Minimum skill level: 1

Summary of instructions
OpenVMS Versions: 7.3-2, and later

Java Versions: 1.3.1, 1.4.1, 1.4.2 and later.

This How To document is intended to provide you with step-by-step instructions as well as a DCL Template that you can modify for use on your own system, in order to setup and execute a Java application as a DETACHED process on OpenVMS systems.

1) Create or copy the following DCL command procedure into your current working directory, or any directory that you will be setting up for your Java application.

$!****************************************************************************
$!* Copyright 2005 Hewlett-Packard Co. All Rights Reserved *
$!* *
$!* We cannot guarantee the effectiveness of this program because of the *
$!* possibility of error in transmitting or implementing it. It is meant to *
$!* be used as a template for writing your own program, and it may require *
$!* modification for use on your system. *
$!****************************************************************************
$!* This is an Example DCL program to demonstrate how to setup the Java *
$!* environment run your Java application as a "DETACHED" process. *
$!* *
$!* Java-Detach.com *
$!* HP Services, Java Support *
$!* Atlanta, GA. *
$!* *
$!* This is the INPUT file required to run Java as a "DETACHED" process. *
$!* *
$!* The command to run this program detached would then be something like: *
$!* *
$!* run/detach/authorize sys$system:loginout.exe - *
$!* /input=sys$sysdevice:[retterer.java]java-detach.com - *
$!* /output=sys$sysdevice:[retterer.java]java$output.log *
$!* *
$!* You would replace "sys$sysdevice:[retterer.java]" with your own *
$!* application specific directory paths. *
$!****************************************************************************
$!
$ set NoOn
$!
$ write sys$output "Detached Java process starting..."
$!
$!*** Setup the Java Environment that you have currently installed.
$!*** This example will use the FASTVM.
$!*** You MUST modify this section ********
$!
$ @sys$common:[java$142.com]java$142_setup.com fast
$!
$!
$!*** Define the Java$classpath logical for this process.
$!*** You MUST modify this section *********
$!
$ define java$classpath sys$sysdevice:[sys0.syscommon.java$142.lib]tools.jar, -
sys$sysdevice:[sys0.syscommon.java$142.lib]dt.jar, -
mydisk:[myuser.java], []
$!
$!*** This next command is not required unless you want to verify your
$!*** java$classpath.
$!
$ show log java$classpath
$!
$!*** This is the command-line needed to start the Java VM, and the Java app.
$!*** All arguments, and the program name must be be "QUOTED" as shown below.
$!*** You MUST modify this section *********
$!
$ java "-verbose:gc" "Test1"
$!
$!*** This next line is not required but we are signalling the end of the program
$!*** in the log file for demonstration purposes. ***
$!
$ write sys$output "Detached Java process exiting..."
$!
$ write sys$output "Done!"
$!
$!*** Exiting the procedure. ***
$ exit
$!*************** End of File **************


2) Modify the command procedure to function within your specific OpenVMS environment. (i.e., change the directories, filenames, Java program name and any arguments required to run your Java application, etc...)

3) Once you have your command procedure modified to your satisfaction, you can now test the program.

4) To run the program as a detached process, execute this command:

$ run/detach/authorize/process_name="myapp" sys$system:loginout.exe -
_$ /input=mydisk:[myuser.java]java-detach.com -
_$ /output=mydisk:[myuser.java]java$output.log


%RUN-S-PROC_ID, identification of created process is 00000603


5) Then, to ensure that the process got started successfully...

$ show system


OpenVMS V7.3-2 on node VISUAL 20-JAN-2005 16:58:30.23 Uptime 364 23:34:17
Pid Process Name State Pri I/O CPU Page flts Pages
00000201 SWAPPER HIB 16 0 0 00:00:03.26 0 0
00000602 RETTERER_7 HIB 1 354 0 00:00:00.12 399 385 S
00000603 MYAPP HIB 4 795 0 00:00:00.92 8713 856 M <<--- HERE it is !
00000204 LANACP HIB 13 64 0 00:00:00.00 96 118
00000206 IPCACP HIB 10 9 0 00:00:00.00 32 42
00000207 ERRFMT HIB 8 2756 0 00:00:00.74 98 115
00000209 OPCOM HIB 8 154 0 00:00:00.02 93 44
0000020A AUDIT_SERVER HIB 10 69 0 00:00:00.02 120 148
0000020B JOB_CONTROL HIB 10 2158 0 00:00:00.15 54 77
0000020D QUEUE_MANAGER HIB 10 79 0 00:00:00.01 117 152
0000020E SECURITY_SERVER HIB 10 62 0 00:00:00.04 956 261
0000020F ACME_SERVER HIB 9 104 0 00:00:00.07 493 413 M
00000210 TP_SERVER HIB 10 5667 0 00:00:00.10 71 92


6) The JAVA$OUTPUT.LOG file, typically will appear to be empty until the program has completed and the process has been terminated. You will be able to look at the logfile information when the process has run-down and exited.

$ type JAVA$OUTPUT.LOG


$ Set NoOn
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
Login process type is: OTHER
Detached Java process starting...


"JAVA$CLASSPATH" = "SYS$SYSDEVICE:[SYS0.SYSCOMMON.JAVA$142.LIB]TOOLS.JAR"
(LNM$PROCESS_TABLE)
= "SYS$SYSDEVICE:[SYS0.SYSCOMMON.JAVA$142.LIB]DT.JAR"
= "SYS$SYSDEVICE:[RETTERER.JAVA]"
= "[]"


Thu Jan 20 16:59:31 EST 2005
Thu Jan 20 16:59:40 EST 2005
Thu Jan 20 16:59:51 EST 2005
Thu Jan 20 17:00:01 EST 2005
Thu Jan 20 17:00:11 EST 2005
Thu Jan 20 17:00:21 EST 2005



Detached Java process exiting...
Done!



--------------------------------------------------------------------------------
- Rick Retterer



adarsh_4
Frequent Advisor

Re: start a process

thank you, i have managed to get it running.

thanks once again