tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: DYadav () docklands ! vic ! gov ! au
To: tru64-unix-managers
Subject: SUMMARY :: su  - <user > -c <command > permission problem.
Date: Fri, 21 Dec 2001 01:04:06 +0000	[thread overview]
Message-ID: <102653644221789.tru64-unix-managers.marc@archive.invalid> (raw)

This is a multipart message in MIME format.
--=_alternative 0005E6ACCA256B29_=
Content-Type: text/plain; charset="us-ascii"

thanks everyone .....I seams like I have to do some environment  setting 
manually. I'll try this after christmas ..thanks for the friends who 
replied. Here is one of the solution I got.. ( "Davis, Alan" <Davis@tessco.com)


The typical reason that su'd scripts fail is because they don't get 
the full environment of an interactive session.
 
Here's how I do it :
 
OENV=<path to user's env file>
APPUSER=<username of oracle acct>
FND_TOP=<path to top of binaries tree>
uSID=<oracle SID in uppercase>
/usr/bin/su - $APPUSER -c ". $OENV; \$FND_TOP/bin/start${uSID}mgr"
 
The important bit is the ". $OENV;" ahead of the command to execute. This 
sources (in ksh) the users home environment file, ensuring that the script 
gets the correct environment.

regards,

Dharmendra Yadav
---------------------------------------------------------------------------------
Oracle Database Administrator/Business Analyst
MELBOURNE DOCKLANDS AUTHORITY
Phone : +61 3 9628 4420  Mobile : +61 412 456 477


-----Original Message-----
From: DYadav@docklands.vic.gov.au [mailto:DYadav@docklands.vic.gov.au]
Sent: Thursday, December 20, 2001 6:05 PM
To: tru64-unix-managers@ornl.gov
Subject: su - <user > -c <command > permission problem.


>Hi wizkids,
>               I want to add a scripts for Oracle Application and 
Database 
>on system (Tru64 , 5.1) shutdown/startup. 
>These scripts works fine when I login to system as designated <oracle 
>application user > user with no error.
>But when I added    following line in script at /sbin/init.d/oraprod file 
 
>( this is my linked file for statup & shutdown ) 
>                     su - <oracle user>  -c  <script path>
>   they do not execute properly giving some permission error at certain 
>part of the script. 
--=_alternative 0005E6ACCA256B29_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">thanks everyone .....I seams like I have to do some environment &nbsp;setting manually. I'll try this after christmas ..thanks for the friends who replied. Here is one of the solution I got.. ( </font><font size=1 face="sans-serif"><b>&quot;Davis, Alan&quot; &lt;Davis@tessco.com</b></font><font size=2 face="sans-serif">)</font>
<br>
<br>
<br><font size=2 color=blue face="Courier New">The typical reason that su'd scripts fail is because they don't get </font>
<br><font size=2 color=blue face="Courier New">the full environment of an interactive session.</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 color=blue face="Courier New">Here's how I do it :</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 color=blue face="Courier New">OENV=&lt;path to user's env file&gt;</font>
<br><font size=2 color=blue face="Courier New">APPUSER=&lt;username of oracle acct&gt;</font>
<br><font size=2 color=blue face="Courier New">FND_TOP=&lt;path to top of binaries tree&gt;</font>
<br><font size=2 color=blue face="Courier New">uSID=&lt;oracle SID in uppercase&gt;</font>
<br><font size=2 color=blue face="Courier New">/usr/bin/su - $APPUSER -c &quot;. $OENV; \$FND_TOP/bin/start${uSID}mgr&quot;</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 color=blue face="Courier New">The important bit is the &quot;. $OENV;&quot; ahead of the command to execute. This sources (in ksh) the users home environment file, ensuring that the script gets the correct environment.</font>
<br>
<br><font size=2 face="sans-serif">regards,<br>
<br>
Dharmendra Yadav<br>
---------------------------------------------------------------------------------<br>
Oracle Database Administrator/Business Analyst<br>
MELBOURNE DOCKLANDS AUTHORITY<br>
Phone : +61 3 9628 4420 &nbsp;Mobile : +61 412 456 477</font>
<br>
<br>
<br><font size=2 face="Tahoma">-----Original Message-----<b><br>
From:</b> DYadav@docklands.vic.gov.au [mailto:DYadav@docklands.vic.gov.au]<b><br>
Sent:</b> Thursday, December 20, 2001 6:05 PM<b><br>
To:</b> tru64-unix-managers@ornl.gov<b><br>
Subject:</b> su - &lt;user &gt; -c &lt;command &gt; permission problem.<br>
</font>
<br><font size=2 face="Courier New"><br>
&gt;Hi wizkids,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I want to add a scripts for Oracle Application and Database <br>
&gt;on system (Tru64 , 5.1) shutdown/startup. <br>
&gt;These scripts works fine when I login to system as designated &lt;oracle <br>
&gt;application user &gt; user with no error.<br>
&gt;But when I added &nbsp; &nbsp;following line in script at /sbin/init.d/oraprod file &nbsp;<br>
&gt;( this is my linked file for statup &amp; shutdown ) <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; su - &lt;oracle user&gt; &nbsp;-c &nbsp;&lt;script path&gt;<br>
&gt; &nbsp; they do not execute properly giving some permission error at certain <br>
&gt;part of the script. </font>
--=_alternative 0005E6ACCA256B29_=--

                 reply	other threads:[~2001-12-21  1:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox