[ale] Starting a service

Joseph A Knapka jknapka at earthlink.net
Thu Apr 25 16:09:18 EDT 2002


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

HTH,

-- Joe
  Using open-source software: free.
  Pissing Bill Gates off: priceless.

---
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