Sisyphus repository
Last update: 16 november 2019 | SRPMs: 17520 | Visits: 15768606
en ru br
ALT Linux repos
S:1.6.8-alt1
5.0: 1.6.7-alt1
4.1: 1.6.7-alt1
4.0: 1.6.7-alt1
3.0: 1.6.1-alt1

Group :: System/Servers
RPM: sqlgrey

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
#
# sqlgrey: Init script for sqlgrey postfix policy service
#
# adopted for ALTLinux init by LAKostis <lakostis at altlinux.ru>
#
# chkconfig: 345 90 10
# description: SQLgrey is a postfix grey-listing policy service.
# processname: sqlgrey
# config: /etc/sqlgrey/sqlgrey.conf
# pidfile: /var/run/sqlgrey.pid

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

PIDFILE=/var/run/sqlgrey.pid
LOCKFILE=/var/lock/subsys/sqlgrey
WORKDIR=/var/lib/sqlgrey
RETVAL=0

start()
{
cd "$WORKDIR" && \
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user sqlgrey -- sqlgrey -d
RETVAL=$?
return $RETVAL
}

stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user sqlgrey --name sqlgrey -- sqlgrey -k
RETVAL=$?
return $RETVAL
}

restart()
{
stop
sleep 1 # hack: missing REUSEADDR from Net::Server?
start
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user sqlgrey --name sqlgrey -- sqlgrey
RETVAL=$?
;;
reloaddb)
kill -SIGUSR1 `cat $PIDFILE`
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status|reloaddb}"
RETVAL=1
esac

exit $RETVAL
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin