<?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 way to queue up multiple requests to run a program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901638#M105002</link>
    <description>I'm looking for a way to have a program queue up requests to a 3rd party script.&lt;BR /&gt; &lt;BR /&gt;There's this unidata program that runs a 3rd party application via shell script. If I run it slowly it works great.  But if anyone runs it close to the same time, it drops into an infinite loop (that I have to fix by hand).&lt;BR /&gt;&lt;BR /&gt;I know there's got to be a way to queue the requests I'm just blanking here.  I CAN describe it at least.  &lt;BR /&gt;&lt;BR /&gt;runprog.sh&lt;BR /&gt;   sh   badprogram.sh &amp;amp;&lt;BR /&gt;   sh   badprogram.sh &amp;amp;&lt;BR /&gt;&lt;BR /&gt;If I run "runprog.sh", I'm sending 2 jobs to the badprogram.sh.  I'll get an infinite loop because badprogram.sh will not queue up the requests.  &lt;BR /&gt;&lt;BR /&gt;If this was an RS6000 running AIX, I would make "badprogram.sh" the backend of a printer.  Then the computer would queue the request like a printer.  The computer would not know or care that "badprogram.sh" is NOT a printer.  &lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 11 Feb 2003 13:18:22 GMT</pubDate>
    <dc:creator>Steve Post</dc:creator>
    <dc:date>2003-02-11T13:18:22Z</dc:date>
    <item>
      <title>way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901638#M105002</link>
      <description>I'm looking for a way to have a program queue up requests to a 3rd party script.&lt;BR /&gt; &lt;BR /&gt;There's this unidata program that runs a 3rd party application via shell script. If I run it slowly it works great.  But if anyone runs it close to the same time, it drops into an infinite loop (that I have to fix by hand).&lt;BR /&gt;&lt;BR /&gt;I know there's got to be a way to queue the requests I'm just blanking here.  I CAN describe it at least.  &lt;BR /&gt;&lt;BR /&gt;runprog.sh&lt;BR /&gt;   sh   badprogram.sh &amp;amp;&lt;BR /&gt;   sh   badprogram.sh &amp;amp;&lt;BR /&gt;&lt;BR /&gt;If I run "runprog.sh", I'm sending 2 jobs to the badprogram.sh.  I'll get an infinite loop because badprogram.sh will not queue up the requests.  &lt;BR /&gt;&lt;BR /&gt;If this was an RS6000 running AIX, I would make "badprogram.sh" the backend of a printer.  Then the computer would queue the request like a printer.  The computer would not know or care that "badprogram.sh" is NOT a printer.  &lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Feb 2003 13:18:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901638#M105002</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2003-02-11T13:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901639#M105003</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Use at and put the users in at.allow&lt;BR /&gt;&lt;BR /&gt;See man at&lt;BR /&gt;&lt;BR /&gt;at, batch - execute batched commands immediately or at a later time&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;          Steve Steel</description>
      <pubDate>Tue, 11 Feb 2003 13:51:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901639#M105003</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-02-11T13:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901640#M105004</link>
      <description>That won't work will it?  &lt;BR /&gt;Let's go through the scenario....&lt;BR /&gt;5 users want to run badprogram.sh.&lt;BR /&gt;I spawn off 5 at jobs for now+1 minute.&lt;BR /&gt;&lt;BR /&gt;If I have 5 at jobs to run at 8:43AM, will it run it 1 then 2 then 3 then 4, and then 5?&lt;BR /&gt;or run it 1&amp;amp;2&amp;amp;3&amp;amp;4&amp;amp;5 at the same time?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Feb 2003 13:57:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901640#M105004</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2003-02-11T13:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901641#M105005</link>
      <description>to schedule them sequentially,...&lt;BR /&gt;&lt;BR /&gt;job1;job1;job1&lt;BR /&gt;&lt;BR /&gt;Or put them in a wrapper script,.&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;for i in bob jane dick&lt;BR /&gt;do&lt;BR /&gt;job1 $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Then 'at -now' command to the script file.&lt;BR /&gt;&lt;BR /&gt;Share and Enjoy! Ian</description>
      <pubDate>Tue, 11 Feb 2003 14:12:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901641#M105005</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2003-02-11T14:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901642#M105006</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;See what you mean . They would run at same time for different users.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thus using  to test&lt;BR /&gt;&lt;BR /&gt;while UNIX95= ps -e -o args|grep -i badprogram.sh|grep -v grep&lt;BR /&gt;do&lt;BR /&gt;sleep 10&lt;BR /&gt;echo 1&lt;BR /&gt;done&lt;BR /&gt;sh badprogram.sh &amp;amp; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This will only launch badprogram when none is running&lt;BR /&gt;&lt;BR /&gt;Something like that.&lt;BR /&gt;&lt;BR /&gt;Or the printer idea should work.&lt;BR /&gt;&lt;BR /&gt;Make a printer on a non standard device in sam&lt;BR /&gt;and replace thescript with your script and then&lt;BR /&gt;calling printer badprogram&lt;BR /&gt;&lt;BR /&gt;lp -dbadprogram will run it&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;                Steve Steel</description>
      <pubDate>Tue, 11 Feb 2003 14:15:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901642#M105006</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-02-11T14:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901643#M105007</link>
      <description>Hi,&lt;BR /&gt;An unususl idea.&lt;BR /&gt;Perhaps it could pe possible to use the printer scheduler for this. Create a printer interface script which run the "badprogram.sh" and set up a printer queue with this interface script (output to /dev/null). Whith this metod you also can use the standard lp commands to monitor and administrate the jobs.</description>
      <pubDate>Tue, 11 Feb 2003 14:22:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901643#M105007</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2003-02-11T14:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901644#M105008</link>
      <description>Hi!&lt;BR /&gt;I'm thinking about organization like:&lt;BR /&gt;&lt;BR /&gt;runprog.sh:&lt;BR /&gt;&lt;BR /&gt;$PAR=badprogram.sh&lt;BR /&gt;ps -ef | grep $PAR | sort &amp;gt; /tmp/testfile&lt;BR /&gt;test -s /tmp/testfile&lt;BR /&gt;if [ $? = "0" ]&lt;BR /&gt; then&lt;BR /&gt; echo "An example of $PAR have already &lt;BR /&gt; running. Please try again later" &amp;gt; ./logfile&lt;BR /&gt; exit&lt;BR /&gt;fi&lt;BR /&gt;...&lt;BR /&gt;&amp;lt; main part of runprog.sh &amp;gt;&lt;BR /&gt;... &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And then you can re-run every 10-15 min&lt;BR /&gt;runprog.sh. &lt;BR /&gt;Something close to this. As option you can also use "sleep" to delay execution of&lt;BR /&gt;badprogram.sh, when your test find another&lt;BR /&gt;example running.&lt;BR /&gt;Regards.  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Feb 2003 14:30:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901644#M105008</guid>
      <dc:creator>Stanimir</dc:creator>
      <dc:date>2003-02-11T14:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901645#M105009</link>
      <description>And also I suppose the brilliant solution&lt;BR /&gt;for this case is creating a client-server&lt;BR /&gt;example,using sockets. In this case the&lt;BR /&gt;server can forks 5-6 independant childs to&lt;BR /&gt;work like your "badprogram.sh" without&lt;BR /&gt;any interference between them.&lt;BR /&gt;Regards,Stan&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Feb 2003 14:37:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901645#M105009</guid>
      <dc:creator>Stanimir</dc:creator>
      <dc:date>2003-02-11T14:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901646#M105010</link>
      <description>ok ok.  WOW! That didn't take long did it?&lt;BR /&gt;You folks broke my writer's block for sure. &lt;BR /&gt;&lt;BR /&gt;1. I can try a wrapper program.&lt;BR /&gt;2. I can try the at command.&lt;BR /&gt;3. I can try my print queue idea (that's what I did in AIX unix too).  Good to see it's possible in HPUX.&lt;BR /&gt;&lt;BR /&gt;When I did it on AIX, it was to run a robot that spits out pills (instead of paper).&lt;BR /&gt;&lt;BR /&gt;Thanks.  Points are coming.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Feb 2003 14:42:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901646#M105010</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2003-02-11T14:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901647#M105011</link>
      <description>The wrapper script won't work.&lt;BR /&gt;I have NO control over the users running the program. So I can't build a batch job for them by hand. &lt;BR /&gt;&lt;BR /&gt;The "at job" almost works. It schedules the jobs at 1 second intervals.  &lt;BR /&gt;&lt;BR /&gt;So if 2 users run the program at the same nanosecond, it will put them one second apart.  It is very possible badprogram.sh will not be done in one second.  That's what my tests show at least.  So I would use some type of lock file it will probably handle it correctly.&lt;BR /&gt;ie:  if [ -f badprog.lock ] ; then &lt;BR /&gt;        batch badprod.sh  # again&lt;BR /&gt;     else&lt;BR /&gt;        touch badprog.lock&lt;BR /&gt;        ./badprogrun.sh&lt;BR /&gt;        rm badprog.lock&lt;BR /&gt;     fi&lt;BR /&gt;OR like what JS wrote. &lt;BR /&gt;&lt;BR /&gt;The client-server thing might work.  But I'm not going to do it.  I don't know how.  Besides you should always try to keep things simple (aka maintainable).&lt;BR /&gt;&lt;BR /&gt;The printer backend idea looks real good.  But I'm biased.  It's what I did before. &lt;BR /&gt;&lt;BR /&gt;Thanks again. &lt;BR /&gt;steve&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Feb 2003 15:16:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901647#M105011</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2003-02-11T15:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: way to queue up multiple requests to run a program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901648#M105012</link>
      <description>fyi:  The printer idea worked great.&lt;BR /&gt;&lt;BR /&gt;I moved /usr/3rdparty/badprog.exe to badprod.exe.real&lt;BR /&gt;&lt;BR /&gt;I made a new badprog.exe file.&lt;BR /&gt;I made an interface file for the "printer".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;lpshut &amp;amp;&amp;amp; lpadmin -pbadprog_ptr -v/dev/null  -i/tmp/badprog.interface &amp;amp;&amp;amp; lpsched&lt;BR /&gt;&lt;BR /&gt;The interface file....&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# file /tmp/badprog.interface&lt;BR /&gt;job=$1&lt;BR /&gt;user=$2&lt;BR /&gt;title=$3&lt;BR /&gt;copy=$4&lt;BR /&gt;options=$5&lt;BR /&gt;shift; shift; shift; shift; shift&lt;BR /&gt;files="$*"&lt;BR /&gt;runcommand=`cat $files`&lt;BR /&gt;&lt;BR /&gt;sleep 10&lt;BR /&gt;date &amp;gt;&amp;gt; /tmp/steve.log&lt;BR /&gt;echo " /usr/3rdparty/badprog.real $runcommand" \ &amp;gt;&amp;gt; /tmp/steve.log&lt;BR /&gt;/usr/3rdparty/badprog.real $runcommand&lt;BR /&gt;exit 0&lt;BR /&gt;###########eof##########&lt;BR /&gt;This gets copied to /etc/lp/interface/badprod_ptr.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;#file /usr/3rdparty/badprog.exe&lt;BR /&gt;# this is the fake version of badprod.exe&lt;BR /&gt;# this runs the print command.&lt;BR /&gt;# the real version of badprog.exe is run by&lt;BR /&gt;# the interface file for printer badprod_ptr.&lt;BR /&gt;host=$1&lt;BR /&gt;infile=$2&lt;BR /&gt;outfile=$3&lt;BR /&gt;echo "$host $infile $outfile"  | lp -dbadprog_ptr&lt;BR /&gt;###########eof##########&lt;BR /&gt;That's it.  Of course this printer should only be used the way it is SUPPOSED to be used.  It would be called only from another program.  The user NEVER would use the printer directly.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Feb 2003 13:43:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/way-to-queue-up-multiple-requests-to-run-a-program/m-p/2901648#M105012</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2003-02-12T13:43:30Z</dc:date>
    </item>
  </channel>
</rss>

