[pkg-dspam-commits] r61 - in trunk/debian: . patches
Matthijs Mohlmann
active2-guest at costa.debian.org
Mon Jan 2 12:14:44 UTC 2006
Author: active2-guest
Date: Mon Jan 2 12:14:43 2006
New Revision: 61
Added:
trunk/debian/patches/background-dspam.dpatch (contents, props changed)
trunk/debian/patches/default-server-pidfile.dpatch (contents, props changed)
Modified:
trunk/debian/changelog
trunk/debian/dspam.init
trunk/debian/patches/00list
Log:
* Added 2 patches to background dspam properly and provide a default pidfile.
* Updated init script so it doesn't fail at several points.
Modified: trunk/debian/changelog
==============================================================================
--- trunk/debian/changelog (original)
+++ trunk/debian/changelog Mon Jan 2 12:14:43 2006
@@ -8,9 +8,14 @@
* Fixed path in mysql.conf (mysqld/mysqld.sock instead of mysql/mysqld.sock)
* MySQL and PostgreSQL sql files needs to be a file not a directory with
files
- * Daemon is in usr/bin update initscript
+ * Daemon is in usr/bin (Closes: #345588)
+ * When starting as daemon and no pidfile was given the pidfile isn't
+ created. Added a patch that fixes this problem
+ * Added a patch to background dspam when issued with --daemon
+ * Updated init script to give a TERM on stop instead of a HUP which is
+ actually a reload of the configuration file.
- -- Debian DSPAM Maintainers <pkg-dspam-misc at lists.alioth.debian.org> Thu, 22 Dec 2005 00:52:49 +0100
+ -- Debian DSPAM Maintainers <pkg-dspam-misc at lists.alioth.debian.org> Mon, 2 Jan 2006 13:13:21 +0100
dspam (3.6.2-1) experimental; urgency=low
Modified: trunk/debian/dspam.init
==============================================================================
--- trunk/debian/dspam.init (original)
+++ trunk/debian/dspam.init Mon Jan 2 12:14:43 2006
@@ -14,8 +14,6 @@
# Based on the init script of pdns-recursor
#
-set -e
-
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="DSPAM Statistical anti-spam filter"
NAME=dspam
@@ -50,10 +48,10 @@
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occured
- start-stop-daemon --stop --quiet --retry=HUP/30/TERM/5/KILL/5 --pidfile $PIDFILE --name $NAME
+ start-stop-daemon --stop --quiet --retry=TERM/5/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
- start-stop-daemon --stop --quiet --oknodo --retry=HUP/30/KILL/5 --exec $DAEMON
+ start-stop-daemon --stop --quiet --oknodo --retry=KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
rm -f $PIDFILE
return "$RETVAL"
Modified: trunk/debian/patches/00list
==============================================================================
--- trunk/debian/patches/00list (original)
+++ trunk/debian/patches/00list Mon Jan 2 12:14:43 2006
@@ -10,3 +10,5 @@
add-config-dir.dpatch
ldap-verify-fix.dpatch
autogen-sh.dpatch
+default-server-pidfile.dpatch
+background-dspam.dpatch
Added: trunk/debian/patches/background-dspam.dpatch
==============================================================================
--- (empty file)
+++ trunk/debian/patches/background-dspam.dpatch Mon Jan 2 12:14:43 2006
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## background-dspam.dpatch by Matthijs Mohlmann <matthijs at cacholong.nl>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad dspam-3.6.2~/src/dspam.c dspam-3.6.2/src/dspam.c
+--- dspam-3.6.2~/src/dspam.c 2006-01-02 12:40:52.000000000 +0100
++++ dspam-3.6.2/src/dspam.c 2006-01-02 12:43:04.566063250 +0100
+@@ -3830,6 +3830,11 @@
+ DRIVER_CTX DTX;
+ char *pidfile;
+
++ /* Fork dspam into the background */
++ if (fork()) {
++ exit(EXIT_SUCCESS);
++ }
++
+ __daemon_run = 1;
+ __num_threads = 0;
+ __hup = 0;
Added: trunk/debian/patches/default-server-pidfile.dpatch
==============================================================================
--- (empty file)
+++ trunk/debian/patches/default-server-pidfile.dpatch Mon Jan 2 12:14:43 2006
@@ -0,0 +1,32 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## default-server-pidfile.dpatch by Matthijs Mohlmann <matthijs at cacholong.nl>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad dspam-3.6.2~/src/dspam.c dspam-3.6.2/src/dspam.c
+--- dspam-3.6.2~/src/dspam.c 2005-10-25 14:32:09.000000000 +0200
++++ dspam-3.6.2/src/dspam.c 2006-01-02 12:29:03.649509250 +0100
+@@ -3828,7 +3828,7 @@
+ #ifdef DAEMON
+ int daemon_start(AGENT_CTX *ATX) {
+ DRIVER_CTX DTX;
+- char *pidfile;
++ char *pidfile = "/var/run/dspam.pid";
+
+ __daemon_run = 1;
+ __num_threads = 0;
+@@ -3838,9 +3838,11 @@
+
+ LOG(LOG_INFO, INFO_DAEMON_START);
+
+- while(__daemon_run) {
++ if (_ds_read_attribute(agent_config, "ServerPID"))
+ pidfile = _ds_read_attribute(agent_config, "ServerPID");
+
++ while(__daemon_run) {
++
+ DTX.CTX = dspam_create (NULL, NULL,
+ _ds_read_attribute(agent_config, "Home"),
+ DSM_TOOLS, 0);
More information about the Pkg-dspam-commits
mailing list