<?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: question abt system command and exec command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508815#M843887</link>
    <description>Does the startup script do only variable siignment?? Then in the script itself, check if varibale is set or not and if not then set it.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
    <pubDate>Mon, 21 Mar 2005 14:48:47 GMT</pubDate>
    <dc:creator>RAC_1</dc:creator>
    <dc:date>2005-03-21T14:48:47Z</dc:date>
    <item>
      <title>question abt system command and exec command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508814#M843886</link>
      <description>Hi Everyone,&lt;BR /&gt;&lt;BR /&gt;exec command kicking two copies of script file .startup during initial login. Here is the setup of my login in the /etc/passwd file.&lt;BR /&gt;&lt;BR /&gt;============================================================&lt;BR /&gt;userid:*:59190:501:rp*C,RP,XX,xXX:/home/user:/home/user/prog1&lt;BR /&gt;===========================================================&lt;BR /&gt;prog1 looks like following.&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;     execlp("./.startup",getlogin(), 0);&lt;BR /&gt;}&lt;BR /&gt;===============================================&lt;BR /&gt;/home/userid/.startup looks like following&lt;BR /&gt;settting some of the environments variables and  kicking off prog2 binary.&lt;BR /&gt;/home/userid/prog2&lt;BR /&gt;==============================================&lt;BR /&gt;prog2 looks like following:&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;  system("/home/userid/prog3");&lt;BR /&gt;}&lt;BR /&gt;==============================================&lt;BR /&gt;&lt;BR /&gt;The problem is prog2 is kicking off another copy of .startup file from prog1. I know system command is kickin off execl command. Is there any other c or system funciton i can use in prog2 so that it does not kick the .startup script again. Any answer would be appreciated. Thanks.&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Mar 2005 14:33:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508814#M843886</guid>
      <dc:creator>yonjon</dc:creator>
      <dc:date>2005-03-21T14:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: question abt system command and exec command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508815#M843887</link>
      <description>Does the startup script do only variable siignment?? Then in the script itself, check if varibale is set or not and if not then set it.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Mon, 21 Mar 2005 14:48:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508815#M843887</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-03-21T14:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: question abt system command and exec command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508816#M843888</link>
      <description>Anil,&lt;BR /&gt;&lt;BR /&gt;Due to some constraints, I need to do all this within the C program. Thanks.&lt;BR /&gt;&lt;BR /&gt;Biren</description>
      <pubDate>Mon, 21 Mar 2005 14:54:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508816#M843888</guid>
      <dc:creator>yonjon</dc:creator>
      <dc:date>2005-03-21T14:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: question abt system command and exec command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508817#M843889</link>
      <description>May be I don't understand the problem you are&lt;BR /&gt;trying to solve, but it looks like you are making it &lt;BR /&gt;more complicated that it is. For ex:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; /home/userid/.startup looks like following&lt;BR /&gt;&amp;gt; settting some of the environments variables and &lt;BR /&gt;&amp;gt; kicking off prog2 binary.&lt;BR /&gt;&amp;gt; /home/userid/prog2&lt;BR /&gt;&amp;gt; &lt;BR /&gt;&amp;gt;prog2 looks like following:&lt;BR /&gt;&amp;gt;main()&lt;BR /&gt;&amp;gt; {&lt;BR /&gt;&amp;gt;system("/home/userid/prog3");&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;&lt;BR /&gt;1) Since prog2 just forks a shell and executes &lt;BR /&gt;prog3, why can't you change .startup to call prog3 &lt;BR /&gt;instead of prog2 ?&lt;BR /&gt;&lt;BR /&gt;2) Even better than #1 is, why can't you decide&lt;BR /&gt;what the value of env variables in prog1.c itself and &lt;BR /&gt;call system() or exec() to run prog3 with these env &lt;BR /&gt;variables. That way, all your code with be one C &lt;BR /&gt;program.&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Mar 2005 15:12:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508817#M843889</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-03-21T15:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: question abt system command and exec command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508818#M843890</link>
      <description>sorry for confusion. &lt;BR /&gt;&lt;BR /&gt;Ok prog2 needs to be root with sticky bit for setgid command to run successful. I can not give prog1 root ownership coz of security violation. That is why i am calling prog3 from prog2. Thanks.&lt;BR /&gt;&lt;BR /&gt;Biren</description>
      <pubDate>Mon, 21 Mar 2005 15:38:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-system-command-and-exec-command/m-p/3508818#M843890</guid>
      <dc:creator>yonjon</dc:creator>
      <dc:date>2005-03-21T15:38:48Z</dc:date>
    </item>
  </channel>
</rss>

