#!/bin/sh
# if a new syslogd comes around, edit this file and  
# the 3 copies of setupsyslog.c in the test source
detect_logd() {
  if [ -f "/var/run/syslogd.pid" ];then
    LOGD="syslogd"	
  elif [ -f "/var/run/rsyslogd.pid" ];then
    LOGD="rsyslogd"	
  elif [ -f "/var/run/syslog-ng.pid" ];then
    LOGD="syslog-ng"	
  else
    LOGD="unknown"	
  fi
  # one lst try - may be no pid file if we killed the daemon
  if [ "$LOGD" = "unknown" ];then
    if [ -f "/opt/lsb/test/core/syslogd/var/run/syslogd.options" ];then
      LOGD=`awk '{print $1}' /opt/lsb/test/core/syslogd/var/run/syslogd.options` 
    fi
  else
    PID=`cat /var/run/$LOGD.pid`
    NEWPID=`pidof -s $LOGD`
  fi
}

