<?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: rc scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870326#M278239</link>
    <description>subhashni -&lt;BR /&gt;To add to James' valid points -&lt;BR /&gt;If the startup you wish to add is using ftp, insure it starts behind any ftp rc startup scripts, else the service may not be available whe you want to start yours. [My apologies if this was overly obvious.]&lt;BR /&gt;I'm attaching a doc we have found useful in the past when writing new rc level startup scripts.&lt;BR /&gt;Note that it provides information on testing your script real time without having to perform a reboot, etc.&lt;BR /&gt;&lt;BR /&gt;Best of luck on this.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
    <pubDate>Wed, 27 Sep 2006 10:55:32 GMT</pubDate>
    <dc:creator>Dave La Mar</dc:creator>
    <dc:date>2006-09-27T10:55:32Z</dc:date>
    <item>
      <title>rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870322#M278235</link>
      <description>Hello,&lt;BR /&gt;How do i define environment (env) with in the script ,which is a startup script.&lt;BR /&gt;For some reason  ftp logins are all not working which is defined within the script.&lt;BR /&gt;.netrc files have been updated  appropriately.&lt;BR /&gt;I did get good responses when i posted the related topic though.Appreciate any suggestions.&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 26 Sep 2006 23:15:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870322#M278235</guid>
      <dc:creator>subhashni</dc:creator>
      <dc:date>2006-09-26T23:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870323#M278236</link>
      <description>I assume you mean rc unix startup script in&lt;BR /&gt;/sbin/init.d/&lt;BR /&gt;Then&lt;BR /&gt;You can use su - accountname -c script&lt;BR /&gt;and ensure this account has the appropriate env via its .profile and .kshrc&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Sep 2006 00:58:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870323#M278236</guid>
      <dc:creator>Frank de Vries</dc:creator>
      <dc:date>2006-09-27T00:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870324#M278237</link>
      <description>The FTP server is typically defined in the inetd.conf file and not normally part of the boot scripts unless things have been modified.&lt;BR /&gt;&lt;BR /&gt;Otherwise all environment paths and variables need to be definded in the startup script, via su to another user ( not for FTPD as it runs as root typically ).&lt;BR /&gt;&lt;BR /&gt;More info on how things are setup on your side will help.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Sep 2006 09:33:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870324#M278237</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2006-09-27T09:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870325#M278238</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Standard startup scripts run by '/sbin/rc' are going to be devoid of any environmental variables that your application needs.&lt;BR /&gt;&lt;BR /&gt;It's up to you to either declare variables you need in your customized startup script, or to source (read) a file containing them as your startup script begins executing.&lt;BR /&gt;&lt;BR /&gt;One cruder method to employ is to do an 'su - &lt;USER&gt; -c &amp;lt;script&amp;gt;' within your startup script.  This causes the &lt;USER&gt; profile to be sourced and &amp;lt;script&amp;gt; to be run.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/USER&gt;&lt;/USER&gt;</description>
      <pubDate>Wed, 27 Sep 2006 09:41:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870325#M278238</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-27T09:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870326#M278239</link>
      <description>subhashni -&lt;BR /&gt;To add to James' valid points -&lt;BR /&gt;If the startup you wish to add is using ftp, insure it starts behind any ftp rc startup scripts, else the service may not be available whe you want to start yours. [My apologies if this was overly obvious.]&lt;BR /&gt;I'm attaching a doc we have found useful in the past when writing new rc level startup scripts.&lt;BR /&gt;Note that it provides information on testing your script real time without having to perform a reboot, etc.&lt;BR /&gt;&lt;BR /&gt;Best of luck on this.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Wed, 27 Sep 2006 10:55:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870326#M278239</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2006-09-27T10:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870327#M278240</link>
      <description>Sorry, forgot the attachment.&lt;BR /&gt;Note that is says for version 10.X, but we used it for 11.0, etc.&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Wed, 27 Sep 2006 10:57:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870327#M278240</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2006-09-27T10:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870328#M278241</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;The document attached by Dave is a favorite of mine, since it quite clearly describes the entire paradigm.&lt;BR /&gt;&lt;BR /&gt;Despite the fact that the document was written for the 9x-10.0 transition of HP-UX, it continue to apply through all current releases (11.23).  About the only update is that a script exiting with a return value of '4' denotes one that started a background process.  The manpages for 'rc(1M') document this and provide an alternative, but parallel, document.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 27 Sep 2006 11:26:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870328#M278241</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-27T11:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870329#M278242</link>
      <description>Thanks so much for the responses.&lt;BR /&gt;What could be the right way or format to specify the .profile within the script.&lt;BR /&gt;Thanks again.</description>
      <pubDate>Wed, 27 Sep 2006 16:46:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870329#M278242</guid>
      <dc:creator>subhashni</dc:creator>
      <dc:date>2006-09-27T16:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870330#M278243</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; What could be the right way or format to specify the .profile within the script?&lt;BR /&gt;&lt;BR /&gt;As I noted before, you would do something like:&lt;BR /&gt;&lt;BR /&gt;# su - subhashni -c /home/subhasni/his_thing&lt;BR /&gt;&lt;BR /&gt;Assuming that the calling script was running as root, as a normal 'startup' script would be, this changes the user to 'subhasni', *runs* 'subhasni's '.profile' as a consequence of the 'su -' and then executes "/home/subhasni/his_thing".&lt;BR /&gt;&lt;BR /&gt;The principal problem with this approach is that the login '.profile' is generally constructed to be interactive.  Commands therein like 'stty' and 'tset' are meant to be executed when associated with a *terminal*.  Unless you conditionally exclude these commands with:&lt;BR /&gt;&lt;BR /&gt;# if [ -t 0 ]; then &lt;BR /&gt;&amp;gt; stty ...&lt;BR /&gt;&amp;gt; fi&lt;BR /&gt;&lt;BR /&gt;...then when your profile runs, you will see messages like "Not a typewritter".&lt;BR /&gt;&lt;BR /&gt;The alternative is *not* to allow the user's profile to be sourced *and* to include any or all environmental variables by sourcing (reading) a file containing them as part of your executed script.  Thus, you could do:&lt;BR /&gt;&lt;BR /&gt;# su subhashni -c /home/subhasni/his_thing&lt;BR /&gt;&lt;BR /&gt;...Notice the absence of the "-" after the 'su' in this form.  This means that "subhasni"'s profile is *not* read (sourced).  The assumption is probably that within the script '/home/subhasni/his_thing' is something like:&lt;BR /&gt;&lt;BR /&gt;# . /home/subhasni/env_vars&lt;BR /&gt;&lt;BR /&gt;Note that this is a dot character, followed by as space, followed by a script name.  This is "sourcing" or reading.  The 'env_vars' file might look like:&lt;BR /&gt;&lt;BR /&gt;PATH=${PATH}:/home/subhasni&lt;BR /&gt;HOME=/home/subhasni&lt;BR /&gt;DOING=mything&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Sep 2006 17:49:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870330#M278243</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-27T17:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: rc scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870331#M278244</link>
      <description>Thank You All.</description>
      <pubDate>Wed, 27 Sep 2006 23:31:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rc-scripts/m-p/3870331#M278244</guid>
      <dc:creator>subhashni</dc:creator>
      <dc:date>2006-09-27T23:31:14Z</dc:date>
    </item>
  </channel>
</rss>

