Skip to content
Snippets Groups Projects
Select Git revision
  • 7eb6ee73be890ab91f6787d2b36b1fe25ed652d3
  • master default protected
  • hsh-2025012100
  • hsh-2024111900
  • hsh-2024072400
  • hsh-2024060300
  • hsh-2024012900
  • hsh-2023121100
  • hsh-v1.1.9
  • hsh-v1.1.7
10 results

maximalocal.mac.template

Blame
  • milter.rc7 1.28 KiB
    #!/bin/bash
    #
    # milter	This shell script takes care of starting and stopping milter.
    #
    # chkconfig: 2345 80 30
    # description: Milter is a process that filters messages sent through sendmail.
    # processname: milter
    # config: /etc/mail/pymilter.cfg
    # pidfile: /var/run/milter/milter.pid
    
    python="python2.3"
    
    pidof() {
    	set - ""
    	if set - `ps -e -o pid,wchan,cmd | grep "rt_sig ${python} bms.py"` &&
    	  [ "$3" != "grep" ]; then
    	  echo $1
    	  return 0
    	fi
    	return 1
    }
    
    # Source function library.
    . /etc/rc.d/init.d/functions
    
    [ -x /var/log/milter/start.sh ] || exit 0
    
    RETVAL=0
    prog="milter"
    
    start() {
    	# Start daemons.
    
    	echo -n "Starting $prog: "
    	daemon --check milter --user mail /var/log/milter/start.sh
    	RETVAL=$?
    	echo
    	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/milter
    	return $RETVAL
    }
    
    stop() {
    	# Stop daemons.
    	echo -n "Shutting down $prog: "
    	killproc milter
    	RETVAL=$?
    	echo
    	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/milter
    	return $RETVAL
    }
    
    # See how we were called.
    case "$1" in
      start)
    	start
    	;;
      stop)
    	stop
    	;;
      restart|reload)
    	stop
    	start
    	RETVAL=$?
    	;;
      condrestart)
    	if [ -f /var/lock/subsys/milter ]; then
    	    stop
    	    start
    	    RETVAL=$?
    	fi
    	;;
      status)
    	status milter
    	RETVAL=$?
    	;;
      *)
    	echo "Usage: $0 {start|stop|restart|condrestart|status}"
    	exit 1
    esac
    
    exit $RETVAL