<div>HI,<br></div><div><br></div><div>I couldn't understand in this procedure.</div><div>I have a created a script in vi S97startDMS. This contains following line</div><div>/opt/DMS/ctlscript.sh start</div><div>Now  where to put this script to run at start up.</div>
<div><br></div><div>Thanks</div><div><br></div><div> </div><br><div class="gmail_quote">On Tue, Jun 29, 2010 at 8:48 PM, Bill Watson <span dir="ltr"><<a href="mailto:bill@magicdigits.com">bill@magicdigits.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">On Tue, 2010-06-29 at 10:44 +1000, Cameron Simpson wrote:<br>
> On 28Jun2010 10:16, Christopher L. Barnard <<a href="mailto:cbarnard@rush.edu">cbarnard@rush.edu</a>> wrote:<br>
> | On Mon, 2010-06-28 at 15:08 +0530, Pravin Uttam Kharat wrote:<br>
> | > I have RHEL 5 I installed Bitnami Joomla on it.I want to configure a<br>
> | > startup script which run that script when RHEL 5 Machine start and<br>
> | > automatically shut down machine on mentioned time. 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 for other<br>
> | individuals to understand what you are doing.  For 'start', the script<br>
> | is called with the command line parameter of "start".   Likewise 'stop'<br>
> | is called with the command line parameter of "stop".  So just switch on<br>
> | the command line parameter and you can put the script in /etc/init.d<br>
> | with a symlink to /etc/rc2.d/S****** and to /etc/rc0.d/K******<br>
><br>
> And for your second requirement, have the "start" script use the "at"<br>
> command to schedule a run of the "stop" script at a suitable time.<br>
<br>
Only if you want the script to be alive for a finite time.  If the need<br>
is for the app to start gracefully on system startup and stop gracefully<br>
on system shutdown, then 'at' should definitely not be used.  If it<br>
should run for oh, say, the first 17 hours after powerup, then 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 maniac<br>
who knows where you live.<br>
<br>
</div></div>************** I had to leave this tag line - it's too good!<br>
The source stated to start with the machine start and end at "on mentioned<br>
time". If the mentioned time is other than the machine shut down time, then<br>
a crontab entry calling the "K50scriptname stop" would do well.<br>
<br>
Also it seems that the "RedHat" way to do rc#.d these days is to place the<br>
file without Snn or Knn into /etc/init.d with the following 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 is the<br>
stopping sequence in rc0.d (K35) and the 91 and 35 are 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 salt, lemon,<br>
and tequila. Hope this helps.<br>
<font color="#888888">Bill Watson<br>
<a href="mailto:bill@magicdigits.com">bill@magicdigits.com</a><br>
</font><div><div class="h5"><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>
</div></div></blockquote></div><br>