mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
185a72bd14 | ||
|
|
cd32c623cf | ||
|
|
ac4b9c2f93 |
No files matched your search
@@ -20,6 +20,11 @@ All relevant changes are documented in this file.
|
|||||||
the default `SIGTERM`
|
the default `SIGTERM`
|
||||||
- Fix pre/post/ready/cleanup script execution if service has an
|
- Fix pre/post/ready/cleanup script execution if service has an
|
||||||
optional `env:file` (leading `-`)
|
optional `env:file` (leading `-`)
|
||||||
|
- Fix blocked signals for pre/post/ready/cleanup scripts preventing
|
||||||
|
normal shutdown when a service/sysv is stopped in its setup state
|
||||||
|
- Fix issue where a pre:script creates a PID file in `/run` cause the
|
||||||
|
service to move from setup state to running. Any `svc_t` in setup,
|
||||||
|
teardown, or cleanup state should be ignored in the pidfile plugin
|
||||||
|
|
||||||
|
|
||||||
[4.10][] - 2025-03-03
|
[4.10][] - 2025-03-03
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT([Finit], [4.11-rc2], [https://github.com/troglobit/finit/issues],
|
AC_INIT([Finit], [4.11], [https://github.com/troglobit/finit/issues],
|
||||||
[finit], [https://troglobit.com/projects/finit/])
|
[finit], [https://troglobit.com/projects/finit/])
|
||||||
AC_CONFIG_AUX_DIR(aux)
|
AC_CONFIG_AUX_DIR(aux)
|
||||||
AM_INIT_AUTOMAKE([1.11 foreign dist-xz subdir-objects])
|
AM_INIT_AUTOMAKE([1.11 foreign dist-xz subdir-objects])
|
||||||
|
|||||||
@@ -80,6 +80,23 @@ static void pidfile_update_conds(char *dir, char *name, uint32_t mask)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (svc->state) {
|
||||||
|
case SVC_TEARDOWN_STATE:
|
||||||
|
case SVC_CLEANUP_STATE:
|
||||||
|
case SVC_SETUP_STATE:
|
||||||
|
/*
|
||||||
|
* E.g., a setup script for a container may run in lieu
|
||||||
|
* of crun, trying to fetch a container image from the
|
||||||
|
* network. This script may want to advertise its PID
|
||||||
|
* to the system for clean and swift reboots.
|
||||||
|
*/
|
||||||
|
dbg("%s[%d]: ignoring any PID file changes in CLEANUP/TEARDOWN/SETUP",
|
||||||
|
svc_ident(svc, NULL, 0), svc->pid);
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Service condistion to set/clear */
|
/* Service condistion to set/clear */
|
||||||
mkcond(svc, cond, sizeof(cond));
|
mkcond(svc, cond, sizeof(cond));
|
||||||
|
|
||||||
|
|||||||
@@ -2155,6 +2155,8 @@ static void service_pre_script(svc_t *svc)
|
|||||||
strlcpy(buf, svc->pre_script, sizeof(buf));
|
strlcpy(buf, svc->pre_script, sizeof(buf));
|
||||||
|
|
||||||
set_pre_post_envs(svc, "pre");
|
set_pre_post_envs(svc, "pre");
|
||||||
|
sig_unblock();
|
||||||
|
|
||||||
execvp(_PATH_BSHELL, argv);
|
execvp(_PATH_BSHELL, argv);
|
||||||
_exit(EX_OSERR);
|
_exit(EX_OSERR);
|
||||||
}
|
}
|
||||||
@@ -2192,6 +2194,7 @@ static void service_post_script(svc_t *svc)
|
|||||||
else
|
else
|
||||||
strlcpy(buf, svc->post_script, sizeof(buf));
|
strlcpy(buf, svc->post_script, sizeof(buf));
|
||||||
set_pre_post_envs(svc, "post");
|
set_pre_post_envs(svc, "post");
|
||||||
|
sig_unblock();
|
||||||
|
|
||||||
if (WIFEXITED(svc->status)) {
|
if (WIFEXITED(svc->status)) {
|
||||||
char val[4];
|
char val[4];
|
||||||
@@ -2253,6 +2256,8 @@ void service_ready_script(svc_t *svc)
|
|||||||
strlcpy(buf, svc->ready_script, sizeof(buf));
|
strlcpy(buf, svc->ready_script, sizeof(buf));
|
||||||
|
|
||||||
set_pre_post_envs(svc, "ready");
|
set_pre_post_envs(svc, "ready");
|
||||||
|
sig_unblock();
|
||||||
|
|
||||||
execvp(_PATH_BSHELL, argv);
|
execvp(_PATH_BSHELL, argv);
|
||||||
_exit(EX_OSERR);
|
_exit(EX_OSERR);
|
||||||
}
|
}
|
||||||
@@ -2289,6 +2294,8 @@ static void service_cleanup_script(svc_t *svc)
|
|||||||
strlcpy(buf, svc->cleanup_script, sizeof(buf));
|
strlcpy(buf, svc->cleanup_script, sizeof(buf));
|
||||||
|
|
||||||
set_pre_post_envs(svc, "cleanup");
|
set_pre_post_envs(svc, "cleanup");
|
||||||
|
sig_unblock();
|
||||||
|
|
||||||
execvp(_PATH_BSHELL, argv);
|
execvp(_PATH_BSHELL, argv);
|
||||||
_exit(EX_OSERR);
|
_exit(EX_OSERR);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user