- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: submitting a job to a batch queue from a detac...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2005 03:06 PM
тАО03-16-2005 03:06 PM
submitting a job to a batch queue from a detached process
for example using lib$spawn & sys$creprc from a 'c' prog - to no avail
Is this possible & if so any help pointing me in the correct direction would be appreciated.
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2005 04:11 PM
тАО03-16-2005 04:11 PM
Re: submitting a job to a batch queue from a detached process
Submitting a job to a batch queue, as requested per your subject line, is done by sending a message to the jobcontroller through a call to SYS$SNDJBC. Documented in http://h71000.www7.hp.com/doc/82FINAL/4527/4527pro_109.html#jun_547
lib$spawn creates a sub-process, and sys$creprc can be used the create a detach process.
Hints:
- check out the sys$input ands sys$output expectation
- check out the 'login.com' context expect, which is not there for a detached jobn unless you run loginout.exe first.
What is the error message you get? You are checking/reporting the status right?
Maybe SHOW ACCOU/FULL/SINCE=... can tell you why jobs failed?
Hope this helps some,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2005 04:14 PM
тАО03-16-2005 04:14 PM
Re: submitting a job to a batch queue from a detached process
Can you provide some sample code and details
of what status values are returned from the
calls to lib$spawn and sys$creprc?
We use this method a lot here and have no problems.
Regards
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2005 09:28 PM
тАО03-16-2005 09:28 PM
Re: submitting a job to a batch queue from a detached process
Let's go back a step. What exactly are you trying to accomplish? The important question is not "How I fix X (technique)?" but "What is the best way to implement X (function)?".
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2005 01:35 PM
тАО03-21-2005 01:35 PM
Re: submitting a job to a batch queue from a detached process
Originally I was trying to kill and existing process and restart it if certain conditions were met.
I tried to stop & restart via the lib$spawn - passing 'stop myprocess' & 'run /detached /process_name=myprocess dka100:[common.mydir]myprocess' thru the descriptor.
Then I tried to the same thru sys$creprc.
My next attempt was to start a batch file that would stop / restart the process. (Thought that would work by using the loginout.exe, after reviewing docs that indicated the detached process needed a CLI).
So... What I'm really trying to do is start / stop a detached process from a detached process.
Hope this make more sense.. Thanks again from a newbie....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2005 01:51 PM
тАО03-21-2005 01:51 PM
Re: submitting a job to a batch queue from a detached process
Some sample code would make it easier, along with details of status
values returned.
Here is some (BASIC) code used here:
(formatting will be awful)
stsflg = prc$m_detach
sstatus = sys$creprc (creprc_pid by ref,
loginout by desc, control_file by desc, file_sys$output by desc, file_sys$error by desc,,, process_name by desc, priority by value,,, stsflg by value)
With appropriate values for each of the variables.
For killing processes, we use sys$delprc.
Since you are using C, do you have the string descriptor
stuff handled correctly?
Regards
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2005 03:35 PM
тАО03-21-2005 03:35 PM
Re: submitting a job to a batch queue from a detached process
Actually, before we $DELPRC we like to see a $FORCEX, to give teh process a change for image rundown.
Check the system service ref manual, or inititally just '$HELP SYSTEM $FORCE'
Do you have control over the detached procecss code? Why not build in a clean, async exit? Maybe a (common) event flag, or lock poll in a central loop. Maybe an async entry point through a mailbox-attention-ast, or a lock blocking ast, or whateevr inter process communication technique you are used to.
Also... what problem are you really trying to solve?
Why do you know the process needs to be stopped and restarted? Can the process itself determine that somethign needs to be done? Like if it had a know, 'unavoidable' memory leak, could check check?
Or if you need a fresh log file, why not have it close the current and re-open the next withough stop/start?
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2005 05:53 PM
тАО03-21-2005 05:53 PM
Re: submitting a job to a batch queue from a detached process
Let me try to get this exact:
tried to stop & restart via the lib$spawn - passing 'stop myprocess' & 'run /detached /process_name=myprocess dka100:[common.mydir]myprocess' thru the descriptor.
Then I tried to the same thru sys$creprc.
At least for the first try (spawn) I understand what happened:
- you spawn a supprocess.
- the supprocess kills the main process.
---- as as result thereoff, all subprocesses of the main process are killed, including the just-spawned.
- the supprocess never reaches the point where it can run another process, because it is killed before it can execute that command.
Trying "the same" thru sys$creprc...
How exactly is that "the same"? Are you again killing yourself (directly or indirectly) before intending to create a new process?
I think the wise thing to do is Hein's advice:
"What are you trying to achieve? And why?"
If you post that here, let's see what the crowd comes up with.
I tend to go with Hein that that might well lead to totally other ways to go that have much better chances of succeeding.
Proost.
Have one on me.
Jan