<?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: Can i execute su command in pkg.cntl file cluster in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340098#M702096</link>
    <description>Be very careful doing su - user commands in a non-interactive environment. Most default .profiles expect to be running with a TTY input device and commands like tset, tput, tabs ... can hang or fail. There are two approaches, 1) surround any commands in the .profile with&lt;BR /&gt;if [ -t 0 ]&lt;BR /&gt;then&lt;BR /&gt;  tset&lt;BR /&gt;  tabs&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;create a script file which sets and exports any needed variables and let both the .profile and any scripts source the file, e.g. myenv.sh using the "." (dot) command.&lt;BR /&gt;&lt;BR /&gt;. /usr/local/bin/myenv.sh&lt;BR /&gt;&lt;BR /&gt;In this case you would use su user rather than su su - user. The sourced file must not contain an exit or return because it is actually part of the foreground process.&lt;BR /&gt;&lt;BR /&gt;In any event, it should never be necessary to do an su root in a package.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 23 Jul 2004 16:38:47 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2004-07-23T16:38:47Z</dc:date>
    <item>
      <title>Can i execute su command in pkg.cntl file cluster</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340095#M702093</link>
      <description>I need to execute: su - root -c script_name to turn on a aplication form pkg.cntl.&lt;BR /&gt;&lt;BR /&gt;Is possible to do su - root in pkg.cntl?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jul 2004 15:59:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340095#M702093</guid>
      <dc:creator>Jimmy_13</dc:creator>
      <dc:date>2004-07-23T15:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can i execute su command in pkg.cntl file cluster</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340096#M702094</link>
      <description>your serviceguard start/stop scripts already run with root id unless there is something really funky setup on your server. Hence you do not need to su - root anywhere in your script.&lt;BR /&gt;&lt;BR /&gt;if need be, you can do things like &lt;BR /&gt;&lt;BR /&gt;su - oracle -c script_name&lt;BR /&gt;&lt;BR /&gt;to inherit the environment variables of oracle and have the processes started have the oracle user ownership, but su - root, is something I have never heard of or seen.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jul 2004 16:12:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340096#M702094</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2004-07-23T16:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can i execute su command in pkg.cntl file cluster</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340097#M702095</link>
      <description>Sure you can do su - root inside the package control script.&lt;BR /&gt;&lt;BR /&gt;Under normal circumstances, as Mel has mentioned, you dont have to su - root and execute the binary since the script itself is executed with root privileges.&lt;BR /&gt;&lt;BR /&gt;But if the binary/script is dependent on some variable that is set by the root's .profile , then you can use su - root.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jul 2004 16:21:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340097#M702095</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-07-23T16:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can i execute su command in pkg.cntl file cluster</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340098#M702096</link>
      <description>Be very careful doing su - user commands in a non-interactive environment. Most default .profiles expect to be running with a TTY input device and commands like tset, tput, tabs ... can hang or fail. There are two approaches, 1) surround any commands in the .profile with&lt;BR /&gt;if [ -t 0 ]&lt;BR /&gt;then&lt;BR /&gt;  tset&lt;BR /&gt;  tabs&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;create a script file which sets and exports any needed variables and let both the .profile and any scripts source the file, e.g. myenv.sh using the "." (dot) command.&lt;BR /&gt;&lt;BR /&gt;. /usr/local/bin/myenv.sh&lt;BR /&gt;&lt;BR /&gt;In this case you would use su user rather than su su - user. The sourced file must not contain an exit or return because it is actually part of the foreground process.&lt;BR /&gt;&lt;BR /&gt;In any event, it should never be necessary to do an su root in a package.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jul 2004 16:38:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-execute-su-command-in-pkg-cntl-file-cluster/m-p/3340098#M702096</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-07-23T16:38:47Z</dc:date>
    </item>
  </channel>
</rss>

