diff --git a/debian/clamav-daemon.init.in b/debian/clamav-daemon.init.in
index 91e7855..61f2b9b 100644
--- a/debian/clamav-daemon.init.in
+++ b/debian/clamav-daemon.init.in
@@ -71,12 +71,14 @@ THEPIDFILE="`grep ^PidFile $CLAMAVCONF | awk '{print $2}'`"
 make_dir $(dirname "$THEPIDFILE")
 chown $User $(dirname "$THEPIDFILE")
 
-if [ -f "$THEPIDFILE" ]; then
-  CLAMDPID=`pidofproc -p $THEPIDFILE $DAEMON`
-  RUNNING=$?
-else
-  CLAMDPID=`pidofproc $DAEMON`
-  RUNNING=$?
+# Checking if the daemon is in the process list
+CLAMDPID=`ps aux | grep $DAEMON | awk '{print $2}' | head -1`
+$SUPERVISOR --status --exec $DAEMON
+RUNNING=$?
+
+# If the isn't in the process list, so he's definitively not running and $PiD can be unset
+if [ $RUNNING -ne 0 ]; then
+	CLAMPID=1 
 fi
 
 if [ -z "$RUN_SUPERVISED" ]; then
diff --git a/debian/clamav-freshclam.init.in b/debian/clamav-freshclam.init.in
index 2895b2d..8829ae8 100644
--- a/debian/clamav-freshclam.init.in
+++ b/debian/clamav-freshclam.init.in
@@ -34,14 +34,18 @@ slurp_config "$FRESHCLAM_CONF_FILE"
 make_dir "$DataBaseDirectory"
 make_dir $(dirname "$PidFile")
 
-if [ -f "$PIDFILE" ]; then
-  PID=`pidofproc -p $PIDFILE $DAEMON`
-  RUNNING=$?
-else
-  PID=`pidofproc $DAEMON`
-  RUNNING=$?
+# Checking if the daemon is in the process list
+CLAMDPID=`ps aux | grep $DAEMON | awk '{print $2}' | head -1`
+$SUPERVISOR --status --exec $DAEMON
+RUNNING=$?
+
+# If the isn't in the process list, so he's definitively not running and $PiD can be unset
+if [ $RUNNING -ne 0 ]; then
+	CLAMPID=1 
 fi
 
+[ "$PID" = '1' ] && unset PID
+
 handle_iface()
 {
   OPTIND=1
@@ -99,7 +103,7 @@ case "$1" in
     log_end_msg 255
     exit 0
   fi
-  start-stop-daemon --start  --pidfile $SUPERVISORPIDFILE -o -c "$DatabaseOwner" --exec $DAEMON -- -d --quiet
+  start-stop-daemon --start  --pidfile $PIDFILE -o -c "$DatabaseOwner" --exec $DAEMON -- -d --quiet
   log_end_msg $?
   ;;
   stop)
@@ -126,7 +130,7 @@ case "$1" in
       done
     fi
   else
-    killproc -p $PIDFILE $DAEMON
+    start-stop-daemon --stop  --pidfile $PIDFILE -o -c "$DatabaseOwner" --exec $DAEMON -- -d --quiet
     ret=$?
   fi
   log_end_msg $ret
diff --git a/debian/common_functions b/debian/common_functions
index d37eeef..538ecee 100644
--- a/debian/common_functions
+++ b/debian/common_functions
@@ -17,7 +17,7 @@ status_of_proc () {
     name="$2"
 
     status="0"
-    pidofproc $pidfile $daemon >/dev/null || status="$?"
+    $SUPERVISOR --status --exec $daemon || status="$?"
     if [ "$status" = 0 ]; then
         log_success_msg "$name is running"
         return 0
