diff --git a/patches/finit/4.6/0001-Silence-not-available-log-messages-for-nowarn-run-ta.patch b/patches/finit/4.6/0001-Silence-not-available-log-messages-for-nowarn-run-ta.patch deleted file mode 100644 index 522168c2..00000000 --- a/patches/finit/4.6/0001-Silence-not-available-log-messages-for-nowarn-run-ta.patch +++ /dev/null @@ -1,78 +0,0 @@ -From cbf96a1de0feee85f8a4014f29f9f3b7558dbff0 Mon Sep 17 00:00:00 2001 -From: Joachim Wiberg -Date: Sun, 10 Dec 2023 16:42:29 +0100 -Subject: [PATCH 1/2] Silence 'not available' log messages for nowarn - run/task/service - -Signed-off-by: Joachim Wiberg ---- - src/service.c | 4 ++-- - src/svc.c | 5 +++-- - src/svc.h | 2 +- - 3 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/src/service.c b/src/service.c -index c6ee18d0..1ee54e5a 100644 ---- a/src/service.c -+++ b/src/service.c -@@ -1620,7 +1620,7 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file) - strlcat(ident, id, sizeof(ident)); - } - -- if (ifstmt && !svc_ifthen(1, ident, ifstmt)) -+ if (ifstmt && !svc_ifthen(1, ident, ifstmt, nowarn)) - return 0; - - levels = conf_parse_runlevels(runlevels); -@@ -2027,7 +2027,7 @@ void service_mark_unavail(void) - if (!svc->ifstmt[0]) - continue; - -- if (!svc_ifthen(1, svc_ident(svc, buf, sizeof(buf)), svc->ifstmt)) -+ if (!svc_ifthen(1, svc_ident(svc, buf, sizeof(buf)), svc->ifstmt, svc->nowarn)) - svc_mark(svc); - } - } -diff --git a/src/svc.c b/src/svc.c -index 001993de..6bb90049 100644 ---- a/src/svc.c -+++ b/src/svc.c -@@ -649,7 +649,7 @@ int svc_enabled(svc_t *svc) - return 0; - } - -- if (!svc_ifthen(0, NULL, svc->ifstmt)) { -+ if (!svc_ifthen(0, NULL, svc->ifstmt, svc->nowarn)) { - // dbg("ifthen:%s>", svc->ifstmt[0] ? svc->ifstmt : "<"); - return 0; - } -@@ -704,11 +704,12 @@ int svc_conflicts(svc_t *svc) - * @is_conf: Set when called by service_mark_unavail() - * @ident: svc_t identififcation (name:id) - * @stmt: if: statement from .conf file -+ * @quiet: If non-zero, do not warn in syslog - * - * Returns: - * %TRUE(1) yes, use this svc_t, %FALSE(0) prune - */ --int svc_ifthen(int is_conf, const char *ident, char *stmt) -+int svc_ifthen(int is_conf, const char *ident, char *stmt, int quiet) - { - char stmts[MAX_IDENT_LEN]; - int not = 0; -diff --git a/src/svc.h b/src/svc.h -index f94a30e5..520aabcc 100644 ---- a/src/svc.h -+++ b/src/svc.h -@@ -249,7 +249,7 @@ void svc_prune_bootstrap (void); - void svc_enable (svc_t *svc); - int svc_enabled (svc_t *svc); - int svc_conflicts (svc_t *svc); --int svc_ifthen (int is_conf, const char *ident, char *stmt); -+int svc_ifthen (int is_conf, const char *ident, char *stmt, int quiet); - - int svc_parse_jobstr (char *str, size_t len, void *user_data, int (*found)(svc_t *, void *), int (not_found)(char *, char *, void *)); - --- -2.34.1 - diff --git a/patches/finit/4.6/0002-Actually-silence-the-log-message-missing-hunk-for-pr.patch b/patches/finit/4.6/0002-Actually-silence-the-log-message-missing-hunk-for-pr.patch deleted file mode 100644 index afb7c7c1..00000000 --- a/patches/finit/4.6/0002-Actually-silence-the-log-message-missing-hunk-for-pr.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ed88469276c569acd9ef16bcc38cd80afd8dea52 Mon Sep 17 00:00:00 2001 -From: Joachim Wiberg -Date: Sun, 10 Dec 2023 17:32:19 +0100 -Subject: [PATCH 2/2] Actually silence the log message, missing hunk for - previous change - -Signed-off-by: Joachim Wiberg ---- - src/svc.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/svc.c b/src/svc.c -index 6bb90049..773f0ab6 100644 ---- a/src/svc.c -+++ b/src/svc.c -@@ -759,11 +759,13 @@ int svc_ifthen(int is_conf, const char *ident, char *stmt, int quiet) - - svc = svc_find_by_str(stmt); - if (not && svc) { -- logit(LOG_NOTICE, "skipping %s, %s already loaded.", ident, svc_ident(svc, NULL, 0)); -+ if (!quiet) -+ logit(LOG_NOTICE, "skipping %s, %s already loaded.", ident, svc_ident(svc, NULL, 0)); - return 0; - } - if (!not && !svc) { -- logit(LOG_NOTICE, "skipping %s, %s not available.", ident, stmt); -+ if (!quiet) -+ logit(LOG_NOTICE, "skipping %s, %s not available.", ident, stmt); - return 0; - } - } --- -2.34.1 - diff --git a/patches/finit/4.7/0001-shutdown-use-cond_clear_noupdate-to-prevent-nested-s.patch b/patches/finit/4.7/0001-shutdown-use-cond_clear_noupdate-to-prevent-nested-s.patch new file mode 100644 index 00000000..94b3a4cb --- /dev/null +++ b/patches/finit/4.7/0001-shutdown-use-cond_clear_noupdate-to-prevent-nested-s.patch @@ -0,0 +1,70 @@ +From c2218236546908ecab5eab4b32e698d7bb3d984a Mon Sep 17 00:00:00 2001 +From: Joachim Wiberg +Date: Sat, 3 Feb 2024 17:30:30 +0100 +Subject: [PATCH] shutdown: use cond_clear_noupdate() to prevent nested + service_stop() +Organization: Addiva Elektronik + +When the system shuts down, or user changes runlevels, we don't have to +call cond_clear_update(), because this can lead to nested service_stop() +calls, which in turn lead to out of sync progress updates: + +[ .. ] Stopping Foo +[ OK ] Stopping Bar +[ OK ] + +Signed-off-by: Joachim Wiberg +--- + src/cond-w.c | 6 +++++- + src/service.c | 4 +++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/cond-w.c b/src/cond-w.c +index 2502264..0546282 100644 +--- a/src/cond-w.c ++++ b/src/cond-w.c +@@ -35,6 +35,7 @@ + #include "cond.h" + #include "pid.h" + #include "service.h" ++#include "sm.h" + + struct cond_boot { + TAILQ_ENTRY(cond_boot) link; +@@ -214,7 +215,10 @@ static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct + err(1, "Failed removing condition %s", fpath); + + cond = ptr + strlen(COND_BASE) + 1; +- cond_update(cond); ++ if (sm_is_in_teardown(&sm)) ++ cond_clear_noupdate(cond); ++ else ++ cond_update(cond); + + return 0; + } +diff --git a/src/service.c b/src/service.c +index 8175757..eca9ed0 100644 +--- a/src/service.c ++++ b/src/service.c +@@ -2261,7 +2261,7 @@ static void svc_set_state(svc_t *svc, svc_state_t new_state) + /* if PID isn't collected within SVC_TERM_TIMEOUT msec, kill it! */ + if (new_state == SVC_STOPPING_STATE) { + dbg("%s is stopping, wait %d sec before sending SIGKILL ...", +- svc_ident(svc, NULL, 0), svc->killdelay / 1000); ++ svc_ident(svc, NULL, 0), svc->killdelay / 1000); + service_timeout_cancel(svc); + service_timeout_after(svc, svc->killdelay, service_kill); + } +@@ -2299,6 +2299,8 @@ static void svc_set_state(svc_t *svc, svc_state_t new_state) + if ((old_state == SVC_RUNNING_STATE && new_state == SVC_PAUSED_STATE) || + (old_state == SVC_PAUSED_STATE && new_state == SVC_RUNNING_STATE)) + ; /* only paused during reload, don't clear conds. */ ++ else if (sm_is_in_teardown(&sm)) ++ cond_clear_noupdate(cond); + else + cond_clear(cond); + +-- +2.34.1 +