Page 1 of 1

lfd not starting - pid mismatch or missing

Posted: 30 Aug 2015, 21:01
by ferdi2000
I ran an EasyApache re-compile of Apache and a CentOS Yum update and since I can't seem to get lfd to start...
I reinstalled CFS from scratch following the guidelines, but after lfd starts it stops straight away... I can see the following in the error logs...

Code: Select all

root@host [~]# tail -f /var/log/lfd.log
Aug 30 20:56:37 host lfd[22089]: Email Relay Tracking...
Aug 30 20:56:37 host lfd[22089]: System Statistics...
Aug 30 20:56:37 host lfd[22089]: Connection Tracking...
Aug 30 20:56:37 host lfd[22089]: Process Tracking...
Aug 30 20:56:37 host lfd[22089]: Account Tracking...
Aug 30 20:56:37 host lfd[22089]: SSH Tracking...
Aug 30 20:56:37 host lfd[22089]: SU Tracking...
Aug 30 20:56:37 host lfd[22089]: WHM Tracking...
Aug 30 20:56:37 host lfd[22089]: *Error* pid mismatch or missing, at line 844
Aug 30 20:56:37 host lfd[22089]: daemon stopped
I'm not sure what is causing this. If I manually start the lfd service, it stops with the above error too.

Running the tests came back fine:

Code: Select all

root@host [~]# perl /usr/local/csf/bin/csftest.pl
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing xt_connlimit...OK
Testing ipt_owner/xt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
Testing iptable_nat/ipt_DNAT...OK

RESULT: csf should function on this server
Can't work out what might be causing this and I haven't found any similar problems on these forums. (CENTOS 6.7 x86_64 kvm – host WHM 11.50.0 (build 30))

If I run csf -r I get a failure too:

Code: Select all

root@host [~]# csf -r
Flushing chain `INPUT'
Flushing chain `FORWARD'
Flushing chain `OUTPUT'
Flushing chain `PREROUTING'
Flushing chain `POSTROUTING'
Flushing chain `OUTPUT'
open3: exec of /sbin/ifconfig failed at /usr/sbin/csf line 2783.
After Flushing, I now see the following error in my lfd.log:

Code: Select all

Aug 30 22:10:40 host lfd[4790]: open3: exec of /sbin/ifconfig failed at /usr/sbin/lfd line 6316.

Aug 30 22:10:40 host lfd[4790]: daemon stopped
Aug 30 22:10:40 host lfd[4789]: daemon started on host.digitalflare.co.uk - csf v8.04 (cPanel)
Aug 30 22:10:40 host lfd[4789]: CSF Tracking...
Aug 30 22:10:40 host lfd[4789]: iptables appears to have been flushed - running *csf startup*...
Aug 30 22:10:41 host lfd[4789]: csf startup completed
Aug 30 22:10:41 host lfd[4789]: LOAD Tracking...
Aug 30 22:10:41 host lfd[4789]: Country Code Lookups...
Aug 30 22:10:41 host lfd[4789]: System Integrity Tracking...
Aug 30 22:10:41 host lfd[4802]: CCL: Retrieving GeoLite Country database [http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz]
Aug 30 22:10:41 host lfd[4789]: Exploit Tracking...
Aug 30 22:10:41 host lfd[4789]: Directory Watching...
Aug 30 22:10:41 host lfd[4789]: Email Queue Tracking...
Aug 30 22:10:41 host lfd[4789]: Email Relay Tracking...
Aug 30 22:10:41 host lfd[4789]: Temp to Perm Block Tracking...
Aug 30 22:10:41 host lfd[4789]: System Statistics...
Aug 30 22:10:41 host lfd[4789]: Process Tracking...
Aug 30 22:10:41 host lfd[4789]: Account Tracking...
Aug 30 22:10:41 host lfd[4789]: SSH Tracking...
Aug 30 22:10:41 host lfd[4789]: Webmin Tracking...
Aug 30 22:10:41 host lfd[4789]: SU Tracking...
Aug 30 22:10:41 host lfd[4789]: Console Tracking...
Aug 30 22:10:41 host lfd[4789]: WHM Tracking...
Aug 30 22:10:41 host lfd[4789]: *Error* pid mismatch or missing, at line 844
Aug 30 22:10:41 host lfd[4789]: daemon stopped
exec of /sbin/ifconfig failed - Must mean I do not have ifconfig installed... So as I found on this thread I ran "yum install net-tools" - But it said... Package net-tools-1.60-110.el6_2.x86_64 already installed and latest version ... So now I'm lost as to what to do? :P

Re: lfd not starting - pid mismatch or missing

Posted: 31 Aug 2015, 00:55
by ferdi2000
Aug 31 00:54:32 host lfd[29642]: open3: exec of /sbin/ifconfig failed at /usr/sbin/lfd line 6316.

Re: lfd not starting - pid mismatch or missing

Posted: 31 Aug 2015, 12:29
by ferdi2000
Well.. I managed to fix it, I noticied inside my /sbin/ folder I had both /sbin/ifconfig and /sbin/incfg/ - All I did was change the csf.conf file and set:

(line 2238 - csf.conf)
IFCONFIG = "/sbin/ifcfg"

(opposed to: IFCONFIG = "/sbin/ifconfig")

Weird my ifconfig file was 31,504 bytes - but the ifcfg was only 3,056 bytes

Worked fine after this! :)

Re: lfd not starting - pid mismatch or missing

Posted: 31 Aug 2015, 12:31
by ferdi2000
My working ifcfg contained the following code if anyone needs to create this file.

Code: Select all

#! /bin/bash

CheckForwarding () {
  local sbase fwd
  sbase=/proc/sys/net/ipv4/conf
  fwd=0
  if [ -d $sbase ]; then
    for dir in $sbase/*/forwarding; do
      fwd=$[$fwd + `cat $dir`]
    done
  else
    fwd=2
  fi
  return $fwd
}

RestartRDISC () {
  killall -HUP rdisc || rdisc -fs
}

ABCMaskLen () {
  local class;

  class=${1%%.*}
  if [ "$1" = "" -o $class -eq 0 -o $class -ge 224 ]; then return 0
  elif [ $class -ge 224 ]; then return 0
  elif [ $class -ge 192 ]; then return 24
  elif [ $class -ge 128 ]; then return 16
  else return 8; fi
}

label="label $1"
ldev="$1"
dev=${1%:*}
if [ "$dev" = "" -o "$1" = "help" ]; then
  echo "Usage: ifcfg DEV [[add|del [ADDR[/LEN]] [PEER] | stop]" 1>&2
  echo "       add - add new address" 1>&2
  echo "       del - delete address" 1>&2
  echo "       stop - completely disable IP" 1>&2
  exit 1
fi
shift

CheckForwarding
fwd=$?
if [ $fwd -ne 0 ]; then
  echo "Forwarding is ON or its state is unknown ($fwd). OK, No RDISC." 1>&2
fi


deleting=0
case "$1" in
add) shift ;;
stop)
  if [ "$ldev" != "$dev" ]; then
    echo "Cannot stop alias $ldev" 1>&2
    exit 1;
  fi
  ip -4 addr flush dev $dev $label || exit 1
  if [ $fwd -eq 0 ]; then RestartRDISC; fi
  exit 0 ;;
del*)
  deleting=1; shift ;;
*)
esac

ipaddr=
pfxlen=
if [ "$1" != "" ]; then
  ipaddr=${1%/*}
  if [ "$1" != "$ipaddr" ]; then
    pfxlen=${1#*/}
  fi
  if [ "$ipaddr" = "" ]; then
    echo "$1 is bad IP address." 1>&2
    exit 1
  fi
fi
shift

peer=$1
if [ "$peer" != "" ]; then
  if [ "$pfxlen" != "" -a "$pfxlen" != "32" ]; then
    echo "Peer address with non-trivial netmask." 1>&2
    exit 1
  fi
  pfx="$ipaddr peer $peer"
else
  if [ "$ipaddr" = "" ]; then
    echo "Missing IP address argument." 1>&2
    exit 1
  fi
  if [ "$pfxlen" = "" ]; then
    ABCMaskLen $ipaddr
    pfxlen=$?
  fi
  pfx="$ipaddr/$pfxlen"
fi

if [ "$ldev" = "$dev" -a "$ipaddr" != "" ]; then
  label=
fi

if [ $deleting -ne 0 ]; then
  ip addr del $pfx dev $dev $label || exit 1
  if [ $fwd -eq 0 ]; then RestartRDISC; fi
  exit 0
fi


if ! ip link set up dev $dev ; then
  echo "Error: cannot enable interface $dev." 1>&2
  exit 1
fi
if [ "$ipaddr" = "" ]; then exit 0; fi

if ! arping -q -c 2 -w 3 -D -I $dev $ipaddr ; then
  echo "Error: some host already uses address $ipaddr on $dev." 1>&2
  exit 1
fi

if ! ip address add $pfx brd + dev $dev $label; then
  echo "Error: failed to add $pfx on $dev." 1>&2
  exit 1
fi

arping -q -A -c 1 -I $dev $ipaddr
noarp=$?
( sleep 2 ;
  arping -q -U -c 1 -I $dev $ipaddr ) >& /dev/null </dev/null &

ip route add unreachable 224.0.0.0/24 >& /dev/null
ip route add unreachable 255.255.255.255 >& /dev/null
if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
  ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
fi

if [ $fwd -eq 0 ]; then
  if [ $noarp -eq 0 ]; then
    ip ro append default dev $dev metric 30000 scope global
  elif [ "$peer" != "" ]; then
    if ping -q -c 2 -w 4 $peer ; then
      ip ro append default via $peer dev $dev metric 30001
    fi
  fi
  RestartRDISC
fi

exit 0

Re: lfd not starting - pid mismatch or missing

Posted: 03 Sep 2015, 05:40
by patjec
Here the same error with a debian 8.1, directadmin instalation... See or your workarround works out for me. In my /sbin I see only the ifconfig file.


*****
Nope, didnt do anything