Added untested sysv init file and added warnings to README

This commit is contained in:
Scott Kitterman
2018-02-17 18:42:19 -05:00
parent 57a626d157
commit 162c115fa5
5 changed files with 148 additions and 4 deletions
+1 -1
View File
@@ -9,4 +9,4 @@
0.9.2 UNRELEASED 0.9.2 UNRELEASED
- Improved package requirements definition - Improved package requirements definition
- Added systemd unit file - Added systemd unit file and (untested) sysv init file
+6
View File
@@ -13,6 +13,12 @@ default is a feature:
python setup.py install --single-version-externally-managed --record=/dev/null python setup.py install --single-version-externally-managed --record=/dev/null
Both a systemd unit file and a sysv init file are provided. Both make
assumptions about defaults being used, e.g. if a non-standard pidfile name is
used, they will need to be updated. The sysv init file is Debian specific and
untested, since the developers are not using sysv init. Feedback/patches
welcome.
WARNING: This is an alpha grade release to support interoperability testing with WARNING: This is an alpha grade release to support interoperability testing with
Ed25519 signatures and basic functionality. It is known to be incomplete and Ed25519 signatures and basic functionality. It is known to be incomplete and
not suitable for general use. not suitable for general use.
+5 -2
View File
@@ -15,10 +15,13 @@ UMask implemented
UserID implemented verified UserID implemented verified
DKIM 'a' in AR implemented verified DKIM 'a' in AR implemented verified
0.9.2 (Alpha)
dkimpy-milter.service implemented verified
sysv init implemented
remove PidFile on stop implemented verified
0.9.5 (Beta) 0.9.5 (Beta)
dkimpy-milter.8 dkimpy-milter.8
dkimpy-milter.service
remove PidFile on stop
AuthservID AuthservID
Canonicalization Canonicalization
Diagnostics Diagnostics
+3 -1
View File
@@ -51,7 +51,9 @@ setup(
include_package_data=True, include_package_data=True,
data_files=[(os.path.join('share', 'man', 'man5'), data_files=[(os.path.join('share', 'man', 'man5'),
['man/dkimpy-milter.conf.5']), ('etc', ['etc/dkimpy-milter.conf']), ['man/dkimpy-milter.conf.5']), ('etc', ['etc/dkimpy-milter.conf']),
(os.path.join('/lib', 'systemd', 'system'), ['system/dkimpy-milter.service'])], (os.path.join('/lib', 'systemd', 'system'),
['system/dkimpy-milter.service']),(os.path.join('/etc', 'init.d'),
['system/dkimpy-milter.init'])],
install_requires = ['dkimpy>=0.7', 'pymilter', 'authres>=1.0.2', 'nacl'], install_requires = ['dkimpy>=0.7', 'pymilter', 'authres>=1.0.2', 'nacl'],
zip_safe = False, zip_safe = False,
+133
View File
@@ -0,0 +1,133 @@
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
#
### BEGIN INIT INFO
# Provides: dkim-milter dkim-milter-python dkimpy-milter
# Required-Start: $remote_fs $syslog $network $time
# Required-Stop: $remote_fs $syslog $network
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: dkimpy-milter
# Description: Python DKIM Milter for Sendmail and Postfix
### END INIT INFO
prefix="/usr"
exec_prefix=${prefix}
sysconfdir="/etc/dkimpy-milter"
bindir="${exec_prefix}/bin/"
RUNDIR="/var/run/dkimpy-milter"
DAEMON=${bindir}/dkimpy-milter
PATH=/sbin:/bin:/usr/sbin:/usr/bin:
NAME=dkimpy-milter
DESC="Python DKIM Milter"
USER=dkimpy-milter
GROUP=dkimpy-milter
SOCKET=$RUNDIR/dkimpy-milter.pid
test -x $DAEMON || exit 0
# Include dkimpy-python defaults if available
# Typically not used
if [ -f /etc/default/dkimpy-milter ] ; then
. /etc/default/dkimpy-milter
fi
set -e
. /lib/lsb/init-functions
case "$1" in
start)
echo -n "Starting $DESC: "
# Create the run directory if it doesn't exist
if [ ! -d $RUNDIR ]; then
install -o $USER -g $GROUP -m 755 -d $RUNDIR || return 2
fi
# Clean up stale sockets
if [ -f $RUNDIR/$NAME.pid ]; then
pid=`cat $RUNDIR/$NAME.pid`
if ! ps -C $DAEMON -s $pid >/dev/null; then
rm $RUNDIR/$NAME.pid
# UNIX sockets may be specified with or without the
# local: prefix; handle both
t=`echo $SOCKET | cut -d: -f1`
s=`echo $SOCKET | cut -d: -f2`
if [ -e $s -a -S $s ]; then
if [ "$t" = "$s" -o "$t" = "local" ]; then
rm $s
fi
fi
fi
fi
start-stop-daemon --start --chuid $USER --background --quiet --pidfile \
$RUNDIR/$NAME.pid --exec $DAEMON
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
if [ -f $RUNDIR/$NAME.pid ]; then
start-stop-daemon --stop --pidfile $RUNDIR/$NAME.pid
rm $RUNDIR/$NAME.pid
#echo $SOCKET
if [ -e $SOCKET ]; then
rm $SOCKET
fi
fi
echo "$NAME."
;;
force-reload)
echo -n "Force reloading $DESC: "
if [ -f $RUNDIR/$NAME.pid ]; then
start-stop-daemon --stop --pidfile $RUNDIR/$NAME.pid
rm $RUNDIR/$NAME.pid
#echo $SOCKET
if [ -e $SOCKET ]; then
rm $SOCKET
fi
fi
sleep 1
start-stop-daemon --start --chuid $USER --background --quiet --pidfile \
$RUNDIR/$NAME.pid --exec $DAEMON
echo "$NAME."
;;
restart)
echo "Restarting $DESC: "
echo -n "Stopping $DESC: "
if [ -f $RUNDIR/$NAME.pid ]; then
start-stop-daemon --stop --pidfile $RUNDIR/$NAME.pid
rm $RUNDIR/$NAME.pid
#echo $SOCKET
if [ -e $SOCKET ]; then
rm $SOCKET
fi
fi
echo "$NAME."
sleep 1
echo -n "Starting $DESC: "
start-stop-daemon --start --chuid $USER --background --quiet --pidfile \
$RUNDIR/$NAME.pid --exec $DAEMON
echo "$NAME."
;;
status)
status_of_proc -p /var/run/dkimpy-milter/dkimpy-milter.pid /usr/bin/dkimpy-milter dkimpy-milter
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|force-reload|restart|}" >&2
exit 1
;;
esac
exit 0