aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-04-27 16:50:16 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-04-27 16:50:16 +0300
commit3ababf4edb89be0b164d8e9cb1cad5b009de9778 (patch)
tree9e70971c38ff9b402b02708bbce5a9f9fdeccef3
parent9dff021e31a300dcd5eda941d9e4992a6a8e465a (diff)
downloadwydawca-3ababf4edb89be0b164d8e9cb1cad5b009de9778.tar.gz
wydawca-3ababf4edb89be0b164d8e9cb1cad5b009de9778.tar.bz2
Replace the "finish" event with "statistics".
-rw-r--r--NEWS8
-rw-r--r--doc/wydawca.texi23
-rw-r--r--etc/wydawca.conf8
-rw-r--r--include/wydawca/wydawca.h2
-rw-r--r--modules/logstat/mod_logstat.c2
-rw-r--r--modules/mailutils/mod_mailutils.c2
-rw-r--r--src/config.c3
-rw-r--r--src/spool.c4
-rw-r--r--src/timer.c2
-rw-r--r--src/wydawca.h2
10 files changed, 35 insertions, 21 deletions
diff --git a/NEWS b/NEWS
index 01c8091..ebe721e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
-Wydawca NEWS -- history of user-visible changes. 2020-04-26
+Wydawca NEWS -- history of user-visible changes. 2020-04-27
See the end of file for copying conditions.
Please send Wydawca bug reports to <bug-wydawca@gnu.org.ua>.
Version 3.1.95 (git)
@@ -72,12 +72,18 @@ notification connections. Default is 16.
** idle-timeout statement
This new statement configures the maximum idle timeout of an
upload notification connection. Default is 10 seconds.
+** stat-report-interval statement
+
+** The "statistics" event.
+
+New event "statistics" replaces the legacy "finish" event.
+
** spool timers
References to particular spool timers in expansion strings have the
form
${timer:spool:TAG:TM}
diff --git a/doc/wydawca.texi b/doc/wydawca.texi
index 7eac388..349d9ba 100644
--- a/doc/wydawca.texi
+++ b/doc/wydawca.texi
@@ -2540,16 +2540,23 @@ uploader.
@kwindex check-failure
@item check-failure
Distribution verification failed. @xref{verification}, for a
detailed description.
@kwindex finish
-@item finish
- This event is reported at the end of the wydawca job, when all
-spools have been processed. It is normally used to produce final
-statistic reports. @xref{statreports}, for an example.
+@kwindex statistics
+@item statistics
+ This event produces statistics about the recent jobs performed
+by @command{wydawca}. In daemon mode, it is scheduled periodically
+as controlled by @code{stat-report-interval} statement. In cron mode
+it is emitted when all spools have been processed.
+
+For compatibility with @command{wydawca} versions prior to 3.1.95, the
+event name @samp{finish} can be used instead of @samp{statistics}.
+
+@xref{statreports}, for an example.
See also @ref{mod_logstat}.
@end table
@end deffn
@deffn {notify-event} module @var{modname}
Identify the module responsible for the notification. The
@@ -2791,13 +2798,13 @@ mail-statistics @{
To arrange for sending the reports, the configuration must contain the
following statement:
@smallexample
notify-event @{
- event finish;
+ event statistrics;
module mailutils;
@}
@end smallexample
@end deffn
@deffn {mail-statistics} message text-or-id
@@ -3198,13 +3205,13 @@ module-init mailutils @{
Wydawca
EOT;
@}
@}
notify-event @{
- event finish;
+ event statistics;
module mailutils;
@}
notify-event @{
event success;
module mailutils;
@@ -3244,23 +3251,23 @@ The simplest configuration for this module is:
@smallexample
@group
module logstat mod_logstat.so;
notify-event @{
- event finish;
+ event statistics;
module logstat;
@}
@end group
@end smallexample
This will produce on the default logging channel the detailed
statistics, as discussed in @ref{statistics}.
There is no specific @code{module-init} statements. The module should
-be called from @code{notify-event} block on the @samp{finish} event.
+be called from @code{notify-event} block on the @samp{statistics} event.
The module's @code{module-config} statement can contain the following
statements:
@deffn {mod_logstat config} statistics list
Configures what statistics items should be included in the output.
@xref{statistics}, for a detailed discussion of @var{list}.
diff --git a/etc/wydawca.conf b/etc/wydawca.conf
index bd87c2b..552dd27 100644
--- a/etc/wydawca.conf
+++ b/etc/wydawca.conf
@@ -90,16 +90,16 @@ module-init mailutils {
from-address "wydawca@localhost";
# See `info wydawca statreports'.
mail-statistics {
statistics all;
message <<EOT
-Subject: Wydawca stats
+Subject: Wydawca statistics
-This is to notify you that the run of wydawca on ${date}
-caused the following results:
+Please find below the statistics summary of the tasks performed
+by the daemon:
errors ............................. ${stat:errors}
warning ............................ ${stat:warnings}
bad signatures ..................... ${stat:bad_signatures}
access violation attempts .......... ${stat:access_violations}
complete triplets .................. ${stat:complete_triplets}
@@ -303,13 +303,13 @@ Wydawca
The Project Submission Robot
EOT;
}
}
notify-event {
- event finish;
+ event statistics;
module mailutils;
}
/* Make sure the distributed tarball does not contain security vulnerabilities
* CVE-2012-3386 and CVE-2009-4029. Reject it, if it does.
* See `info wydawca verification', for a description of check-script.
diff --git a/include/wydawca/wydawca.h b/include/wydawca/wydawca.h
index 23e6445..e2cc110 100644
--- a/include/wydawca/wydawca.h
+++ b/include/wydawca/wydawca.h
@@ -51,13 +51,13 @@ void wy_dbg(char const *fmt, ...) WY_PRINTFLIKE(1, 2);
enum wy_event {
wy_ev_success,
wy_ev_bad_ownership,
wy_ev_bad_directive_signature,
wy_ev_bad_detached_signature,
wy_ev_check_fail,
- wy_ev_finish,
+ wy_ev_stat,
WY_N_EVENT
};
const char *wy_event_str(enum wy_event evt);
enum wydawca_stat {
diff --git a/modules/logstat/mod_logstat.c b/modules/logstat/mod_logstat.c
index a0ece89..c918cdc 100644
--- a/modules/logstat/mod_logstat.c
+++ b/modules/logstat/mod_logstat.c
@@ -83,13 +83,13 @@ static char *default_log_message[] = {
void
wy_notify(void *data, int ev, wy_triplet_t const *trp)
{
struct grecs_list_entry *ep;
char *text;
- if (ev != wy_ev_finish || !wy_stat_mask_p(stat_mask))
+ if (ev != wy_ev_stat || !wy_stat_mask_p(stat_mask))
return;
if (log_msg) {
for (ep = log_msg->head; ep; ep = ep->next) {
text = wy_expand_stats(ep->data);
logmsg(text);
diff --git a/modules/mailutils/mod_mailutils.c b/modules/mailutils/mod_mailutils.c
index 759fa14..2ca231d 100644
--- a/modules/mailutils/mod_mailutils.c
+++ b/modules/mailutils/mod_mailutils.c
@@ -816,13 +816,13 @@ void
wy_notify(void *data, int ev, wy_triplet_t *trp)
{
struct mailevt *evt = data;
if (trp)
t_notify(evt, ev, trp);
- else if (ev == wy_ev_finish)
+ else if (ev == wy_ev_stat)
mail_stats(evt);
}
void
wy_help(void)
{
diff --git a/src/config.c b/src/config.c
index ee9f0c3..f213fc7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -213,13 +213,14 @@ safe_file_name_alloc(const char *file_name)
static struct keyword event_tab[] = {
{ "success", wy_ev_success },
{ "bad-ownership", wy_ev_bad_ownership },
{ "bad-directive-signature", wy_ev_bad_directive_signature },
{ "bad-detached-signature", wy_ev_bad_detached_signature },
{ "check-failure", wy_ev_check_fail },
- { "finish", wy_ev_finish },
+ { "statistics", wy_ev_stat },
+ { "finish", wy_ev_stat },
{ NULL }
};
const char *
wy_event_str(enum wy_event evt)
{
diff --git a/src/spool.c b/src/spool.c
index 39ddc7b..2c01cc4 100644
--- a/src/spool.c
+++ b/src/spool.c
@@ -257,15 +257,15 @@ notify(const NOTIFYQ *nq, struct wy_triplet *t, enum wy_event e)
module_notify(n->modname, n->modcfg, e, t);
}
}
}
void
-notify_finish(void)
+notify_stat(void)
{
- notify(&default_notification, NULL, wy_ev_finish);
+ notify(&default_notification, NULL, wy_ev_stat);
}
void
spool_notify_flush(struct spool *spool)
{
struct notification *n;
diff --git a/src/timer.c b/src/timer.c
index 2085d23..1de7cfb 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -271,13 +271,13 @@ wy_thr_stat(void *ptr)
while (!stat_stop) {
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_sec += stat_report_interval;
pthread_cond_timedwait(&global_stats_cond, &global_stats_mutex, &ts);
wydawca_stat_log();
- notify_finish();
+ notify_stat();
wydawca_stat_reset();
}
pthread_mutex_unlock(&global_stats_mutex);
return NULL;
}
diff --git a/src/wydawca.h b/src/wydawca.h
index 7fd8a02..5fbb106 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -281,13 +281,13 @@ struct spool {
NOTIFYQ notification_queue;
char *check_script;
};
void notify(const NOTIFYQ *, struct wy_triplet *, enum wy_event);
void spool_notify_flush(struct spool *sp);
-void notify_finish(void);
+void notify_stat(void);
/* Modules */
struct module {
STAILQ_ENTRY(module) link;

Return to:

Send suggestions and report system problems to the System administrator.