<?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: Run a command as another user??? please help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836193#M272467</link>
    <description>The general syntax is su - userid -c "command"&lt;BR /&gt;&lt;BR /&gt;or in this case su - oraweb -c "owsctl stop"&lt;BR /&gt;&lt;BR /&gt;consider making the series of commands a script and calling the script via the su command.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 02 Aug 2006 13:53:34 GMT</pubDate>
    <dc:creator>DCE</dc:creator>
    <dc:date>2006-08-02T13:53:34Z</dc:date>
    <item>
      <title>Run a command as another user??? please help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836189#M272463</link>
      <description>Hi im tryng to make a script but in the process i have to change use "su - oraweb"&lt;BR /&gt;but when i switch user the script stop unless i type exit to go back in root mode&lt;BR /&gt;&lt;BR /&gt;All i want is to run that sort of script but the script stop after the su - oraweb goes in... won't do anything unless i do exit manualy&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;su - oraweb&lt;BR /&gt;owsctl stop&lt;BR /&gt;owsctl stop -nodemgr&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;kill -9 `pgrep oraweb`&lt;BR /&gt;&lt;BR /&gt;su - oraweb&lt;BR /&gt;owsctl start -nodemgr &amp;amp;&lt;BR /&gt;owsctl start&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any help is apreciated thanks alot &lt;BR /&gt;&lt;BR /&gt;-mIKE</description>
      <pubDate>Wed, 02 Aug 2006 13:46:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836189#M272463</guid>
      <dc:creator>Michel Martineau</dc:creator>
      <dc:date>2006-08-02T13:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Run a command as another user??? please help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836190#M272464</link>
      <description>su - oraweb "owsctl stop;owsctl stop -nodemgr"&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Aug 2006 13:48:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836190#M272464</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2006-08-02T13:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Run a command as another user??? please help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836191#M272465</link>
      <description>shalom,&lt;BR /&gt;&lt;BR /&gt;su - oracle -c "command"&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 02 Aug 2006 13:51:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836191#M272465</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-08-02T13:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Run a command as another user??? please help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836192#M272466</link>
      <description>Hi Mike,&lt;BR /&gt;&lt;BR /&gt;If you really must run this script as different user instead of as oraweb, then I would recommended saving:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;owsctl stop&lt;BR /&gt;owsctl stop -nodemgr&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;and:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;owsctl start -nodemgr &amp;amp;&lt;BR /&gt;owsctl start&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;as scripts, say /scripts/a.sh and /scripts/b.sh.&lt;BR /&gt;&lt;BR /&gt;You may then run these scripts like this:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;su - oraweb -c "/scripts/a.sh"&lt;BR /&gt;kill -9 `pgrep oraweb`&lt;BR /&gt;su - oraweb -c "/scripts/b.sh"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Wed, 02 Aug 2006 13:53:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836192#M272466</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-08-02T13:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Run a command as another user??? please help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836193#M272467</link>
      <description>The general syntax is su - userid -c "command"&lt;BR /&gt;&lt;BR /&gt;or in this case su - oraweb -c "owsctl stop"&lt;BR /&gt;&lt;BR /&gt;consider making the series of commands a script and calling the script via the su command.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Aug 2006 13:53:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836193#M272467</guid>
      <dc:creator>DCE</dc:creator>
      <dc:date>2006-08-02T13:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Run a command as another user??? please help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836194#M272468</link>
      <description>... and I would beat someone over the head with a baseball bat for using a kill -9 routinely.&lt;BR /&gt;&lt;BR /&gt;kill -9 `pgrep oraweb`&lt;BR /&gt;&lt;BR /&gt;The correct procedure is to kill -15 ${PID}, kill -1 ${PID}, kill -2 ${PID}, kill -3 ${PID}, kill -11 ${PID}, and finally and only if necessary, kill -9 ${PID} ---- in that order and doing a kill -0 ${PID} between each command and then testing the result; if 0, the process still exists. Doing a kill -9 can leave temporary files, shared memory, and other resources dangling because no cleanup is possible.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also, pgrep is not a standard command so you may need to craft a substitute.</description>
      <pubDate>Wed, 02 Aug 2006 13:58:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836194#M272468</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-02T13:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Run a command as another user??? please help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836195#M272469</link>
      <description>Wow thanks alot for all the help.. ill work on my script today and test it!!!   Very apreciated :P Thanks</description>
      <pubDate>Thu, 03 Aug 2006 07:16:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836195#M272469</guid>
      <dc:creator>Michel Martineau</dc:creator>
      <dc:date>2006-08-03T07:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Run a command as another user??? please help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836196#M272470</link>
      <description>create the script and run it using sudo &lt;BR /&gt;&lt;BR /&gt;sudo -u username command &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Aug 2006 11:26:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-a-command-as-another-user-please-help/m-p/3836196#M272470</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2006-08-03T11:26:21Z</dc:date>
    </item>
  </channel>
</rss>

