| Server IP : 172.67.206.42 / Your IP : 104.23.197.33 Web Server : Apache System : Linux server.localhost.com 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64 User : pahana ( 1029) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /etc/rc2.d/ |
Upload File : |
#! /bin/sh
# Greylist init script
# July 2004
# BERTRAND Joël
#
### BEGIN INIT INFO
# Provides: milter-greylist
# Required-Start: $local_fs $named $remote_fs $syslog
# Required-Stop: $local_fs $remote_fs
# Should-Start: sendmail
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Script to start/stop the greylist-milter
# Description: another spam-defense service
### END INIT INFO
. /lib/lsb/init-functions
# Based on skeleton by Miquel van Smoorenburg and Ian Murdock
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DAEMON=/usr/sbin/milter-greylist
NAME=greylist
SNAME=greylist
DESC="Greylist Mail Filter Daemon"
PIDFILE="/var/run/$NAME.pid"
PNAME="milter-greylist"
USER="greylist"
SOCKET=/var/run/milter-greylist/milter-greylist.sock
[ -x $DAEMON ] || DAEMON=/usr/bin/milter-greylist
[ -x $DAEMON ] || exit 0
export TMPDIR=/tmp
# Apparently people have trouble if this isn't explicitly set...
ENABLED=0
OPTIONS=""
NICE=
test -f /etc/default/milter-greylist && . /etc/default/milter-greylist
DOPTIONS="-P $PIDFILE -u $USER -p $SOCKET"
if [ "$ENABLED" = "0" ]; then
echo "$DESC: disabled, see /etc/default/milter-greylist"
exit 0
fi
if ! getent passwd | grep -q "^greylist:"; then
echo "$0: greylist user does not exist. Aborting" >&2
exit 1
fi
if ! getent group | grep -q "^greylist:" ; then
echo "$0: greylist group does not exist. Aborting" >&2
exit 1
fi
if [ ! -d /var/run/$PNAME ]; then
mkdir /var/run/$PNAME
chown greylist:greylist /var/run/$PNAME
chmod 755 /var/run/$PNAME
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
$NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME --oknodo
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME \
--retry 5 --oknodo
start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
$NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS
echo "$NAME."
;;
reload)
echo -n "Checking config: "
if su -c "$DAEMON -c" $USER 2>&1 |grep -v 'config .* okay$' |grep . >&2
then
echo "failed. Quitting with error, no action taken."
exit 1
else
echo "passed."
fi
echo -n "Restarting $DESC: "
start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME \
--retry 5 --oknodo
start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
$NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS
echo "$NAME."
;;
status)
PID=`pidof $DAEMON`
if [ x$PID = x ]; then
echo "$DAEMON is not running"
else
echo "$DESC is running with pid[$PID]"
fi
;;
*)
N=/etc/init.d/$SNAME
echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac
exit 0