<?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: shutdown &amp;amp; script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790122#M79477</link>
    <description>hello,&lt;BR /&gt;&lt;BR /&gt;Yes, place the script in /sbin/init.d, link it to the link files (start and Kill) in rc?.d (depend on run level). If you are looking for another configuration file through which you can pass arguments to this script, then place it in the /etc/rc.config.d/ directory. &lt;BR /&gt;If you are only looking for the shutdown time, then you only need a link file in the rc directory starting with K???script_name (kill script at shutdown time).&lt;BR /&gt;&lt;BR /&gt;HTH</description>
    <pubDate>Tue, 20 Aug 2002 17:56:49 GMT</pubDate>
    <dc:creator>Sajid_1</dc:creator>
    <dc:date>2002-08-20T17:56:49Z</dc:date>
    <item>
      <title>shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790117#M79472</link>
      <description>I have a shell script that trims and archives log files in /var/adm. If the system is rebooted or shutdown is there a way i can run my script at shutdown time?</description>
      <pubDate>Tue, 20 Aug 2002 17:37:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790117#M79472</guid>
      <dc:creator>Philip J. Priest_1</dc:creator>
      <dc:date>2002-08-20T17:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790118#M79473</link>
      <description>Better to do it at BOOT time, because usually you want your shutdown script to be quick! Of course we want our reboot to be fast also.&lt;BR /&gt;&lt;BR /&gt;Just put your script in /sbin/init.d&lt;BR /&gt;&lt;BR /&gt;then put an entry in (symbolic link) in /sbin/rc3.d &lt;BR /&gt;&lt;BR /&gt;Make sure your script's symbolic link is a HIGH S### number, like S992cleanup.rc.&lt;BR /&gt;&lt;BR /&gt;for shutdown look in rc1.d, and create a sym-link for a K### file name&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 20 Aug 2002 17:43:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790118#M79473</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-20T17:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790119#M79474</link>
      <description>Hi Philip:&lt;BR /&gt;&lt;BR /&gt;For information on the startup/shutdown mechanisms, see: &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/hpux/onlinedocs/os/startup.pdf" target="_blank"&gt;http://docs.hp.com/hpux/onlinedocs/os/startup.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This ia worth reading.  It describes the necessary, but simple, tasks you need to perform to create startup and shutdown scripts.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Aug 2002 17:45:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790119#M79474</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-08-20T17:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790120#M79475</link>
      <description>So i can have my shell script in /sbin/init.d ?  i dont have to do anything else other than link it in /sbin/rc3.d?</description>
      <pubDate>Tue, 20 Aug 2002 17:52:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790120#M79475</guid>
      <dc:creator>Philip J. Priest_1</dc:creator>
      <dc:date>2002-08-20T17:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790121#M79476</link>
      <description>Hi Phillip,&lt;BR /&gt;&lt;BR /&gt; You may want to consider creating an config file in /etc/rc.config.d to easily toggle this function on &amp;amp; off.&lt;BR /&gt;You'd source this file at the top of the start/stop script in /sbin/init.d&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 20 Aug 2002 17:56:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790121#M79476</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-08-20T17:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790122#M79477</link>
      <description>hello,&lt;BR /&gt;&lt;BR /&gt;Yes, place the script in /sbin/init.d, link it to the link files (start and Kill) in rc?.d (depend on run level). If you are looking for another configuration file through which you can pass arguments to this script, then place it in the /etc/rc.config.d/ directory. &lt;BR /&gt;If you are only looking for the shutdown time, then you only need a link file in the rc directory starting with K???script_name (kill script at shutdown time).&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Tue, 20 Aug 2002 17:56:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790122#M79477</guid>
      <dc:creator>Sajid_1</dc:creator>
      <dc:date>2002-08-20T17:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790123#M79478</link>
      <description>&amp;lt;&lt;SO i="" can="" have="" my="" shell="" script="" in=""&gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt; Yes, it's that simple.  In your case, since you want to excute it only at shutdown time (and not startup time), you need to link it to a "K" script in the /sbin/rc2.d  directory.&lt;BR /&gt;(Note: It will go in rc2.d  and NOT rc3.d, since the normal init default level is 3 and shutdown scripts will be always one level below the default).&lt;BR /&gt;Simply put; if your script is /sbin/init.d/Log_trim, then the link would be&lt;BR /&gt;/sbin/rc2.d/K1000log_trim .  (1000 is an example , it can be any unused number ).&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;raj&lt;/SO&gt;</description>
      <pubDate>Tue, 20 Aug 2002 18:10:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790123#M79478</guid>
      <dc:creator>Roger Baptiste</dc:creator>
      <dc:date>2002-08-20T18:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790124#M79479</link>
      <description>Raj you sure it goes into /sbin/rc2.d not /sbin/rc1.d? when you do a shutdown -ry now what syncer directory is run rc1 or rc2?</description>
      <pubDate>Tue, 20 Aug 2002 18:13:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790124#M79479</guid>
      <dc:creator>Philip J. Priest_1</dc:creator>
      <dc:date>2002-08-20T18:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790125#M79480</link>
      <description>Philip:&lt;BR /&gt;&lt;BR /&gt;The document I suggested you read will answer and clarify your questions.&lt;BR /&gt;&lt;BR /&gt;I???ll summarize the key points here. &lt;BR /&gt;&lt;BR /&gt;/usr/share/doc/start_up.txt &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/hpux/onlinedocs/os/startup.pdf" target="_blank"&gt;http://docs.hp.com/hpux/onlinedocs/os/startup.pdf&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;The file /sbin/init.d/template is a good starting place for making your own start/stop scripts. &lt;BR /&gt;&lt;BR /&gt;The /sbin/init.d directory contains all scripts used to startup and shutdown various subsystems. &lt;BR /&gt;&lt;BR /&gt;Each script under /sbin/init.d should perform BOTH the startup and shutdown functions. In order to control the functionality within the script, each must also support standard arguments and exit codes. Scripts must be written for the POSIX shell. A template script may be found in /sbin/init.d/template. &lt;BR /&gt;&lt;BR /&gt;There is no reason why the startup and shutdown script cannot start/kill multiple, but related processes. Remember to choose the appropriate rc&lt;N&gt;.d directory -- one (1) is for core services; two (2) is for multiuser run-state; three (3) is for networked, multi-user; and four (4) is for graphical interfaces. Depending on the processes you are starting, or stopping, you want to make sure prerequisite services exist. &lt;BR /&gt;&lt;BR /&gt;Each script in /sbin/init.d performs BOTH the startup and shutdown functions, and each will have two links pointing towards the script from /sbin/rc*.d: one for the start action and one for the stop action. &lt;BR /&gt;&lt;BR /&gt;Start scripts begin with "S"; Kill (stop) scripts begin with "K". The order of execution for kill scripts is the reverse of the startup ones. &lt;BR /&gt;&lt;BR /&gt;If a start script is placed in directory '/sbin/rc{X}.d' then its corresponding kill script is put in directory '/sbin/rc{X-1}.d' &lt;BR /&gt;&lt;BR /&gt;A general rule-of-thumb is that the sequence number of the start script plus the sequence number of the kill script should add to 1000. &lt;BR /&gt;&lt;BR /&gt;Subsystems should be killed in the opposite order they were started. This implies that kill scripts will generally not have the same numbers as their start script counterparts. If two subsystems must be started in a given order due to dependencies (e.g., S200sys1 followed by S300uses_sys1), the counterparts to these scripts must be numbered so that the subsystems are stopped in the opposite order in which they were started (e.g., K700uses_sys1 followed by K800sys1). The '1000' rule leads to this behavior. &lt;BR /&gt;&lt;BR /&gt;In general, user applications would be started at runlevel-3 (i.e. /sbin/rc3.d/) and killed in runlevel-2 (i.e. /sbin/rc2.d).&lt;BR /&gt;&lt;BR /&gt;Regards! &lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;/N&gt;</description>
      <pubDate>Tue, 20 Aug 2002 18:48:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790125#M79480</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-08-20T18:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790126#M79481</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt; You can run it under rc2.d  or rc1.d . It depends on what your script is trimming. For instance, if you are trimming syslog.log files, it would make sense to run it after syslogd daemon stops and that corresponds to &lt;BR /&gt;/sbin/rc1.d/K780syslogd, so your script would be having a lower K number than 780 and will be in rc1.d directory.    &lt;BR /&gt;&lt;BR /&gt;HTh&lt;BR /&gt;raj&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Aug 2002 18:54:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790126#M79481</guid>
      <dc:creator>Roger Baptiste</dc:creator>
      <dc:date>2002-08-20T18:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790127#M79482</link>
      <description>Hi (again) Philip:&lt;BR /&gt;&lt;BR /&gt;Rajman's choice of '/sbin/rc1.d/' for your kill script is very appropriate in this case for the reason he cited -- viz. that the 'syslogd' is killed at this level.  You want to execute your script *after* the 'syslogd' daemon terminates.  If 'syslogd' is killed at "K780" then an appropriate link for your script might be "K781".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Aug 2002 19:21:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790127#M79482</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-08-20T19:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790128#M79483</link>
      <description>ok now i got it  =)&lt;BR /&gt;but is /usr mounted at this point?  cos my script uses gzip.</description>
      <pubDate>Tue, 20 Aug 2002 19:35:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790128#M79483</guid>
      <dc:creator>Philip J. Priest_1</dc:creator>
      <dc:date>2002-08-20T19:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790129#M79484</link>
      <description>Hi Philip:&lt;BR /&gt;&lt;BR /&gt;'/usr' is still mounted at level-1.  If you look at '/sbin/rc0.d/' you will see the unmount of filesystems in '/sbin/init.d/localmount'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 20 Aug 2002 19:41:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790129#M79484</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-08-20T19:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790130#M79485</link>
      <description>Phillip,&lt;BR /&gt;&lt;BR /&gt;Perhaps you have already considered this, but why not just set up a simple cron job that runs the script morning, noon, or night?&lt;BR /&gt;&lt;BR /&gt;Just a thought.&lt;BR /&gt;&lt;BR /&gt;- Allan</description>
      <pubDate>Wed, 21 Aug 2002 01:19:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790130#M79485</guid>
      <dc:creator>Allan Pincus_1</dc:creator>
      <dc:date>2002-08-21T01:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: shutdown &amp; script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790131#M79486</link>
      <description>Allan i do have a cron thats running this once a month, what i need to have is what if the system is rebooted or brought down?  I still wanna archive my logs.</description>
      <pubDate>Wed, 21 Aug 2002 12:39:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shutdown-amp-script/m-p/2790131#M79486</guid>
      <dc:creator>Philip J. Priest_1</dc:creator>
      <dc:date>2002-08-21T12:39:23Z</dc:date>
    </item>
  </channel>
</rss>

