<?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: killproc in .profile in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220380#M170232</link>
    <description>Mike,&lt;BR /&gt;&lt;BR /&gt;Yep makes sense. You don't want that in their .profile especially if they have high system rights. You don't know what they might do when they login or someone su's to their account. If they don't play ball make it root owned and read only for them. That'll stop them!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
    <pubDate>Tue, 16 Mar 2004 13:23:26 GMT</pubDate>
    <dc:creator>David Burgess</dc:creator>
    <dc:date>2004-03-16T13:23:26Z</dc:date>
    <item>
      <title>killproc in .profile</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220375#M170227</link>
      <description>A user has installed the killproc function, which is in most startup scripts, copied verbatim in their ~/.profile.  This doesn't seem to be the wisest think in the world to do,  My question is, is it acceptable to put shell script code directly into ~/.profile?  -mk</description>
      <pubDate>Tue, 16 Mar 2004 12:48:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220375#M170227</guid>
      <dc:creator>Mike Kuhar</dc:creator>
      <dc:date>2004-03-16T12:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: killproc in .profile</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220376#M170228</link>
      <description>Mike,&lt;BR /&gt;&lt;BR /&gt;.profile and profile are scripts. You could run a script from the users .profile using &lt;BR /&gt;&lt;BR /&gt;sh &amp;lt;scriptname&amp;gt;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;exec &amp;lt;scriptname&amp;gt;&lt;BR /&gt;&lt;BR /&gt;exec will overwrite the parent pid thus logging out the user when the script completes. I've had users .profiles run apps using exec and then log them out when they exit the app to stop them getting a shell.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Tue, 16 Mar 2004 13:02:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220376#M170228</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2004-03-16T13:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: killproc in .profile</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220377#M170229</link>
      <description>I'm not asking whether I can call a script from .profile.  I'm asking whether it is good practice to put inline shell code in .profile, such as:&lt;BR /&gt;&lt;BR /&gt;killproc() {&lt;BR /&gt;  pid=`ps -e | awk '$NF~/'"$1"'/ {print $1}'`&lt;BR /&gt;  if [ "X$pid" != "X"]; then&lt;BR /&gt;    if kill "$pid"; then&lt;BR /&gt;      echo "$1 stopped"&lt;BR /&gt;    else&lt;BR /&gt;      rval=1&lt;BR /&gt;      echo "Unable to stop $1"&lt;BR /&gt;    fi&lt;BR /&gt;  fi&lt;BR /&gt;}</description>
      <pubDate>Tue, 16 Mar 2004 13:11:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220377#M170229</guid>
      <dc:creator>Mike Kuhar</dc:creator>
      <dc:date>2004-03-16T13:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: killproc in .profile</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220378#M170230</link>
      <description>Shell code in the .profile is ok. I can't see why you would want to kill $1 from the .profile as you don't pass parameters to it.&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Tue, 16 Mar 2004 13:17:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220378#M170230</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2004-03-16T13:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: killproc in .profile</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220379#M170231</link>
      <description>Thanks for the reply, again, Dave.  I think that this is my point.  Before I tell the user to get it out of his .profile, I just want to make sure I have all facts.</description>
      <pubDate>Tue, 16 Mar 2004 13:20:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220379#M170231</guid>
      <dc:creator>Mike Kuhar</dc:creator>
      <dc:date>2004-03-16T13:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: killproc in .profile</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220380#M170232</link>
      <description>Mike,&lt;BR /&gt;&lt;BR /&gt;Yep makes sense. You don't want that in their .profile especially if they have high system rights. You don't know what they might do when they login or someone su's to their account. If they don't play ball make it root owned and read only for them. That'll stop them!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Tue, 16 Mar 2004 13:23:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220380#M170232</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2004-03-16T13:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: killproc in .profile</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220381#M170233</link>
      <description>Without knowing more, it's not possible to answer. Note that in this instance killproc is a function so unless the function is actually invoked, it does nothing. The preferred method for using code like this is to include it in the foreground process via the "." command.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Mar 2004 13:40:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/killproc-in-profile/m-p/3220381#M170233</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-03-16T13:40:33Z</dc:date>
    </item>
  </channel>
</rss>

