<?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: Would appreciate debugging tips for SD configure script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261087#M332971</link>
    <description>&lt;!--!*#--&gt;Since you asked for the ugly details.&lt;BR /&gt;&lt;BR /&gt;I admit, probably too contrived&lt;BR /&gt;where a mere grep would have done.&lt;BR /&gt;&lt;BR /&gt;has_listen_socket() {&lt;BR /&gt;    netstat -an -f inet \&lt;BR /&gt;        | awk -v p=${1:-5666} 'BEGIN{rc=1}; \&lt;BR /&gt;            $1=="tcp"&amp;amp;&amp;amp;$NF=="LISTEN"&amp;amp;&amp;amp;a[split($4,a,".")]==p{rc=0;exit}; \&lt;BR /&gt;            END{exit rc}'&lt;BR /&gt;}&lt;BR /&gt;</description>
    <pubDate>Mon, 01 Sep 2008 10:57:31 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2008-09-01T10:57:31Z</dc:date>
    <item>
      <title>Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261079#M332963</link>
      <description>&lt;!--!*#--&gt;Hi, &lt;BR /&gt;&lt;BR /&gt;I try to swpackage a Nagios NRPE build.&lt;BR /&gt;Because service needs to be registered, &lt;BR /&gt;group and user added and inetd reconfigured &lt;BR /&gt;I provided a configure/unconfigure script&lt;BR /&gt;in which I cannot find a syntax error.&lt;BR /&gt;There must be some garbage in the configure file however.&lt;BR /&gt;Though I tried "cat -e configure" and "xd -t a configure" I cannot find the following number LF sequences that seem to cause the syntax error.&lt;BR /&gt;&lt;BR /&gt;When I run &lt;BR /&gt;# swconfig NagiosNRPE.ALL&lt;BR /&gt;&lt;BR /&gt;in swjob's log it failed with this line&lt;BR /&gt;&lt;BR /&gt;/var/adm/sw/products/NagiosNRPE/ALL/configure[23]: 27^J35^J40^J52^J59^J75^J91^J1&lt;BR /&gt;01^J102^J109^J112: Syntax error&lt;BR /&gt;&lt;BR /&gt;I slightly modified the script to use $$ instead o jobid parsed from $SW_SESSION_OPTS to be able to run the script from the interactive shell as well.&lt;BR /&gt;So when I set -x and provide the minimally required SW environment I get the same result.&lt;BR /&gt;&lt;BR /&gt;# SW_PATH=/usr/bin SW_SOFTWARE_SPEC=NagiosNRPE.ALL,bla SW_CONTROL_TAG=configure /var/adm/sw/products/NagiosNRPE/ALL/configure&lt;BR /&gt;+ export PATH=/sbin:/usr/sbin:/usr/bin&lt;BR /&gt;+ + uname -n&lt;BR /&gt;NODE=elba&lt;BR /&gt;+ fileset=NagiosNRPE.ALL&lt;BR /&gt;+ [[ -n  ]]&lt;BR /&gt;+ JOBID=7896&lt;BR /&gt;+ [[ NagiosNRPE.ALL = NagiosNRPE.ALL ]]&lt;BR /&gt;+ eval_response&lt;BR /&gt;+ : 5666&lt;BR /&gt;+ 1&amp;gt;&amp;amp; 2&lt;BR /&gt;+ has_listen_socket 5666&lt;BR /&gt;+ configure_inetd&lt;BR /&gt;/var/adm/sw/products/NagiosNRPE/ALL/configure[23]: 27^J35^J40^J52^J59^J75^J91^J101^J102^J109^J112: Syntax error&lt;BR /&gt;&lt;BR /&gt;Is there a better way to debug this?</description>
      <pubDate>Mon, 01 Sep 2008 10:02:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261079#M332963</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-09-01T10:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261080#M332964</link>
      <description>What's on line 23?&lt;BR /&gt;Is configure_inetd a function?&lt;BR /&gt;&lt;BR /&gt;You'll need to insert "set -x" in each function you use.&lt;BR /&gt;(I don't know if "#!/sbin/sh -x" will work for the whole script?)&lt;BR /&gt;&lt;BR /&gt;The error looks like you are doing: $(&amp;lt; file)&lt;BR /&gt;With a missing command in the front.</description>
      <pubDate>Mon, 01 Sep 2008 10:11:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261080#M332964</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-01T10:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261081#M332965</link>
      <description>Not being too happy with sh's debugging facilities,&lt;BR /&gt;would anything prohibit writing those swpackage scripts in Perl?&lt;BR /&gt;I really cannot find a compelling reason.</description>
      <pubDate>Mon, 01 Sep 2008 10:13:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261081#M332965</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-09-01T10:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261082#M332966</link>
      <description>Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;yes, configure_inetd is a func,&lt;BR /&gt;and yes, I haven't put -x in every func's body.&lt;BR /&gt;&lt;BR /&gt;I think the reference to line 23 is bogus.&lt;BR /&gt;There isn't something evil around it.&lt;BR /&gt;Only my quick fix for an undefined $SW_SESSION_OPTIONS, which is merely an ephemeral file provided in swconfig's context.&lt;BR /&gt;&lt;BR /&gt;# cat -n -e -t /var/adm/sw/products/NagiosNRPE/ALL/configure|sed -n 20,25p&lt;BR /&gt;    20  if [[ -n $SW_SESSION_OPTIONS ]]; then$&lt;BR /&gt;    21  JOBID=$(awk -F'[= ]' '$1=="jobid"{print$2}' $SW_SESSION_OPTIONS)$&lt;BR /&gt;    22  else$&lt;BR /&gt;    23  JOBID=$$$&lt;BR /&gt;    24  fi$&lt;BR /&gt;    25  $&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Sep 2008 10:19:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261082#M332966</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-09-01T10:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261083#M332967</link>
      <description>&amp;gt;would anything prohibit writing those swpackage scripts in Perl?&lt;BR /&gt;&amp;gt;I really cannot find a compelling reason.&lt;BR /&gt;&lt;BR /&gt;Several:&lt;BR /&gt;1) Perl may not be installed on all systems.&lt;BR /&gt;2) You need /sbin/sh when /usr/ isn't mounted.&lt;BR /&gt;3) How will you use the functions in /usr/lbin/sw/control_utils?&lt;BR /&gt;4) You shouldn't be writing buggy shell code. :-)</description>
      <pubDate>Mon, 01 Sep 2008 10:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261083#M332967</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-01T10:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261084#M332968</link>
      <description>Hello Ralph,&lt;BR /&gt;&lt;BR /&gt;Have you tried with SDU_DEBUG options? &lt;BR /&gt;&lt;BR /&gt;Try to export to appropriate level (1-4) and after that try swconfig commands.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Mon, 01 Sep 2008 10:25:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261084#M332968</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2008-09-01T10:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261085#M332969</link>
      <description>&amp;gt;I think the reference to line 23 is bogus.&lt;BR /&gt;&lt;BR /&gt;It may mean line 23 in that function.  What were the lines for:&lt;BR /&gt;+ has_listen_socket 5666&lt;BR /&gt;+ configure_inetd&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Ivan: Have you tried with SDU_DEBUG options?&lt;BR /&gt;&lt;BR /&gt;I'm not sure that is any better than "set -x" or "#!/sbin/sh -x".  And it probably equal to the latter.</description>
      <pubDate>Mon, 01 Sep 2008 10:36:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261085#M332969</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-01T10:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261086#M332970</link>
      <description>Hello Ivan,&lt;BR /&gt;&lt;BR /&gt;no I haven't yet come across SDU_DEBUG.&lt;BR /&gt;Can't remember to have seen it in any of the manpages.&lt;BR /&gt;That thing is quite nice.&lt;BR /&gt;But I think it is rather addressed at the developers of SD utils and not the user to debug their crappy scripts.&lt;BR /&gt;Even with highest flag it doesn't produce more hints related to the script error.&lt;BR /&gt;&lt;BR /&gt;# SDU_DEBUG=4 swconfig NagiosNRPE.ALL 2&amp;gt;&amp;amp;1|grep ERR&lt;BR /&gt;ERROR:   "elba:/":  1 configure or unconfigure scripts failed.&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Sep 2008 10:45:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261086#M332970</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-09-01T10:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261087#M332971</link>
      <description>&lt;!--!*#--&gt;Since you asked for the ugly details.&lt;BR /&gt;&lt;BR /&gt;I admit, probably too contrived&lt;BR /&gt;where a mere grep would have done.&lt;BR /&gt;&lt;BR /&gt;has_listen_socket() {&lt;BR /&gt;    netstat -an -f inet \&lt;BR /&gt;        | awk -v p=${1:-5666} 'BEGIN{rc=1}; \&lt;BR /&gt;            $1=="tcp"&amp;amp;&amp;amp;$NF=="LISTEN"&amp;amp;&amp;amp;a[split($4,a,".")]==p{rc=0;exit}; \&lt;BR /&gt;            END{exit rc}'&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Sep 2008 10:57:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261087#M332971</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-09-01T10:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261088#M332972</link>
      <description>&lt;!--!*#--&gt;I discovered an interesting effect&lt;BR /&gt;which makes me suspect that the failure could have been cause by an absent response file.&lt;BR /&gt;I provided my script with a request block&lt;BR /&gt;which of course only gets executed when swinstall or swconfig is run with -x ask=true.&lt;BR /&gt;&lt;BR /&gt;So this time I invoked swconfig with that option an confirmed my request defaults.&lt;BR /&gt;This time all has been configured to my delight and inetd started the new service.&lt;BR /&gt;&lt;BR /&gt;[root@elba:/root]&lt;BR /&gt;# netstat -an|grep 5666&lt;BR /&gt;tcp        0      0  *.5666                 *.*                     LISTEN&lt;BR /&gt;[root@elba:/root]&lt;BR /&gt;# id nagios&lt;BR /&gt;uid=103(nagios) gid=102(nagios)&lt;BR /&gt;[root@elba:/root]&lt;BR /&gt;# grep nagios /etc/passwd &lt;BR /&gt;nagios:*:103:102:NRPE user added by SD elba-0089:/var/opt/nagios:/usr/bin/sh&lt;BR /&gt;[root@elba:/root]&lt;BR /&gt;# grep nrpe /etc/{services,inetd.conf}&lt;BR /&gt;/etc/services:nrpe              5666/tcp                # Nagios Remote Plug-in Executor&lt;BR /&gt;/etc/inetd.conf:nrpe    stream tcp nowait nagios /opt/nagios/sbin/nrpe nrpe -n -c /opt/nagios/etc/nrpe.cfg -i&lt;BR /&gt;&lt;BR /&gt;[root@elba:/root]&lt;BR /&gt;# /opt/nagios/plugins/libexec/check_nrpe -n -H 127.0.0.1 -c check_disk&lt;BR /&gt;DISK CRITICAL - /export/oracle/arch1 is not accessible: Berechtigung verweigert&lt;BR /&gt;&lt;BR /&gt;Ok, the failing check_disk reminds me that I still need to build in some sudo rule for non-readable,executable mount points by the nrpe user.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Sep 2008 11:18:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261088#M332972</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-09-01T11:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261089#M332973</link>
      <description>Can anyone tell me how I should provide a predefined reponse file,&lt;BR /&gt;in case that the person installing the depot doesn't want to run through request with -x ask=true because they are happy with the defaults?&lt;BR /&gt;&lt;BR /&gt;I mean I can't put it in advance into&lt;BR /&gt;$SW_CONTROL_DIRECTORY/response&lt;BR /&gt;could I?&lt;BR /&gt;&lt;BR /&gt;I have't yet understood how to supply a preset response file.</description>
      <pubDate>Mon, 01 Sep 2008 11:24:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261089#M332973</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-09-01T11:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261090#M332974</link>
      <description>&lt;!--!*#--&gt;has_listen_socket() {&lt;BR /&gt;    netstat -an -f inet \&lt;BR /&gt;        | awk -v p=${1:-5666} 'BEGIN{rc=1}; \&lt;BR /&gt;            $1=="tcp"&amp;amp;&amp;amp;$NF=="LISTEN"&amp;amp;&amp;amp;a[split($4,a,".")]==p{rc=0;exit}; \&lt;BR /&gt;            END{exit rc}'&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;You have too many "\".  :-)&lt;BR /&gt;The first, you can remove the "\" and put the "|" at the end of the line.&lt;BR /&gt;You don't need any "\" inside the awk single quotes.&lt;BR /&gt;&lt;BR /&gt;has_listen_socket() {&lt;BR /&gt;   netstat -an -f inet |&lt;BR /&gt;     awk -v p=${1:-5666} '&lt;BR /&gt;BEGIN {rc=1}&lt;BR /&gt;$1=="tcp" &amp;amp;&amp;amp; $NF == "LISTEN" &amp;amp;&amp;amp; a[split($4,a,".")] == p {&lt;BR /&gt;   rc=0&lt;BR /&gt;   exit&lt;BR /&gt;}&lt;BR /&gt;END {exit rc}'&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;You might want to add an echo before and after that one pipeline.</description>
      <pubDate>Mon, 01 Sep 2008 11:24:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261090#M332974</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-01T11:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261091#M332975</link>
      <description>&amp;gt;cause by an absent response file.&lt;BR /&gt;&lt;BR /&gt;You should use "set -u" to check for uninitialized shell variables?</description>
      <pubDate>Mon, 01 Sep 2008 11:28:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261091#M332975</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-01T11:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Would appreciate debugging tips for SD configure script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261092#M332976</link>
      <description>Thanks Dennis,&lt;BR /&gt;&lt;BR /&gt;I am not terribly fond of awk and regard only as an inferior makeshift when one cannot expect to find perl.&lt;BR /&gt;That's why I never have invested too much bother on quoting voodoo in awk.&lt;BR /&gt;In perl we have the -MO=Deparse if we want to look behind the scenes.&lt;BR /&gt;&lt;BR /&gt;Yes, I will take up the -u to aid in debugging.&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Sep 2008 11:54:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/would-appreciate-debugging-tips-for-sd-configure-script/m-p/4261092#M332976</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-09-01T11:54:30Z</dc:date>
    </item>
  </channel>
</rss>

