I put script file path in inittab file to start script...........and it works.... <br><br><div class="gmail_quote">On Wed, Jun 30, 2010 at 8:12 PM, Christopher L. Barnard <span dir="ltr"><<a href="mailto:cbarnard@rush.edu">cbarnard@rush.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Put it in /etc/rc2.d.<br>
<br>
Or put "startDMS" in /etc/init.d and then create the symlink<br>
in /etc/rc2.d that points S97startDMS -> ../init.d/startDMS.<br>
<font color="#888888"><br>
--<br>
</font><div class="im">Christopher L. Barnard<br>
---------------------------------------------------------------------<br>
Comment your code as though the maintainer will be a homicidal maniac<br>
who knows where you live.<br>
<br>
<br>
</div><div><div></div><div class="h5">On Wed, 2010-06-30 at 18:54 +0530, Pravin Uttam Kharat wrote:<br>
> HI,<br>
><br>
><br>
><br>
> I couldn't understand in this procedure.<br>
> I have a created a script in vi S97startDMS. This contains following<br>
> line<br>
> /opt/DMS/ctlscript.sh start<br>
> Now  where to put this script to run at start up.<br>
><br>
><br>
> Thanks<br>
><br>
><br>
><br>
><br>
> On Tue, Jun 29, 2010 at 8:48 PM, Bill Watson <<a href="mailto:bill@magicdigits.com">bill@magicdigits.com</a>><br>
> wrote:<br>
>         On Tue, 2010-06-29 at 10:44 +1000, Cameron Simpson wrote:<br>
>         > On 28Jun2010 10:16, Christopher L. Barnard<br>
>         <<a href="mailto:cbarnard@rush.edu">cbarnard@rush.edu</a>> wrote:<br>
>         > | On Mon, 2010-06-28 at 15:08 +0530, Pravin Uttam Kharat<br>
>         wrote:<br>
>         > | > I have RHEL 5 I installed Bitnami Joomla on it.I want to<br>
>         configure a<br>
>         > | > startup script which run that script when RHEL 5 Machine<br>
>         start and<br>
>         > | > automatically shut down machine on mentioned time.<br>
>         Please suggest any<br>
>         > | > tool for this......<br>
>         > |<br>
>         > | [ Excellent description of the SnnFOO script scheme... ]<br>
>         > | You can put it all in one script, and that is much easier<br>
>         for other<br>
>         > | individuals to understand what you are doing.  For<br>
>         'start', the script<br>
>         > | is called with the command line parameter of "start".<br>
>         Likewise 'stop'<br>
>         > | is called with the command line parameter of "stop".  So<br>
>         just switch on<br>
>         > | the command line parameter and you can put the script<br>
>         in /etc/init.d<br>
>         > | with a symlink to /etc/rc2.d/S****** and<br>
>         to /etc/rc0.d/K******<br>
>         ><br>
>         > And for your second requirement, have the "start" script use<br>
>         the "at"<br>
>         > command to schedule a run of the "stop" script at a suitable<br>
>         time.<br>
><br>
>         Only if you want the script to be alive for a finite time.  If<br>
>         the need<br>
>         is for the app to start gracefully on system startup and stop<br>
>         gracefully<br>
>         on system shutdown, then 'at' should definitely not be used.<br>
>          If it<br>
>         should run for oh, say, the first 17 hours after powerup, then<br>
>         yes the<br>
>         at command should be used.<br>
><br>
>         --<br>
>         Christopher L. Barnard<br>
>         ---------------------------------------------------------------------<br>
>         Comment your code as though the maintainer will be a homicidal<br>
>         maniac<br>
>         who knows where you live.<br>
><br>
><br>
>         ************** I had to leave this tag line - it's too good!<br>
>         The source stated to start with the machine start and end at<br>
>         "on mentioned<br>
>         time". If the mentioned time is other than the machine shut<br>
>         down time, then<br>
>         a crontab entry calling the "K50scriptname stop" would do<br>
>         well.<br>
><br>
>         Also it seems that the "RedHat" way to do rc#.d these days is<br>
>         to place the<br>
>         file without Snn or Knn into /etc/init.d with the following<br>
>         lines at the<br>
>         top:<br>
>         #!/bin/bash<br>
>         #<br>
>         # chkconfig: - 91 35<br>
>         # description: stuff this script does comment here<br>
><br>
>         The 91 is the starting sequence within rc2.d (S91) and the 35<br>
>         is the<br>
>         stopping sequence in rc0.d (K35) and the 91 and 35 are<br>
>         adjustable to your<br>
>         needs as long as they are 2 digits each.<br>
><br>
>         Then<br>
>         chkconfig --add scriptname<br>
>         chkconfig scriptname on<br>
><br>
>         ^^^^ The above is from memory and to be taken with a grain of<br>
>         salt, lemon,<br>
>         and tequila. Hope this helps.<br>
>         Bill Watson<br>
>         <a href="mailto:bill@magicdigits.com">bill@magicdigits.com</a><br>
><br>
><br>
><br>
>         _______________________________________________<br>
>         rhn-users mailing list<br>
>         <a href="mailto:rhn-users@redhat.com">rhn-users@redhat.com</a><br>
>         <a href="https://www.redhat.com/mailman/listinfo/rhn-users" target="_blank">https://www.redhat.com/mailman/listinfo/rhn-users</a><br>
><br>
><br>
> _______________________________________________<br>
> rhn-users mailing list<br>
> <a href="mailto:rhn-users@redhat.com">rhn-users@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/rhn-users" target="_blank">https://www.redhat.com/mailman/listinfo/rhn-users</a><br>
<br>
_______________________________________________<br>
rhn-users mailing list<br>
<a href="mailto:rhn-users@redhat.com">rhn-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/rhn-users" target="_blank">https://www.redhat.com/mailman/listinfo/rhn-users</a><br>
</div></div></blockquote></div><br>