[ale] Starting a service

Ron Cordell roncordell at attbi.com
Thu Apr 25 17:43:41 EDT 2002


On Thursday 25 April 2002 04:09 pm, Joseph A Knapka wrote:
> Kevin O'Neill Stoll wrote:
> > What would be the most professional way to start a service on boot-up?
>
> <Slack-centric reply>
>
> Either invoke it directly from /etc/rc.d/rc.local, or else write a
> script to start your service and invoke that script from rc.local.
> The answer to this question will always be of the form "add commands to
> a startup script", but different distros organize their startup
> scripts differently, so my answer will not help you much if
> you're on a RedHat or Deb distro.
>
> </Slack-centric>
>
> Normally you want to (a) test that the service you're trying
> to invoke actually exists (including, for example, verifying
> the existence of any required configuration files), and
> (b) start it. So:
>
> echo "Starting local services..."
> if [ -f /etc/my_service.cfg && -f /usr/bin/my_service ] ; then
>   /usr/bin/my_service &
>   echo "Started my_service"
> fi
>

I might add here that I have done the same thing for Tomcat and JBoss servers 
on SuSE distros. What I have found that works for me is to copy the Apache 
startup script and hack it to my needs. The scripts on SuSE check a 
configuration variable to decide whether to start the service or not, then 
check for the existence of the service, and that dependent services have 
already been started, such as the network. I imagine that RedHat does 
something similar in most respects.

-ronc

-- 
  5:38pm  up 3 days, 38 min,  1 user,  load average: 0.03, 0.08, 0.04


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.






More information about the Ale mailing list