#!/bin/sh
# The daemons description
#
# GNU-GPL (c) Eko M. Budi, 2004
#         (c) Vector Linux, 2004

# return default run_level (2 - 5) and order for known daemons
service_order()
{
case $1 in
  pcmcia)
    echo 2345 11
    ;;
  hotplug|usb)
    echo 2345 12
    ;;
  kudzu)
    echo 2345 13;
    ;;
  alsasound|alsa)
    echo 2345 14
    ;;
  apm|apmd|acpid)
    echo 2345 18
    ;;
  network)
    echo 2345 20
    ;;
  umlnet|wlan|pppd)
    echo 2345 21
    ;;
  firewall*|portsentry)
    echo 2345 22
    ;;
  rpc)
    echo 2345 23
    ;;
  dhcpd)
    echo 2345 24
    ;;
  bind|named)
    echo 2345 25
    ;;
  syslog|log)
    echo 2345 30
    ;;
  quota)
    echo 2345 31
    ;;
  acc|accounting)
    echo 2345 32
    ;;
  ypbind)
    echo 2345 33
    ;;
  netfs)
    echo 2345 34
    ;;
  inet|xinet)
    echo 35 40
    ;;
  sshd|ssh|openssh)
    echo 35 41
    ;;
  nis|yp)
    echo 35 42
    ;;
  nfsd)
    echo 35 43
    ;;
  samba|smbd|nmbd)
    echo 35 44
    ;;
  database|mysql|postgress)
    echo 35 45
    ;;
  httpd|apache)
    echo 35 46
    ;;
  ftpd|proftp|proftpd)
    echo 35 47
    ;;
  smptd|sendmail|postfix|qmail)
    echo 35 48
    ;;
  lampp|xampp)
    echo 35 49
    ;;
  xfstt)
    echo 35 59
    ;;
  printer|lpd|cups)
    echo 2345 62
    ;;
  cron)
    echo 2345 80
    ;;
  at)
    echo 2345 81
    ;;
  gpm)
    echo 2345 82
    ;;
  *) # find_next_order()
    ii=99
    while [ $ii -gt 50 ]; do
	if [ -f $1/S${ii}* ]; then
	    let ii=$ii+1
	    break
	fi
	let ii=$ii-1
    done
    echo 2345 $ii
    ;;
  esac
}

# return daemon description
service_desc()
{
case $1 in
alsa|alsasound)
  echo "Advanced Linux Sound system"
  ;;
syslog|log) 
  echo "system and kernel loggers"
  ;;
at)
  echo "exact time tasks scheduler"
  ;;
cron)
  echo "periodic tasks scheduler"
  ;;
portmap)
  echo "network portmap, needed by NIS and NFS." 
  ;;
gpm)
  echo "console mouse daemon"
  ;;
lp|lpd)
  echo "classic Linux printing system"
  ;;
inet|xinet)
  echo "internet service super server"
  ;;
dhcp|dhcpd)
  echo "DHCP server"
  ;;
cups)
  echo "Common Unix Printer Service"
  ;;
ssh|sshd) 
  echo "The secure shell daemon for allowing remote console"
  ;;
lampp) 
  echo "Combo Apache+MySQL+PHP+Postfix"
  ;;
portsentry)  
  echo "Protect network ports from outside attack"
  ;;
xfstt)
  echo "TrueType font server for X. Not needed for XFree 4."
  ;;
apache|http|httpd)
  echo "HTTP web server"
  ;;
mysql|postgresql)
  echo "SQL database server"
  ;;
nisd|nis|ypserv|yp)
  echo "Provides Network Information Services"
  ;; 
yp|ypbind)
  echo "Client for Network Information Service"
  ;;
netfs)
  echo "Mount remote NFS/SAMBA directories"
  ;; 
nfs|nfsd)
  echo "Network File Server"
  ;;
postfix|qmail|sendmail)
  echo "mail server daemon"
  ;;
squid)
  echo "HTTP/FTP proxy server"
  ;;
dnsmasq)
  echo "Light DNS and DHCP server"
  ;;
named|bind)
  echo "BIND Domain Name Server"
  ;;
quota)
  echo "Limit disk usage for users"
  ;;
network)
  echo "Initialize TCP/IP networking"
  ;;
firewall)
  echo "Filter and masquerade TCP/IP Networking"
  ;;
*)
  echo "$1 daemon"
esac
}
