<?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 Some clarification in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814400#M85159</link>
    <description>Maybe I'm being lazy and maybe I am unaware of the security repercussions, but I figured if I can run someone else's profile from the command line then it should be no different syntax-wise in my shell script, and I can just paste that into the beginning of the script. I am running a shell script which runs Oracle SQLPlus but needs that .profile of the other user *before* I can get to the SQLPlus portion. I want to enable this script to run in cron under root, and I've seen where I can add this (oracle) user to the cron.allow file to cron it as that user, but I really wanted to have the cron run under root while just invoking the .profile to pick up the (oracle) environment parameters SQLPlus needs.</description>
    <pubDate>Thu, 26 Sep 2002 19:40:50 GMT</pubDate>
    <dc:creator>Chris Elmore</dc:creator>
    <dc:date>2002-09-26T19:40:50Z</dc:date>
    <item>
      <title>Some clarification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814400#M85159</link>
      <description>Maybe I'm being lazy and maybe I am unaware of the security repercussions, but I figured if I can run someone else's profile from the command line then it should be no different syntax-wise in my shell script, and I can just paste that into the beginning of the script. I am running a shell script which runs Oracle SQLPlus but needs that .profile of the other user *before* I can get to the SQLPlus portion. I want to enable this script to run in cron under root, and I've seen where I can add this (oracle) user to the cron.allow file to cron it as that user, but I really wanted to have the cron run under root while just invoking the .profile to pick up the (oracle) environment parameters SQLPlus needs.</description>
      <pubDate>Thu, 26 Sep 2002 19:40:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814400#M85159</guid>
      <dc:creator>Chris Elmore</dc:creator>
      <dc:date>2002-09-26T19:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Some clarification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814401#M85160</link>
      <description>Hi Chris,&lt;BR /&gt;&lt;BR /&gt;You might want to post your reply back under your original question so we can follow the discussion under that thread.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Sep 2002 19:48:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814401#M85160</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2002-09-26T19:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Some clarification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814402#M85161</link>
      <description>Hi (again) Chris:&lt;BR /&gt;&lt;BR /&gt;Sourcing a profile to gain environmental variables is a poor choice.  The profile is designed, by default, to run in an environment where 'stdin' is a terminal.  When a profile is sourced in a crontask the usual result is a cascade of "not a typewriter" messages.&lt;BR /&gt;&lt;BR /&gt;It is far better to place the environmental variables you may need (e.g. for an Oracle environment) in a separate file from the profile and to source the standalone file when needed.  Indeed, you can even source the standalone file *within* your profile.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Sep 2002 19:48:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814402#M85161</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-09-26T19:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Some clarification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814403#M85162</link>
      <description>In this case what you can do is call your script from within cron then in your script you can source that users profile by doing&lt;BR /&gt;&lt;BR /&gt;". /&lt;HOMEDIR&gt;/&lt;USERNAME&gt;/.profile"&lt;BR /&gt;&lt;BR /&gt;or you can execute your command in your script by doing&lt;BR /&gt;&lt;BR /&gt;"su - &lt;USERNAME&gt; -c &lt;COMMAND&gt;"&lt;BR /&gt;&lt;BR /&gt;by using the "-" after the su it will execute the command using that users profile. To make it secure set the permissions of your script to 500 and put it where only root can get to it.&lt;BR /&gt;&lt;BR /&gt;hope this helps&lt;BR /&gt;&lt;BR /&gt;Ray&lt;/COMMAND&gt;&lt;/USERNAME&gt;&lt;/USERNAME&gt;&lt;/HOMEDIR&gt;</description>
      <pubDate>Thu, 26 Sep 2002 19:49:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814403#M85162</guid>
      <dc:creator>Ray Brewer</dc:creator>
      <dc:date>2002-09-26T19:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Some clarification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814404#M85163</link>
      <description>Chris,&lt;BR /&gt;&lt;BR /&gt;We have a lot of Oracle databases and we stop and start them as root, but we like to use the 'su - oracle -d /oracle/do_some_script' method.  First, the script is owned and maintained by the Oracle DBAs, so they can change their environment and the script as they need to and they don't have to bother us (as long as the script runs).  Also, the script (and the .profile) don't run as root, so an evil user can't put in some code to give themselves root access.  From a sys admin standpoint, it is easier for me.  If the script blows up and doesn't work, I just go to the DBAs and say, "Hey, fix your script!"  :)&lt;BR /&gt;&lt;BR /&gt;This method just follows the school of thinking that the less you do as root, the better off and safer you will be.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Sep 2002 20:02:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814404#M85163</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2002-09-26T20:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Some clarification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814405#M85164</link>
      <description>Oops. In my last post, I meant to say:&lt;BR /&gt;&lt;BR /&gt;'su - oracle -c /oracle/some_script'&lt;BR /&gt;&lt;BR /&gt;The -d was a typo, and it probably does something bad and ugly to the su command.  &lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Sep 2002 20:06:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814405#M85164</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2002-09-26T20:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Some clarification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814406#M85165</link>
      <description>I accidentally posted this as a new post when I intended to reply to my earlier post regarding this problem (My mouse finger zigged when I wanted to zag). My thanks to everyone who took the time to assist me and my apologies for the accidental post. The excellent replies I received helped me fix my problem. I intend to credit fully everyone who so generously helped me. Thanks again.</description>
      <pubDate>Thu, 26 Sep 2002 20:39:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814406#M85165</guid>
      <dc:creator>Chris Elmore</dc:creator>
      <dc:date>2002-09-26T20:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Some clarification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814407#M85166</link>
      <description>...and this is the post to which he refers:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x09e0a848deccd61190050090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x09e0a848deccd61190050090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 26 Sep 2002 20:48:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/some-clarification/m-p/2814407#M85166</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-09-26T20:48:32Z</dc:date>
    </item>
  </channel>
</rss>

