[imapfilter-devel] Question about the daemon mode

Michal Kolodziejczyk miko at wp.pl
Fri Jan 7 10:20:21 EET 2011


On 06.01.2011 06:33, Jens wrote:
> Hi,
> 
> that did not work :-(. killall need /proc and i get "proc is empty".

Try this:
kill -9 `pidof imapfilter`
or (if you don't have pidof):
kill -9 `ps axu|grep imapfilter|awk ' { print $2 }' `

BTW, I do have admin rights, so I do /etc/init.d/imapfilter restart.
Nothing stops you to use similar script even if you don't have admin
rights (just write is as ~/imapfilter and chmod u+rx):

#!/bin/sh
ARGS="-c /path/to/imapconfigfile -l /path/to/imaplogfile"

case "$1" in
  start)
    /path/to/imapfilter $ARGS &
    ;;
  stop)
    PIDS=`pidof imapfilter`
    if [ "x-$PIDS" = "x-" ] ; then
      echo "Have not found any running processes!"
      exit 1
    else
      kill -9 `pidof imapfilter`
    fi
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|reload}"
   esac
exit 0

Regards,
	miko


More information about the Imapfilter-devel mailing list