<?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: Startup script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562604#M838262</link>
    <description>it is a really useful doc and i sometimes&lt;BR /&gt;need to look again and again...&lt;BR /&gt;Good Luck,</description>
    <pubDate>Tue, 14 Jun 2005 09:17:14 GMT</pubDate>
    <dc:creator>Cem Tugrul</dc:creator>
    <dc:date>2005-06-14T09:17:14Z</dc:date>
    <item>
      <title>Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562596#M838254</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I have created a script but wants to execute during booting of the hpux 11i.&lt;BR /&gt;Can anyone suggest how to achieve this on hpux 11i ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Sun, 12 Jun 2005 18:46:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562596#M838254</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-06-12T18:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562597#M838255</link>
      <description>startup script itself resides in /sbin/init.d&lt;BR /&gt;&lt;BR /&gt;It must contain a start section and a stop section. See /sbin/init.d/template for an example.&lt;BR /&gt;&lt;BR /&gt;To actually have it do something, for example start a server process at run level 3 and stop it at run level 2, this is an example with the ficticous service schmo&lt;BR /&gt;&lt;BR /&gt;cd /sbin/rc3.d&lt;BR /&gt;ln -s /sbin/init.d/schmo S990scho&lt;BR /&gt;&lt;BR /&gt;cd /sbin/rc2.d&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/schmo K110scho&lt;BR /&gt;&lt;BR /&gt;The K kills and the S starts.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;</description>
      <pubDate>Sun, 12 Jun 2005 19:22:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562597#M838255</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-06-12T19:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562598#M838256</link>
      <description>Hi Shiv,&lt;BR /&gt;&lt;BR /&gt;Create a script which accepts start and stop as option for starting and stopping&lt;BR /&gt;(e.g. #script start =&amp;gt;will start the script)&lt;BR /&gt;&lt;BR /&gt;Place this script in /sbin/init.d&lt;BR /&gt;&lt;BR /&gt;Decide in which run level you want to start the script and any service and daemon required for script (e.g. inetd )Create a link in the run level directory &lt;BR /&gt;#ln -s /sbin/init.d/script /sbin/rc3.d/SXXXscript&lt;BR /&gt;XXX -is number which decides the order for executig the script (asending order) and S indicates the script will be started.&lt;BR /&gt;&lt;BR /&gt;similarly for stopping use&lt;BR /&gt;#ln -s /sbin/init.d/script /sbin/rc2.d/KXXXscript&lt;BR /&gt;where XXX is again a no and K is to stop the script.&lt;BR /&gt;&lt;BR /&gt;Cheers!!!&lt;BR /&gt;eknath</description>
      <pubDate>Sun, 12 Jun 2005 20:54:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562598#M838256</guid>
      <dc:creator>Eknath</dc:creator>
      <dc:date>2005-06-12T20:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562599#M838257</link>
      <description>pls see my attached doc</description>
      <pubDate>Sun, 12 Jun 2005 20:57:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562599#M838257</guid>
      <dc:creator>Nguyen Anh Tien</dc:creator>
      <dc:date>2005-06-12T20:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562600#M838258</link>
      <description>Create your startupcsript based on /sbin/init.d/template. You can look at the other startu files for better understanding. &lt;BR /&gt;&lt;BR /&gt;Copy your script in /sbin/init.d directory. Change the permission accordingly (execute permission is must)&lt;BR /&gt;&lt;BR /&gt;Next is to decide at what runlevel the sscript should be executed. It depends on the nature of your scripts. If it depends on some subsystem to be up, then your script should be numbered in such a way as to exeute after that subsystem. Lets say the runlevel is N, that means the run level for stopping your script should be N-1. &lt;BR /&gt;&lt;BR /&gt;Next is to decide the script number, this again depends on the dependencies of your script. Your start script number should be higher than that of any dependency script. Lets say you decide on M, then the kill script number would be 1000-M. &lt;BR /&gt;&lt;BR /&gt;If you have configuration file, make sure to keep ti in /etc/rc.config.d/ directory. This will ensure that /sbin/rc source in your configuration before executing your script. &lt;BR /&gt;At the end the setup should look something like&lt;BR /&gt;&lt;BR /&gt;/sbin/init.d/script&lt;BR /&gt;&lt;BR /&gt;/sbin/rc{N}.d/S{M}script links to /sbin/init.d/script&lt;BR /&gt;&lt;BR /&gt;/sbin/rc{N-1}.d/K{1000-M}script links to /sbin/init.d/script&lt;BR /&gt;&lt;BR /&gt;You are done. &lt;BR /&gt;&lt;BR /&gt;-Amit</description>
      <pubDate>Mon, 13 Jun 2005 00:23:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562600#M838258</guid>
      <dc:creator>Amit Agarwal_1</dc:creator>
      <dc:date>2005-06-13T00:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562601#M838259</link>
      <description>Hi Shiva,&lt;BR /&gt;&lt;BR /&gt;      The elegant way of running the script is to decide in which run level you want to start and use the /sbin/init.d, /etc/rc.config.d and /sbin/rc*.d paths as others have &lt;BR /&gt;suggested.&lt;BR /&gt;&lt;BR /&gt;      The other way would be to place a line for you script &lt;BR /&gt;in /etc/inittab file.&lt;BR /&gt;&lt;BR /&gt;      Please consult the man page of inittab for further details.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Mon, 13 Jun 2005 03:19:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562601#M838259</guid>
      <dc:creator>Senthil Kumar .A_1</dc:creator>
      <dc:date>2005-06-13T03:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562602#M838260</link>
      <description>Hello Shiv,&lt;BR /&gt;&lt;BR /&gt;Please check the attachment.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Ganesha Sridhara</description>
      <pubDate>Mon, 13 Jun 2005 03:42:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562602#M838260</guid>
      <dc:creator>Ganesha Sridhara</dc:creator>
      <dc:date>2005-06-13T03:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562603#M838261</link>
      <description>hi shiv&lt;BR /&gt;&lt;BR /&gt;i will explain you in a 4 step process:&lt;BR /&gt;&lt;BR /&gt;Step 1:Decide run level&lt;BR /&gt;&lt;BR /&gt; a)whats started in run level2:&lt;BR /&gt;   ls /sbin/rc2.d/S*&lt;BR /&gt; b)whats started in run level3:&lt;BR /&gt;   ls /sbin/rc3.d/S*&lt;BR /&gt;  &lt;BR /&gt;  it will list all the start process in that run level for eg;&lt;BR /&gt; /sbin/rc3.d/S100nfs.server&lt;BR /&gt;&lt;BR /&gt;this file S100nfs.server is a link to /sbin/init.d/nfs.server&lt;BR /&gt;&lt;BR /&gt;The start and stop scripts are numbered in such a fashion that their sum is 1000 for eg:&lt;BR /&gt;&lt;BR /&gt;/sbin/rc3.d/S100nfs.server&lt;BR /&gt;/sbin/rc2.d/K900nfs.server&lt;BR /&gt;&lt;BR /&gt;Step 2: write startup and shutdown script&lt;BR /&gt;&lt;BR /&gt;you can use /sbin/init.d/template &lt;BR /&gt;copy this file as script name eg: web_server&lt;BR /&gt;and write a script&lt;BR /&gt;&lt;BR /&gt;sample script&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;#&lt;BR /&gt;# Copyright(C) 2001 VERITAS Software Corporation.  ALL RIGHTS RESERVED.&lt;BR /&gt;&lt;BR /&gt;PATH=/usr/sbin:/usr/bin:/sbin; export PATH&lt;BR /&gt;&lt;BR /&gt;mode=$1&lt;BR /&gt;case "$mode" in&lt;BR /&gt;    'start_msg')&lt;BR /&gt;        echo "Start WEB Server" &lt;BR /&gt;        exit 0&lt;BR /&gt;        ;;&lt;BR /&gt; &lt;BR /&gt;    'stop_msg')&lt;BR /&gt;        echo "Stop WEB Server"&lt;BR /&gt;        exit 0&lt;BR /&gt;        ;;&lt;BR /&gt;    'start')&lt;BR /&gt;        /bin/nohup /opt/HPweb/bin/web_server &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;        ;;&lt;BR /&gt;    'stop')&lt;BR /&gt;        /opt/HPweb/bin/web_server -k&lt;BR /&gt;        ;;&lt;BR /&gt;    *)&lt;BR /&gt;        echo "Usage: \$0 { start | stop }"&lt;BR /&gt;        exit 1&lt;BR /&gt;        ;;&lt;BR /&gt;esac&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Then create a config file /etc/rc.config.d/web_server to tell the above script where to find the daemon.and whether to start or stop ?&lt;BR /&gt;cat /etc/rc.config.d/web_server&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;# $Header: /kahlua_src/web/server/etc/webadmin 72.1 1999/09/16 03:51:04 lancer E&lt;BR /&gt;xp $ &lt;BR /&gt;# WebAdmin application server configuration.  &lt;BR /&gt;#&lt;BR /&gt;# WEB_SERVER:             Set to 1 to start the WebServer application server. &lt;BR /&gt;#&lt;BR /&gt;WEB_SERVER=1&lt;BR /&gt;&lt;BR /&gt;note: its always a better idea to turn the script to 0 rather than deleting or moving the script, if you dont want to run the script.&lt;BR /&gt;&lt;BR /&gt;Step 3: Create symbolic links&lt;BR /&gt;&lt;BR /&gt;This will cause the script to run at the right place in the boot and shutdown sequences.&lt;BR /&gt;start process:&lt;BR /&gt;ln -s /sbin/init.d/web_server /sbin/rc2.d/S900web_server&lt;BR /&gt;&lt;BR /&gt;kill process:&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/web_server /sbin/rc1.d/K100web_server&lt;BR /&gt;&lt;BR /&gt;(This script is for starting the web_server on run level 2 and stopping it on run level 1)&lt;BR /&gt;&lt;BR /&gt;Step 4: Test the script&lt;BR /&gt;&lt;BR /&gt;test the script on a test server . start and stop the daemon, run the script manually&lt;BR /&gt;by&lt;BR /&gt;&lt;BR /&gt;/sbin/init.d/web_server&lt;BR /&gt;&lt;BR /&gt;Reboot the server&lt;BR /&gt;&lt;BR /&gt;Hope I have given you the step by step procedure... if anything is missed out pls update me to correct myself...&lt;BR /&gt;&lt;BR /&gt;Regards and all the best&lt;BR /&gt;&lt;BR /&gt;Vinod&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Jun 2005 05:17:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562603#M838261</guid>
      <dc:creator>vinod_25</dc:creator>
      <dc:date>2005-06-13T05:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Startup script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562604#M838262</link>
      <description>it is a really useful doc and i sometimes&lt;BR /&gt;need to look again and again...&lt;BR /&gt;Good Luck,</description>
      <pubDate>Tue, 14 Jun 2005 09:17:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script/m-p/3562604#M838262</guid>
      <dc:creator>Cem Tugrul</dc:creator>
      <dc:date>2005-06-14T09:17:14Z</dc:date>
    </item>
  </channel>
</rss>

