pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/38507: [PATCH] mail/fetchmail - add 'awaken' command
>Number: 38507
>Category: pkg
>Synopsis: Add 'awaken' command to mail/fetchmail (patch included)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Apr 25 15:00:00 +0000 2008
>Originator: Michael-John Turner <mj%mjturner.net@localhost>
>Release: NetBSD 4.0_STABLE
>Organization:
>Environment:
System: NetBSD aurora.pimp.org.za 4.0_STABLE NetBSD 4.0_STABLE (AURORA_40) #0:
Wed Mar 5 23:08:03 GMT 2008
root%aurora.pimp.org.za@localhost:/usr/obj/sys/compile/AURORA_40 sparc64
Architecture: sparc64
Machine: sparc64
>Description:
I've attached a patch that adds an 'awaken' command to the pkgsrc fetchmail
init script. The command sends a SIGUSR1 to a daemonised fetchmail, causing
it to poll the configured servers. I find it quite useful and it would be
great if you'd consider applying the patch.
>How-To-Repeat:
N/A
>Fix:
Patch below
--- /usr/pkgsrc/current/mail/fetchmail/files/fetchmail.sh 2004-08-01
05:54:56.000000000 +0100
+++ fetchmail.sh 2007-08-16 19:40:53.000000000 +0100
@@ -14,9 +14,21 @@
command="@PREFIX@/bin/${name}"
pidfile="/var/run/${name}.pid"
required_files="@PKG_SYSCONFDIR@/${name}.conf"
-extra_commands="reload"
+extra_commands="awaken reload"
command_args="-f - < @PKG_SYSCONFDIR@/${name}.conf"
+awaken_cmd="start_poll"
+
+start_poll ()
+{
+ DAEMON_PID=`sed 1q ${pidfile}`
+ @ECHO@ -n "Awakening ${name} daemon"
+ if [ ${DAEMON_PID} -ne 0 ]; then
+ kill -SIGUSR1 ${DAEMON_PID} >/dev/null 2>&1;
+ fi
+ @ECHO@ '.'
+}
+
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index