From e1169865dc002bc0053a25527d8f4b44f20c1e0e Mon Sep 17 00:00:00 2001 From: Lucas de Castro Borges Date: Mon, 3 Jun 2024 20:22:57 -0300 Subject: New upstream version 1.0.11 --- config.c | 5 ++++- config.h | 3 ++- foolsm.c | 4 ++-- foolsm.conf.sample | 2 ++ foolsm.init | 1 + foolsm.spec | 7 +++++-- group_script | 1 + 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/config.c b/config.c index 99795dc..22bbac9 100644 --- a/config.c +++ b/config.c @@ -1,6 +1,6 @@ /* -(C) 2009-2015 Mika Ilmaranta +(C) 2009-2019 Mika Ilmaranta License: GPLv2 @@ -110,6 +110,7 @@ void free_config(CONFIG **first, CONFIG **last, GROUPS **firstg, GROUPS **lastg) if(curg->eventscript && curg->eventscript != defaults.eventscript) release(&curg->eventscript); if(curg->notifyscript && curg->notifyscript != defaults.notifyscript) release(&curg->notifyscript); if(curg->warn_email && curg->warn_email != defaults.warn_email) release(&curg->warn_email); + if(curg->device && curg->device != defaults.device) release(&curg->device); if(curg->queue && curg->queue != defaults.queue) release(&curg->queue); prevg = curg; @@ -426,6 +427,7 @@ static void read_one_config(char *fn, CONFIG **first, CONFIG **last, GROUPS **fi else if(!eqcmp(buf, "unknown_up_notify")) curg->unknown_up_notify = atoi(strchr(buf, '=') + 1); else if(!eqcmp(buf, "warn_email")) curg->warn_email = strdup(strchr(buf, '=') + 1); else if(!eqcmp(buf, "logic")) curg->logic = atoi(strchr(buf, '=') + 1); + else if(!eqcmp(buf, "device")) curg->device = strdup(strchr(buf, '=') + 1); else if(!eqcmp(buf, "status")) curg->status = atoi(strchr(buf, '=') + 1); else if(!eqcmp(buf, "queue")) curg->queue = strdup(strchr(buf, '=') + 1); else if(!eqcmp(buf, "member-connection")) { @@ -535,6 +537,7 @@ static void read_one_config(char *fn, CONFIG **first, CONFIG **last, GROUPS **fi curg->unknown_up_notify = defaults.unknown_up_notify; curg->warn_email = defaults.warn_email; curg->logic = 0; /* default group logic or */ + curg->device = defaults.device; curg->status = defaults.status; curg->queue = defaults.queue; diff --git a/config.h b/config.h index 27bb360..90165bd 100644 --- a/config.h +++ b/config.h @@ -1,6 +1,6 @@ /* -(C) 2009-2015 Mika Ilmaranta +(C) 2009-2019 Mika Ilmaranta License: GPLv2 @@ -68,6 +68,7 @@ typedef struct groups { int unknown_up_notify; char *warn_email; int logic; /* or = 0, and = 1 */ + char *device; STATUS status; char *queue; diff --git a/foolsm.c b/foolsm.c index dd8d4ac..dd99ee0 100644 --- a/foolsm.c +++ b/foolsm.c @@ -1,6 +1,6 @@ /* -(C) 2009-2015 Mika Ilmaranta +(C) 2009-2019 Mika Ilmaranta License: GPLv2 @@ -775,7 +775,7 @@ static void groups_decide(GROUPS *firstg){ get_status_str(curg->status), curg->name, "", - "", + curg->device ? curg->device : "", curg->warn_email ? curg->warn_email : "", 0, 0, diff --git a/foolsm.conf.sample b/foolsm.conf.sample index 0d071f6..74d78cb 100644 --- a/foolsm.conf.sample +++ b/foolsm.conf.sample @@ -133,6 +133,8 @@ defaults { # name=conn-group-a # eventscript=/usr/libexec/lsm/default_script # warn_email=root@some.domain.tld +# # device name reported to the scripts +# device=eth0 # # logic between member connetion statuses # # logic=0 == or # # logic=1 == and diff --git a/foolsm.init b/foolsm.init index e9e12ea..cc81dc3 100644 --- a/foolsm.init +++ b/foolsm.init @@ -11,6 +11,7 @@ # Provides: foolsm # Required-Start: $network $syslog # Required-Stop: +# Default-Start: # Default-Stop: 0 1 6 # Short-Description: Foolsm - link status monitor # Description: Foolsm is the link status monitor diff --git a/foolsm.spec b/foolsm.spec index 4094ed6..0b6bd5f 100644 --- a/foolsm.spec +++ b/foolsm.spec @@ -7,7 +7,7 @@ Summary: The Foobar Link Status Monitor Name: foolsm -Version: 1.0.10 +Version: 1.0.11 Release: 1%{?dist} License: GPLv2 URL: http://lsm.foobar.fi/ @@ -180,13 +180,16 @@ fi %dir %{_sharedstatedir}/foolsm %changelog +* Fri Sep 20 2019 Mika Ilmaranta - 1.0.11-1 +- added support for group to have device name + * Tue Jul 25 2017 Mika Ilmaranta - 1.0.10-1 - debian patch from Roberto Suárez Soto * Sun Dec 18 2016 Mika Ilmaranta - 1.0.9-1 - README: fixed note about assumed start state -* Wed Sep 9 2016 Mika Ilmaranta - 1.0.8-1 +* Fri Sep 9 2016 Mika Ilmaranta - 1.0.8-1 - foolsm.spec: triggers to move old lsm config for foolsm - fix forever loop in waitpid while loop diff --git a/group_script b/group_script index c50887f..d15228b 100644 --- a/group_script +++ b/group_script @@ -43,6 +43,7 @@ prevstate = ${PREVSTATE} newstate = ${STATE} name = ${NAME} warn_email = ${WARN_EMAIL} +device = ${DEVICE} Packet statuses are not available for groups. -- cgit v1.2.3