<?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: bizzare script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566214#M29957</link>
    <description>What is the setting of DefaultUser in sendmail.cf? (Typically 1:1). Sendmail will switch to this uid:gid for all insecure operations outside of itself. This means that all functions through ~root/.forward are done as the DefaultUser while ~joe/.forward is done as joe. Check the perms of arraydsp. Here they are 0544, so only root can run it.</description>
    <pubDate>Thu, 16 Aug 2001 20:47:48 GMT</pubDate>
    <dc:creator>Jordan Bean</dc:creator>
    <dc:date>2001-08-16T20:47:48Z</dc:date>
    <item>
      <title>bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566205#M29948</link>
      <description>in roots .forward file I have &lt;BR /&gt;| /bin/notify&lt;BR /&gt;to send all emails through this script.&lt;BR /&gt;in the script notify I have this&lt;BR /&gt;&lt;BR /&gt;awk '{print $0}' &amp;gt; /tmp/mailfile&lt;BR /&gt;&lt;BR /&gt;grep -i critical /tmp/mailtmpfile &amp;gt; /dev/null&lt;BR /&gt;if [[ $? -eq 0 ]];then&lt;BR /&gt;&lt;BR /&gt;echo $SNA `arraydsp -a $SNA |egrep '(Overall State of Array)' |awk -F= '{print $&lt;BR /&gt;2}'` &amp;gt; /tmp/STATE &lt;BR /&gt;&lt;BR /&gt;SNA is the serial numbers for the arrays..the arraydsp statement either comes back READY, or WARNING..&lt;BR /&gt;when I run this script by sending an email with CRITICAL in the message, $SNA is printed in /tmp/STATE, but the arraydsp statement is NOT..HOWEVER, if I comment out the first awk statement and put critical into /tmp/mailtmpfile and run the script from the command line, it works, both the SN and READY are in /tmp/STATE.&lt;BR /&gt;&lt;BR /&gt;Any ideas?</description>
      <pubDate>Thu, 16 Aug 2001 16:47:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566205#M29948</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-08-16T16:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566206#M29949</link>
      <description>Probably a PATH problem.  Use the full path in your arraydsp command.  I would bet that would fix it.&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Thu, 16 Aug 2001 17:06:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566206#M29949</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-16T17:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566207#M29950</link>
      <description>No, it's not a path problem, arraydsp does not get evaluated with or without the full path. Is there something special about arraydsp that is keeping it from getting evaluated through the email?</description>
      <pubDate>Thu, 16 Aug 2001 17:22:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566207#M29950</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-08-16T17:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566208#M29951</link>
      <description>Kevin,&lt;BR /&gt;&lt;BR /&gt;Try some debugging like this&lt;BR /&gt;&lt;BR /&gt;STATE=`arraydsp -a $SNA |egrep '(Overall State of Array)' |awk -F= '{print $2}'` &lt;BR /&gt;&lt;BR /&gt;printf $STATE  $SNA \n &amp;gt;&amp;gt; /tmp/state&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Aug 2001 17:24:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566208#M29951</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-16T17:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566209#M29952</link>
      <description>I have tested that, it doesn't matter, arraydsp -a does NOT get evaluated through the email, but it does get evaluated if you run it from the command line only.</description>
      <pubDate>Thu, 16 Aug 2001 17:36:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566209#M29952</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-08-16T17:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566210#M29953</link>
      <description>Do you know how the environment is set when this program is running?  Is your environment different from when you are running it on the command line?&lt;BR /&gt;I had a cronjob that kept failing because it never used /etc/profile or $HOME/.profile.</description>
      <pubDate>Thu, 16 Aug 2001 17:45:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566210#M29953</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2001-08-16T17:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566211#M29954</link>
      <description>Hmmmm I don't know Kevin.  Sounds fishy to me.  I still think this is in the env department.  &lt;BR /&gt;&lt;BR /&gt;Try to enliminate certain vaibles&lt;BR /&gt;&lt;BR /&gt;env &amp;gt; /tmp/test.dat&lt;BR /&gt;echo $SNA &amp;gt;&amp;gt; /tmp/test.dat&lt;BR /&gt;arr=`arraydsp -a realnumber`&lt;BR /&gt;echo $arr &amp;gt;&amp;gt; /tmp/test.dat &lt;BR /&gt;&lt;BR /&gt;Also, the script may not be translating the $SNA in the ``.  I would try it like ${SNA}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Thu, 16 Aug 2001 17:48:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566211#M29954</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-16T17:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566212#M29955</link>
      <description>This is the script&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;export SNA=00000120AEFD&lt;BR /&gt;awk '{print $0}' &amp;gt; /tmp/mails&lt;BR /&gt;grep -i critical /tmp/mails&lt;BR /&gt;if [[ $? -eq 0 ]];then&lt;BR /&gt;arr=`/opt/hparray/bin/arraydsp -a 0000120AEFD` &lt;BR /&gt;env &amp;gt; /tmp/test.dat&lt;BR /&gt;echo $SNA &amp;gt;&amp;gt;/tmp/test.dat&lt;BR /&gt;echo $arr &amp;gt;&amp;gt;/tmp/test.dat&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;this is /tmp/test.dat&lt;BR /&gt;_=/usr/bin/env&lt;BR /&gt;AGENT=sendmail&lt;BR /&gt;SNA=00000120AEFD&lt;BR /&gt;PWD=/&lt;BR /&gt;TZ=MST7MDT&lt;BR /&gt;00000120AEFD&lt;BR /&gt;&lt;BR /&gt;With a blank space at the bottom. Why does it have the Serial # 00000120AEFD at the end too?</description>
      <pubDate>Thu, 16 Aug 2001 18:18:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566212#M29955</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-08-16T18:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566213#M29956</link>
      <description>Ya, arr is too long.  The ssn at the end is the $SNA value.  SNA= is the export you did.  I still think it is the path.  Use the complete path for arraydsk, egrep, and awk.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;GOOD LUCK&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Thu, 16 Aug 2001 20:01:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566213#M29956</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-16T20:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566214#M29957</link>
      <description>What is the setting of DefaultUser in sendmail.cf? (Typically 1:1). Sendmail will switch to this uid:gid for all insecure operations outside of itself. This means that all functions through ~root/.forward are done as the DefaultUser while ~joe/.forward is done as joe. Check the perms of arraydsp. Here they are 0544, so only root can run it.</description>
      <pubDate>Thu, 16 Aug 2001 20:47:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566214#M29957</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2001-08-16T20:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: bizzare script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566215#M29958</link>
      <description>The problem has been fixed, thanks to all who replied..I wish I would have been to access this site recently, because if I would have been able to read your post Jordan, it would have saved me some time..&lt;BR /&gt;I set the script to setuid root, and it worked, so I realized that through the email, the script was not getting executed as root. I thought it would because it was root's .forward file executing the script. I still don't quite understand what sendmail definition of insecure operations means.</description>
      <pubDate>Fri, 17 Aug 2001 23:26:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bizzare-script-problem/m-p/2566215#M29958</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-08-17T23:26:37Z</dc:date>
    </item>
  </channel>
</rss>

