<?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: &amp;quot;su -&amp;quot; hangs when called inside a shell script. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615611#M815560</link>
    <description>Running it from the command line.....</description>
    <pubDate>Wed, 31 Aug 2005 14:28:52 GMT</pubDate>
    <dc:creator>Chris Magargee_2</dc:creator>
    <dc:date>2005-08-31T14:28:52Z</dc:date>
    <item>
      <title>"su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615604#M815553</link>
      <description>We have a master shell script thats calls another shell script that does a:&lt;BR /&gt;&lt;BR /&gt;su - &lt;LOGINNAME&gt; -c "&amp;lt;script&amp;gt; $ARGS"&lt;BR /&gt;&lt;BR /&gt;Periodically when the master script calls the sub script, the "su" will hang.  You can see the "su" in a ps, but it is not running.  &lt;BR /&gt;&lt;BR /&gt;We can kill the "su", rerun the master script and the "su" from the sub script runs fine.&lt;BR /&gt;&lt;BR /&gt;Any thoughts or suggestions would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Chris&lt;/LOGINNAME&gt;</description>
      <pubDate>Wed, 31 Aug 2005 09:24:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615604#M815553</guid>
      <dc:creator>Chris Magargee_2</dc:creator>
      <dc:date>2005-08-31T09:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615605#M815554</link>
      <description>Let us isolate the problem first.&lt;BR /&gt;su - &lt;LOGINNAME&gt; &lt;BR /&gt;Does it work?? If not resolve it and if everything is ok, move on. Run the script.&lt;BR /&gt;"&amp;lt;script&amp;gt; $ARGS" Is that OK??&lt;BR /&gt;If not check your script.&lt;BR /&gt;&lt;BR /&gt;Put set -vx in script and check what step it failes at. Make sure you run commands with full path names, all required variables are defined.&lt;/LOGINNAME&gt;</description>
      <pubDate>Wed, 31 Aug 2005 09:28:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615605#M815554</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-08-31T09:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615606#M815555</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Who's running the script? Root?&lt;BR /&gt;&lt;BR /&gt;If it's not root, su will wait for a password.&lt;BR /&gt;&lt;BR /&gt;Enjoy :)&lt;BR /&gt;&lt;BR /&gt;Pedro</description>
      <pubDate>Wed, 31 Aug 2005 09:29:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615606#M815555</guid>
      <dc:creator>Pedro Cirne</dc:creator>
      <dc:date>2005-08-31T09:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615607#M815556</link>
      <description>It looks like you're passing a command along with the su.  Is it that command that is hanging?  Or, does that command never run?</description>
      <pubDate>Wed, 31 Aug 2005 09:29:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615607#M815556</guid>
      <dc:creator>Pat Lieberg</dc:creator>
      <dc:date>2005-08-31T09:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615608#M815557</link>
      <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;Unless the script issuing the 'su' is running as 'root', 'su' will prompt for a password for the account to which you are attmpting to switch.  The problem is that you cannot supply the password except in an interactive way; i.e. redirection from file will not work.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 31 Aug 2005 09:31:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615608#M815557</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-08-31T09:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615609#M815558</link>
      <description>To answer some of the questions.&lt;BR /&gt;&lt;BR /&gt;1)  It is being run by root.&lt;BR /&gt;2)  The su command runs by hand works fine.&lt;BR /&gt;3)  The su itself appears to hang, we never receive the login banner from the "su -".&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Chris</description>
      <pubDate>Wed, 31 Aug 2005 10:04:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615609#M815558</guid>
      <dc:creator>Chris Magargee_2</dc:creator>
      <dc:date>2005-08-31T10:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615610#M815559</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I think that some environment variable is missing.&lt;BR /&gt;&lt;BR /&gt;Are you running this script from cron?&lt;BR /&gt;&lt;BR /&gt;If you run it from cron you don't have the environement variables defined of the user root and they are not passed to the user when you su to it.&lt;BR /&gt;&lt;BR /&gt;Check:&lt;BR /&gt;&lt;BR /&gt;#man su&lt;BR /&gt;#man cron&lt;BR /&gt;&lt;BR /&gt;Enjoy :)&lt;BR /&gt;&lt;BR /&gt;Pedro</description>
      <pubDate>Wed, 31 Aug 2005 10:53:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615610#M815559</guid>
      <dc:creator>Pedro Cirne</dc:creator>
      <dc:date>2005-08-31T10:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615611#M815560</link>
      <description>Running it from the command line.....</description>
      <pubDate>Wed, 31 Aug 2005 14:28:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615611#M815560</guid>
      <dc:creator>Chris Magargee_2</dc:creator>
      <dc:date>2005-08-31T14:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615612#M815561</link>
      <description>What login banner ?  su - may read the new users profile but that is about it other than your command you are telling it to run.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Aug 2005 14:44:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615612#M815561</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2005-08-31T14:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: "su -" hangs when called inside a shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615613#M815562</link>
      <description>in your scrip, just before the line, running the su command, insert a line &lt;BR /&gt;&lt;BR /&gt;set -x&lt;BR /&gt;&lt;BR /&gt;and right after su line, insert another one containing, guess what:&lt;BR /&gt;&lt;BR /&gt;set +x&lt;BR /&gt;&lt;BR /&gt;and run your script. You may see why and where it stops. If you see the su command getting executed, then try starting your script called from the su command with "set -x" and ending it with "set +x", it will show you the variable assignments made on the fly or what it is waiting for etc.&lt;BR /&gt;&lt;BR /&gt;hope this helps</description>
      <pubDate>Wed, 31 Aug 2005 15:33:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-su-quot-hangs-when-called-inside-a-shell-script/m-p/3615613#M815562</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-08-31T15:33:04Z</dc:date>
    </item>
  </channel>
</rss>

