<?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: Cron spawning multiple processes in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710992#M384953</link>
    <description>You still might try stopping and restarting the cron daemon.  If the problem persists you should open a support call with HP.</description>
    <pubDate>Tue, 09 Nov 2010 15:07:26 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2010-11-09T15:07:26Z</dc:date>
    <item>
      <title>Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710989#M384950</link>
      <description>&lt;!--!*#--&gt;Currently I have a few KSH scripts running on our server and have noticed that it is spawning multiple times.  I was first alerted to it when one of the monitoring scripts sent out 3 emails instead of 1.  The script also logs to a file, to which it had also written 3 lines.  This behavior has only recently started and no scripts or executables have been changed.&lt;BR /&gt;&lt;BR /&gt;I created a very simple ksh script which just writes the current unix time to a file to see if I could eliminate the script itself, however the same problem occurs.&lt;BR /&gt;&lt;BR /&gt;From cron we are also calling a binary executable which reorganises a database.  Again, multiple processes are spawned.&lt;BR /&gt;&lt;BR /&gt;I have been seeing this behavior by performing a ps -ef|grep &amp;lt;scriptname&amp;gt; a few times around the time that the crontab starts.  Here is an example of the output:&lt;BR /&gt;&lt;BR /&gt;r0_adms 26363  2176  1 14:17:00 ?         0:00 sh -c (. $HOME/set_dmsenv.sh; tb_monitor.sh) &amp;gt;&amp;gt; $HOME/cron_log/cron.log 2&amp;gt;&amp;amp;1&lt;BR /&gt; r0_adms 26540 26367  1 14:17:00 ?         0:00 sh -c (. $HOME/set_dmsenv.sh; tb_monitor.sh) &amp;gt;&amp;gt; $HOME/cron_log/cron.log 2&amp;gt;&amp;amp;1&lt;BR /&gt; r0_adms 26542 26540  0 14:17:00 ?         0:00 sh -c (. $HOME/set_dmsenv.sh; tb_monitor.sh) &amp;gt;&amp;gt; $HOME/cron_log/cron.log 2&amp;gt;&amp;amp;1&lt;BR /&gt; r0_adms 26367 26363  1 14:17:00 ?         0:00 sh -c (. $HOME/set_dmsenv.sh; tb_monitor.sh) &amp;gt;&amp;gt; $HOME/cron_log/cron.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;In this case set_dmsenv.sh simply adds the necessary paths and variables for our DMS environment.&lt;BR /&gt;&lt;BR /&gt;We are running HPUX B.11.23 U ia64.&lt;BR /&gt;&lt;BR /&gt;Has anyone experienced this?  If so is this expected behavior and does anyone know how to prevent it?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance</description>
      <pubDate>Tue, 09 Nov 2010 12:04:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710989#M384950</guid>
      <dc:creator>Adelheid</dc:creator>
      <dc:date>2010-11-09T12:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710990#M384951</link>
      <description>&amp;gt;&amp;gt;If so is this expected behavior&lt;BR /&gt;&lt;BR /&gt;I wouldn't think so!  &lt;BR /&gt;&lt;BR /&gt;How many 'cron' processes do you have?  &lt;BR /&gt;&lt;BR /&gt;What does 'UNIX95= ps -C cron' show? (Note the space between the = and the 'ps')&lt;BR /&gt;&lt;BR /&gt;If there is more than 1 then that may be your problem.&lt;BR /&gt;&lt;BR /&gt;You could try stopping a restarting cron.&lt;BR /&gt;&lt;BR /&gt;# /sbin/init.d cron stop&lt;BR /&gt;&lt;BR /&gt;Make sure there are no 'cron' processes running.&lt;BR /&gt;&lt;BR /&gt;# /sbin/init.d/cron start&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Nov 2010 14:25:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710990#M384951</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2010-11-09T14:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710991#M384952</link>
      <description>Hi,&lt;BR /&gt;Thank you for your response.  I tried this but only see one cron process:&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -C cron&lt;BR /&gt;  PID TTY          TIME CMD&lt;BR /&gt; 2716 ?           01:34 cron&lt;BR /&gt;&lt;BR /&gt;Kind regards</description>
      <pubDate>Tue, 09 Nov 2010 14:40:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710991#M384952</guid>
      <dc:creator>Adelheid</dc:creator>
      <dc:date>2010-11-09T14:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710992#M384953</link>
      <description>You still might try stopping and restarting the cron daemon.  If the problem persists you should open a support call with HP.</description>
      <pubDate>Tue, 09 Nov 2010 15:07:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710992#M384953</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2010-11-09T15:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710993#M384954</link>
      <description>&amp;gt;multiple processes are spawned.&lt;BR /&gt;&lt;BR /&gt;Not by cron(1m).  These are all done by the shell.  You need to get a hierarchical dump of the process tree:&lt;BR /&gt;UNIX95=EXTENDED_PS ps -H -fu r0_adms &lt;BR /&gt;r0_adms 26363  2176   sh -c (. $HOME/set_dmsenv.sh; tb_monitor.sh)&lt;BR /&gt;r0_adms 26367 26363   sh -c (. $HOME/set_dmsenv.sh; tb_monitor.sh)&lt;BR /&gt;r0_adms 26540 26367   sh -c (. $HOME/set_dmsenv.sh; tb_monitor.sh)&lt;BR /&gt;r0_adms 26542 26540   sh -c (. $HOME/set_dmsenv.sh; tb_monitor.sh)&lt;BR /&gt;&lt;BR /&gt;It looks like the shell is forking itself.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;In this case set_dmsenv.sh simply adds the necessary paths and variables&lt;BR /&gt;&lt;BR /&gt;I assume this completes and you do get to tb_monitor.sh?</description>
      <pubDate>Tue, 09 Nov 2010 20:34:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710993#M384954</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-09T20:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710994#M384955</link>
      <description>Hi,&lt;BR /&gt;I created a small file which simply writes the current unix time to a file and called that, here is the output from it.  What I donÂ´t understand here is the awk line.  There is no awk scripting in the set_dmsenv.sh file at all, nor in my example script.  As I say, this file does nothing apart from setup environment variables.&lt;BR /&gt;&lt;BR /&gt;r0_pdms  19792  2716  0 09:10:00 ?           00:00 sh -c (. $HOME/set_dmsenv.sh; ~/rh/test.sh)&lt;BR /&gt;r0_pdms  19794 19792  2 09:10:00 ?           00:00   sh -c (. $HOME/set_dmsenv.sh; ~/rh/test.sh)&lt;BR /&gt;r0_pdms  19953 19794  0 09:10:00 ?           00:00     /usr/bin/awk {for (i=1; i&amp;lt;= NF; ++i)           if( $i != VAR ) print $i":"} FS=: VAR=/opt/IBM/db2ia32/sqllib/java/db2jcc.jar&lt;BR /&gt;r0_pdms  19954 19953  0 09:10:00 ?           00:00       sh -c (. $HOME/set_dmsenv.sh; ~/rh/test.sh)&lt;BR /&gt;r0_pdms  19955 19954  0 09:10:00 ?           00:00         /usr/bin/echo /opt/IBM/db2ia32/sqllib/java/db2java.zip&lt;BR /&gt;&lt;BR /&gt;Here is my test script:&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;epoch=`date "+%s"`&lt;BR /&gt;echo $epoch&amp;gt;&amp;gt;test.out&lt;BR /&gt;&lt;BR /&gt;Although this script appears to spawn 3 times using my previous method I do only get one line of output in the test.out file.&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Nov 2010 08:35:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710994#M384955</guid>
      <dc:creator>Adelheid</dc:creator>
      <dc:date>2010-11-10T08:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710995#M384956</link>
      <description>Furthermore, I also have an executable which is producing the following output:&lt;BR /&gt;&lt;BR /&gt;r0_pdms  23173  2716  1 10:05:00 ?           00:00 sh -c (. $HOME/set_dmsenv.sh; mdmsadminclient r) &amp;gt;&amp;gt;$HOME/cron_log/cron.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;r0_pdms  23180 23173  2 10:05:00 ?           00:00   sh -c (. $HOME/set_dmsenv.sh; mdmsadminclient r) &amp;gt;&amp;gt;$HOME/cron_log/cron.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;r0_pdms  23364 23180  0 10:05:00 ?           00:00     /usr/bin/sed s/\: /\:/g&lt;BR /&gt;r0_pdms  23368 23364  0 10:05:00 ?           00:00       sh -c (. $HOME/set_dmsenv.sh; mdmsadminclient r) &amp;gt;&amp;gt;$HOME/cron_log/cron.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Nov 2010 09:32:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710995#M384956</guid>
      <dc:creator>Adelheid</dc:creator>
      <dc:date>2010-11-10T09:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710996#M384957</link>
      <description>&amp;gt;What I don't understand here is the awk line. There is no awk scripting in the set_dmsenv.sh file at all, nor in my example script. As I say, this file does nothing apart from setup environment variables.&lt;BR /&gt;&lt;BR /&gt;Do you export ENV to set up a .kshrc file?&lt;BR /&gt;What's in set_dmsenv.sh?&lt;BR /&gt;&lt;BR /&gt;You may want to add "set -x" to your script AND to set_dmsenv.sh.</description>
      <pubDate>Wed, 10 Nov 2010 09:42:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710996#M384957</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-10T09:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710997#M384958</link>
      <description>&lt;!--!*#--&gt;I made a copy of the set_dmsenv.sh for testing...&lt;BR /&gt;&lt;BR /&gt;I took out the scripts altogether and just call the set_dmsenvtest.sh script:&lt;BR /&gt;&lt;BR /&gt;UID        PID  PPID  C    STIME TTY          TIME CMD&lt;BR /&gt;r0_pdms  20840  2716  1 11:43:00 ?           00:00 sh -c (. $HOME/set_dmsenvtest.sh)&lt;BR /&gt;r0_pdms  20857 20840  2 11:43:01 ?           00:00   sh -c (. $HOME/set_dmsenvtest.sh)&lt;BR /&gt;r0_pdms  21041 20857  0 11:43:01 ?           00:00     /usr/bin/awk {for (i=1; i&amp;lt;= NF; ++i)           if( $i != VAR ) print $i":"} FS=: VAR=.&lt;BR /&gt;r0_pdms  21043 21041  0 11:43:01 ?           00:00       sh -c (. $HOME/set_dmsenvtest.sh)&lt;BR /&gt;r0_pdms  21045 21043  0 11:43:01 ?           00:00         /usr/bin/echo /opt/IBM/db2ia32/sqllib/java/db2java.zip:/opt/IBM/db2ia32/sqllib/java/db2jcc.jar:/opt/IBM/db2ia32/sqllib/java/db2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have attached the set_dmsenvtest.sh file.  In the .environ file we have the following:&lt;BR /&gt;&lt;BR /&gt;set -o trackall&lt;BR /&gt;alias history='fc -l -20'&lt;BR /&gt;alias h='fc -l -20'&lt;BR /&gt;alias dir='ls -la |more -cs '&lt;BR /&gt;alias -t&lt;BR /&gt;alias um='set -- -1;. um'&lt;BR /&gt;alias psu='ps -fu $LOGNAME|grep -v "ps -fu"'&lt;BR /&gt;alias lb='cd ${MBASE}/locbin;x'&lt;BR /&gt;alias sm='cd ${MBASE}/seriem;x'&lt;BR /&gt;alias mb='cd ${MBASE};x'&lt;BR /&gt;&lt;BR /&gt;Thanks for your help so far.</description>
      <pubDate>Wed, 10 Nov 2010 10:57:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710997#M384958</guid>
      <dc:creator>Adelheid</dc:creator>
      <dc:date>2010-11-10T10:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710998#M384959</link>
      <description>&amp;gt;I took out the scripts altogether and just call the set_dmsenvtest.sh script:&lt;BR /&gt;&lt;BR /&gt;It seems it is bad.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;In the .environ file we have the following:&lt;BR /&gt;&lt;BR /&gt;That seems safe.&lt;BR /&gt;&lt;BR /&gt;What's in ${DB2HOME}/sqllib/db2profile?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;HostName=*********&lt;BR /&gt;&lt;BR /&gt;This isn't going to work, change to:&lt;BR /&gt;HostName="*********"&lt;BR /&gt;(Unless the censor got to it. :-)&lt;BR /&gt;&lt;BR /&gt;You have "set +x" at the top.  You need "set -x" to trace.</description>
      <pubDate>Thu, 11 Nov 2010 10:41:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710998#M384959</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-11T10:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710999#M384960</link>
      <description>&lt;!--!*#--&gt;Hi Dennis,&lt;BR /&gt;I commented out the hostnames :-)&lt;BR /&gt;&lt;BR /&gt;I have changed the + to a - and let it run again, I am not sure what I am looking for in terms of a trace, or how to get more info.  Anyhow, this is the output from the ps:&lt;BR /&gt;&lt;BR /&gt;r0_pdms  22869  2716  0 11:45:00 ?           00:00 sh -c (. $HOME/set_dmsenvtest.sh)&lt;BR /&gt;r0_pdms  22871 22869  1 11:45:00 ?           00:00   sh -c (. $HOME/set_dmsenvtest.sh)&lt;BR /&gt;r0_pdms  22872 22871  1 11:45:00 ?           00:00     sh -c (. $HOME/set_dmsenvtest.sh)&lt;BR /&gt;r0_pdms  22874 22872  0 11:45:00 ?           00:00       sh -c (. $HOME/set_dmsenvtest.sh)&lt;BR /&gt;r0_pdms  22875 22874  0 11:45:00 ?           00:00         sh -c (. $HOME/set_dmsenvtest.sh)&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 11 Nov 2010 10:52:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4710999#M384960</guid>
      <dc:creator>Adelheid</dc:creator>
      <dc:date>2010-11-11T10:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4711000#M384961</link>
      <description>ah, found it....uploaded :-)</description>
      <pubDate>Thu, 11 Nov 2010 11:37:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4711000#M384961</guid>
      <dc:creator>Adelheid</dc:creator>
      <dc:date>2010-11-11T11:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cron spawning multiple processes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4711001#M384962</link>
      <description>&amp;gt;found it....uploaded :-)&lt;BR /&gt;&lt;BR /&gt;Where?  /var/spool/cron/tmp/?  Or $HOME/cron_log/cron.log?&lt;BR /&gt;&lt;BR /&gt;You seemed to get to ${DB2HOME}/sqllib/db2profile &amp;amp; /opt/IBM/db2ia32/sqllib/userprofile&lt;BR /&gt;&lt;BR /&gt;It might help to have "set -x" in the latter.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;export DB2CODEPAGE=1051 shows you got back.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;HARES=/opt/VRTSvcs/bin/hares&lt;BR /&gt;&lt;BR /&gt;It seems you got to the end of the file.&lt;BR /&gt;&lt;BR /&gt;There seems to be something broken with the shell.  You might try making sure it and cron  hasn't be corrupted:&lt;BR /&gt;swverify OS-Core.UX2-CORE OS-Core.CMDS2-MIN&lt;BR /&gt;&lt;BR /&gt;Or you might want to use tusc on cron to see why those shells get forked.&lt;BR /&gt;tusc -fp -ea -o tusc.out  2716 #cron-PID&lt;BR /&gt;&lt;BR /&gt;You can kill tusc after you see another bunch of nested shells hung.&lt;BR /&gt;&lt;BR /&gt;I've had cases with the scummy C shell where it hangs.  You could try redirecting stdin to /dev/null:&lt;BR /&gt;(. $HOME/set_dmsenv.sh; tb_monitor.sh) &amp;gt;&amp;gt; $HOME/cron_log/cron.log 2&amp;gt;&amp;amp;1 &amp;lt; /dev/null</description>
      <pubDate>Thu, 11 Nov 2010 12:01:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-spawning-multiple-processes/m-p/4711001#M384962</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-11T12:01:51Z</dc:date>
    </item>
  </channel>
</rss>

