<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: submitting a job to a batch queue from a detached process in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506505#M31964</link>
    <description>Larry,&lt;BR /&gt;&lt;BR /&gt;Let me try to get this exact:&lt;BR /&gt;&lt;BR /&gt;&lt;QUOTE&gt;&lt;BR /&gt; tried to stop &amp;amp; restart via the lib$spawn - passing 'stop myprocess' &amp;amp; 'run /detached /process_name=myprocess dka100:[common.mydir]myprocess' thru the descriptor.&lt;BR /&gt;&lt;BR /&gt;Then I tried to the same thru sys$creprc.&lt;BR /&gt;&lt;/QUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;At least for the first try (spawn) I understand what happened:&lt;BR /&gt;- you spawn a supprocess.&lt;BR /&gt;- the supprocess kills the main process.&lt;BR /&gt;---- as as result thereoff, all subprocesses of the main process are killed, including the just-spawned.&lt;BR /&gt;- the supprocess never reaches the point where it can run another process, because it is killed before it can execute that command.&lt;BR /&gt;&lt;BR /&gt;Trying "the same" thru sys$creprc...&lt;BR /&gt;How exactly is that "the same"? Are you again killing yourself (directly or indirectly) before intending to create a new process?&lt;BR /&gt;&lt;BR /&gt;I think the wise thing to do is Hein's advice:&lt;BR /&gt;"What are you trying to achieve? And why?"&lt;BR /&gt;If you post that here, let's see what the crowd comes up with.&lt;BR /&gt;&lt;BR /&gt;I tend to go with Hein that that might well lead to totally other ways to go that have much better chances of succeeding.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;Jan&lt;BR /&gt;</description>
    <pubDate>Tue, 22 Mar 2005 01:53:16 GMT</pubDate>
    <dc:creator>Jan van den Ende</dc:creator>
    <dc:date>2005-03-22T01:53:16Z</dc:date>
    <item>
      <title>submitting a job to a batch queue from a detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506498#M31957</link>
      <description>I've tried different variations of trying to start/stop processes from a batch file via the loginout.exe&lt;BR /&gt;&lt;BR /&gt;for example  using lib$spawn &amp;amp; sys$creprc from a 'c' prog - to no avail&lt;BR /&gt;&lt;BR /&gt;Is this possible &amp;amp; if so any help pointing me in the correct direction would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Mar 2005 23:06:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506498#M31957</guid>
      <dc:creator>Larry_139</dc:creator>
      <dc:date>2005-03-16T23:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: submitting a job to a batch queue from a detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506499#M31958</link>
      <description>I'm sorry, but I am really confused about your subject content vs message content, maybe others also?&lt;BR /&gt;&lt;BR /&gt;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 &lt;A href="http://h71000.www7.hp.com/doc/82FINAL/4527/4527pro_109.html#jun_547" target="_blank"&gt;http://h71000.www7.hp.com/doc/82FINAL/4527/4527pro_109.html#jun_547&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;lib$spawn creates a sub-process, and sys$creprc can be used the create a detach process. &lt;BR /&gt;Hints:&lt;BR /&gt;- check out the sys$input ands sys$output expectation&lt;BR /&gt;- check out the 'login.com' context expect, which is not there for a detached jobn unless you run loginout.exe first.&lt;BR /&gt;&lt;BR /&gt;What is the error message you get? You are checking/reporting the status right?&lt;BR /&gt;&lt;BR /&gt;Maybe SHOW ACCOU/FULL/SINCE=... can tell you why jobs failed?&lt;BR /&gt;&lt;BR /&gt;Hope this helps some,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 00:11:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506499#M31958</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-03-17T00:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: submitting a job to a batch queue from a detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506500#M31959</link>
      <description>Larry,&lt;BR /&gt;&lt;BR /&gt;Can you provide some sample code and details&lt;BR /&gt;of what status values are returned from the&lt;BR /&gt;calls to lib$spawn and sys$creprc?&lt;BR /&gt;We use this method a lot here and have no problems.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Dave&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 00:14:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506500#M31959</guid>
      <dc:creator>David B Sneddon</dc:creator>
      <dc:date>2005-03-17T00:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: submitting a job to a batch queue from a detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506501#M31960</link>
      <description>Larry,&lt;BR /&gt;&lt;BR /&gt;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)?".&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Thu, 17 Mar 2005 05:28:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506501#M31960</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2005-03-17T05:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: submitting a job to a batch queue from a detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506502#M31961</link>
      <description>Sorry that my email is not as clear as it needs to be - I'm relatively a greenie at a bunch of this.&lt;BR /&gt;&lt;BR /&gt;Originally I was trying to kill and existing process and restart it if certain conditions were met.&lt;BR /&gt;&lt;BR /&gt;I tried to stop &amp;amp; restart via the lib$spawn - passing 'stop myprocess' &amp;amp; 'run /detached /process_name=myprocess dka100:[common.mydir]myprocess' thru the descriptor.&lt;BR /&gt;&lt;BR /&gt;Then I tried to the same thru sys$creprc.&lt;BR /&gt;&lt;BR /&gt;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).&lt;BR /&gt;&lt;BR /&gt;So...  What I'm really trying to do is start / stop a detached process from a detached process.&lt;BR /&gt;&lt;BR /&gt;Hope this make more sense..   Thanks again from a newbie....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Mar 2005 21:35:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506502#M31961</guid>
      <dc:creator>Larry_139</dc:creator>
      <dc:date>2005-03-21T21:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: submitting a job to a batch queue from a detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506503#M31962</link>
      <description>Hi Larry,&lt;BR /&gt;&lt;BR /&gt;Some sample code would make it easier, along with details of status&lt;BR /&gt;values returned.&lt;BR /&gt;&lt;BR /&gt;Here is some (BASIC) code used here:&lt;BR /&gt;(formatting will be awful)&lt;BR /&gt;&lt;BR /&gt;stsflg = prc$m_detach&lt;BR /&gt;sstatus = sys$creprc (creprc_pid by ref,                                             &lt;BR /&gt;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)&lt;BR /&gt;&lt;BR /&gt;With appropriate values for each of the variables.&lt;BR /&gt;&lt;BR /&gt;For killing processes, we use sys$delprc.&lt;BR /&gt;&lt;BR /&gt;Since you are using C, do you have the string descriptor&lt;BR /&gt;stuff handled correctly?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Dave&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Mar 2005 21:51:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506503#M31962</guid>
      <dc:creator>David B Sneddon</dc:creator>
      <dc:date>2005-03-21T21:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: submitting a job to a batch queue from a detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506504#M31963</link>
      <description>&lt;BR /&gt;Actually, before we $DELPRC we like to see a $FORCEX, to give teh process a change for image rundown.&lt;BR /&gt;Check the system service ref manual, or inititally just '$HELP SYSTEM $FORCE'&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also... what problem are you really trying to solve? &lt;BR /&gt;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?&lt;BR /&gt;Or if you need a fresh log file, why not have it close the current and re-open the next withough stop/start?&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Mar 2005 23:35:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506504#M31963</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-03-21T23:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: submitting a job to a batch queue from a detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506505#M31964</link>
      <description>Larry,&lt;BR /&gt;&lt;BR /&gt;Let me try to get this exact:&lt;BR /&gt;&lt;BR /&gt;&lt;QUOTE&gt;&lt;BR /&gt; tried to stop &amp;amp; restart via the lib$spawn - passing 'stop myprocess' &amp;amp; 'run /detached /process_name=myprocess dka100:[common.mydir]myprocess' thru the descriptor.&lt;BR /&gt;&lt;BR /&gt;Then I tried to the same thru sys$creprc.&lt;BR /&gt;&lt;/QUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;At least for the first try (spawn) I understand what happened:&lt;BR /&gt;- you spawn a supprocess.&lt;BR /&gt;- the supprocess kills the main process.&lt;BR /&gt;---- as as result thereoff, all subprocesses of the main process are killed, including the just-spawned.&lt;BR /&gt;- the supprocess never reaches the point where it can run another process, because it is killed before it can execute that command.&lt;BR /&gt;&lt;BR /&gt;Trying "the same" thru sys$creprc...&lt;BR /&gt;How exactly is that "the same"? Are you again killing yourself (directly or indirectly) before intending to create a new process?&lt;BR /&gt;&lt;BR /&gt;I think the wise thing to do is Hein's advice:&lt;BR /&gt;"What are you trying to achieve? And why?"&lt;BR /&gt;If you post that here, let's see what the crowd comes up with.&lt;BR /&gt;&lt;BR /&gt;I tend to go with Hein that that might well lead to totally other ways to go that have much better chances of succeeding.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;Jan&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Mar 2005 01:53:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submitting-a-job-to-a-batch-queue-from-a-detached-process/m-p/3506505#M31964</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-03-22T01:53:16Z</dc:date>
    </item>
  </channel>
</rss>

