mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f6267f3b3 | ||
|
|
dec89d4054 | ||
|
|
193e114596 | ||
|
|
1be67c434e | ||
|
|
4f8dab75b2 | ||
|
|
37d063fd3b | ||
|
|
97be3da126 | ||
|
|
e7f97f8264 | ||
|
|
6415aeebac | ||
|
|
e69200ea43 | ||
|
|
26d5018224 | ||
|
|
1b7699ca93 | ||
|
|
8eab099f09 | ||
|
|
c7c5426586 |
@@ -45,7 +45,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var \
|
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var \
|
||||||
--enable-x11-common-plugin --enable-testserv-plugin --with-watchdog \
|
--enable-x11-common-plugin --enable-testserv-plugin --with-watchdog \
|
||||||
--with-keventd \
|
--with-keventd --with-libsystemd \
|
||||||
CFLAGS="-fsanitize=address -ggdb"
|
CFLAGS="-fsanitize=address -ggdb"
|
||||||
make -j3 clean
|
make -j3 clean
|
||||||
make -j3 V=1
|
make -j3 V=1
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ jobs:
|
|||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure --prefix= --enable-x11-common-plugin --with-watchdog --with-keventd
|
./configure --prefix= --enable-x11-common-plugin --with-watchdog \
|
||||||
|
--with-keventd --with-libsystemd
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
export PATH=`pwd`/coverity/bin:$PATH
|
export PATH=`pwd`/coverity/bin:$PATH
|
||||||
|
|||||||
@@ -39,9 +39,10 @@ jobs:
|
|||||||
- name: Creating Makefiles ...
|
- name: Creating Makefiles ...
|
||||||
run: |
|
run: |
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var \
|
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc \
|
||||||
--enable-x11-common-plugin --enable-testserv-plugin --with-watchdog \
|
--localstatedir=/var --enable-x11-common-plugin \
|
||||||
--with-keventd
|
--enable-testserv-plugin --with-watchdog \
|
||||||
|
--with-keventd --with-libsystemd
|
||||||
- name: Enable unprivileged userns (unshare)
|
- name: Enable unprivileged userns (unshare)
|
||||||
run: |
|
run: |
|
||||||
sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0
|
sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0
|
||||||
|
|||||||
+1
-1
@@ -43,4 +43,4 @@ release: distcheck
|
|||||||
DISTCHECK_CONFIGURE_FLAGS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
|
DISTCHECK_CONFIGURE_FLAGS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
|
||||||
--enable-testserv-plugin --enable-x11-common-plugin \
|
--enable-testserv-plugin --enable-x11-common-plugin \
|
||||||
--with-watchdog --with-keventd --with-fstab=/etc/fstab \
|
--with-watchdog --with-keventd --with-fstab=/etc/fstab \
|
||||||
--with-bash-completion-dir=no
|
--with-libsystemd --with-bash-completion-dir=no
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT([Finit], [4.13], [https://github.com/troglobit/finit/issues],
|
AC_INIT([Finit], [4.14], [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 subdir-objects])
|
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])
|
||||||
@@ -171,7 +171,7 @@ AC_ARG_WITH(watchdog,
|
|||||||
|
|
||||||
AC_ARG_WITH(libsystemd,
|
AC_ARG_WITH(libsystemd,
|
||||||
AS_HELP_STRING([--with-libsystemd], [Build replacement libsystemd library, default: yes]),
|
AS_HELP_STRING([--with-libsystemd], [Build replacement libsystemd library, default: yes]),
|
||||||
[with_libsystemd=$withval], [with_libsystemd=yes])
|
[with_libsystemd=$withval], [with_libsystemd=no])
|
||||||
|
|
||||||
AC_ARG_WITH(hook-scripts-path,
|
AC_ARG_WITH(hook-scripts-path,
|
||||||
AS_HELP_STRING([--with-hook-scripts-path=DIR], [Base directory for hook scripts, default $libexecdir/finit/hook]),
|
AS_HELP_STRING([--with-hook-scripts-path=DIR], [Base directory for hook scripts, default $libexecdir/finit/hook]),
|
||||||
|
|||||||
@@ -4,6 +4,25 @@ Change Log
|
|||||||
All relevant changes are documented in this file.
|
All relevant changes are documented in this file.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[4.14][] - 2025-08-29
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Minor bug fix release.
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
- Add exit status/signal info when a process dies, by Mattias Berthel
|
||||||
|
- Extend `service kill:SEC` to support up to 300 sec.
|
||||||
|
- Extend `norespawn` debug to cover `service_retry()`
|
||||||
|
- Build *without* libsystemd replacement by default
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
- Fix #449: ALSA plugin fail-to-build-from-source
|
||||||
|
- Fix `sysv` stop command process environment, should be same as start
|
||||||
|
- Fix state machine ordering issue: enter new config generation *after*
|
||||||
|
services disabled in previous generation have been stopped
|
||||||
|
|
||||||
|
|
||||||
[4.13][] - 2025-07-10
|
[4.13][] - 2025-07-10
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
.md-header__topic:first-child {
|
||||||
|
font-weight: 500;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.md-header__title {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 2.6rem;
|
||||||
|
}
|
||||||
+3
-1
@@ -1,4 +1,4 @@
|
|||||||
site_name: doc/
|
site_name: Documentation
|
||||||
site_description: Fast Init for Linux Systems
|
site_description: Fast Init for Linux Systems
|
||||||
site_url: https://troglobit.github.io/finit/
|
site_url: https://troglobit.github.io/finit/
|
||||||
repo_url: https://github.com/troglobit/finit
|
repo_url: https://github.com/troglobit/finit
|
||||||
@@ -6,6 +6,8 @@ repo_name: troglobit/finit
|
|||||||
copyright: Copyright © 2008-2025 Joachim Wiberg
|
copyright: Copyright © 2008-2025 Joachim Wiberg
|
||||||
docs_dir: doc/
|
docs_dir: doc/
|
||||||
edit_uri: edit/master/doc/
|
edit_uri: edit/master/doc/
|
||||||
|
extra_css:
|
||||||
|
- extra.css
|
||||||
|
|
||||||
exclude_docs: |
|
exclude_docs: |
|
||||||
TODO.md
|
TODO.md
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
# include <lite/lite.h>
|
# include <lite/lite.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "conf.h"
|
||||||
#include "finit.h"
|
#include "finit.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|||||||
+27
-9
@@ -88,7 +88,7 @@ static void service_timeout_cb(uev_t *w, void *arg, int events)
|
|||||||
svc_t *svc = arg;
|
svc_t *svc = arg;
|
||||||
|
|
||||||
if (UEV_ERROR == events) {
|
if (UEV_ERROR == events) {
|
||||||
dbg("%s(): spurious problem, svc %s.", __func__, svc_ident(svc, NULL, 0));
|
dbg("%s: spurious problem", svc_ident(svc, NULL, 0));
|
||||||
uev_timer_start(w);
|
uev_timer_start(w);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1147,10 +1147,11 @@ int service_stop(svc_t *svc)
|
|||||||
args[i++] = "stop";
|
args[i++] = "stop";
|
||||||
args[i] = NULL;
|
args[i] = NULL;
|
||||||
|
|
||||||
switch (fork()) {
|
switch (service_fork(svc)) {
|
||||||
case 0:
|
case 0:
|
||||||
setsid();
|
|
||||||
redirect(svc);
|
redirect(svc);
|
||||||
|
setsid();
|
||||||
|
sig_unblock();
|
||||||
exec_runtask(args[0], &args[1]);
|
exec_runtask(args[0], &args[1]);
|
||||||
_exit(0);
|
_exit(0);
|
||||||
break;
|
break;
|
||||||
@@ -1420,9 +1421,9 @@ static void parse_killdelay(svc_t *svc, char *delay)
|
|||||||
const char *errstr;
|
const char *errstr;
|
||||||
long long sec;
|
long long sec;
|
||||||
|
|
||||||
sec = strtonum(delay, 1, 60, &errstr);
|
sec = strtonum(delay, 1, 300, &errstr);
|
||||||
if (errstr) {
|
if (errstr) {
|
||||||
errx(1, "%s: killdelay %s is %s (1-60)", svc_ident(svc, NULL, 0), delay, errstr);
|
errx(1, "%s: killdelay %s is %s (1-300)", svc_ident(svc, NULL, 0), delay, errstr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1464,7 +1465,7 @@ static void parse_script(svc_t *svc, char *type, char *script, int *tmo, char *b
|
|||||||
|
|
||||||
found = which(path);
|
found = which(path);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
logit(LOG_WARNING, "%s:%s is missing or not executable, skipping.", type, path);
|
logit(LOG_WARNING, "%s:'%s' is missing or not executable, skipping.", type, path);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
free(found);
|
free(found);
|
||||||
@@ -2097,6 +2098,7 @@ void service_unregister(svc_t *svc)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
service_stop(svc);
|
service_stop(svc);
|
||||||
|
service_timeout_cancel(svc);
|
||||||
|
|
||||||
for (c = strtok(svc->cond, ","); c; c = strtok(NULL, ","))
|
for (c = strtok(svc->cond, ","); c; c = strtok(NULL, ","))
|
||||||
devmon_del_cond(c);
|
devmon_del_cond(c);
|
||||||
@@ -2136,6 +2138,10 @@ void service_monitor(pid_t lost, int status)
|
|||||||
: (svc->state == SVC_CLEANUP_STATE
|
: (svc->state == SVC_CLEANUP_STATE
|
||||||
? svc->cleanup_script
|
? svc->cleanup_script
|
||||||
: svc->pre_script)), lost, ok, sig, rc);
|
: svc->pre_script)), lost, ok, sig, rc);
|
||||||
|
|
||||||
|
/* Prevent: spurious problem from timeout callback */
|
||||||
|
service_timeout_cancel(svc);
|
||||||
|
|
||||||
/* Kill all children in the same proess group, e.g. logit */
|
/* Kill all children in the same proess group, e.g. logit */
|
||||||
dbg("Killing lingering children in same process group ...");
|
dbg("Killing lingering children in same process group ...");
|
||||||
kill(-svc->pid, SIGKILL);
|
kill(-svc->pid, SIGKILL);
|
||||||
@@ -2467,6 +2473,10 @@ static void service_retry(svc_t *svc)
|
|||||||
int timeout;
|
int timeout;
|
||||||
|
|
||||||
service_timeout_cancel(svc);
|
service_timeout_cancel(svc);
|
||||||
|
|
||||||
|
if (is_norespawn())
|
||||||
|
return;
|
||||||
|
|
||||||
if (svc->respawn) {
|
if (svc->respawn) {
|
||||||
dbg("%s crashed/exited, respawning ...", svc_ident(svc, NULL, 0));
|
dbg("%s crashed/exited, respawning ...", svc_ident(svc, NULL, 0));
|
||||||
svc_unblock(svc);
|
svc_unblock(svc);
|
||||||
@@ -2518,8 +2528,13 @@ static void service_retry(svc_t *svc)
|
|||||||
timeout = ((*restart_cnt) <= (svc->restart_max / 2)) ? 2000 : 5000;
|
timeout = ((*restart_cnt) <= (svc->restart_max / 2)) ? 2000 : 5000;
|
||||||
/* If a longer timeout was specified in the conf, use that instead. */
|
/* If a longer timeout was specified in the conf, use that instead. */
|
||||||
svc->restart_tmo = max(svc->restart_tmo, timeout);
|
svc->restart_tmo = max(svc->restart_tmo, timeout);
|
||||||
logit(LOG_CONSOLE|LOG_WARNING, "Service %s[%d] died, restarting (retry in %d msec) (attempt: %d/%d)",
|
logit(LOG_CONSOLE|LOG_WARNING, "Service %s[%d] died (%s%d), restarting (retry in %d msec) (attempt: %d/%d)",
|
||||||
svc_ident(svc, NULL, 0), svc->oldpid, svc->restart_tmo, *restart_cnt, svc->restart_max);
|
svc_ident(svc, NULL, 0), svc->oldpid,
|
||||||
|
WIFEXITED(svc->status) ? "with exit status: " : "by signal: ",
|
||||||
|
WIFEXITED(svc->status) ? WEXITSTATUS(svc->status) : WTERMSIG(svc->status),
|
||||||
|
svc->restart_tmo,
|
||||||
|
*restart_cnt,
|
||||||
|
svc->restart_max);
|
||||||
|
|
||||||
svc_unblock(svc);
|
svc_unblock(svc);
|
||||||
service_step(svc);
|
service_step(svc);
|
||||||
@@ -2771,6 +2786,9 @@ restart:
|
|||||||
if (sm_in_reload())
|
if (sm_in_reload())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (is_norespawn())
|
||||||
|
break;
|
||||||
|
|
||||||
/* Don't start if it conflicts with something else already started */
|
/* Don't start if it conflicts with something else already started */
|
||||||
if (svc_conflicts(svc)) {
|
if (svc_conflicts(svc)) {
|
||||||
logit(svc->nowarn ? LOG_DEBUG : LOG_INFO,
|
logit(svc->nowarn ? LOG_DEBUG : LOG_INFO,
|
||||||
@@ -3141,7 +3159,7 @@ static void service_interval_cb(uev_t *w, void *arg, int events)
|
|||||||
|
|
||||||
(void)arg;
|
(void)arg;
|
||||||
if (UEV_ERROR == events) {
|
if (UEV_ERROR == events) {
|
||||||
dbg("%s(): spurious problem, restarting.", __func__);
|
dbg("spurious problem, restarting.");
|
||||||
uev_timer_start(w);
|
uev_timer_start(w);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -359,6 +359,8 @@ restart:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SM_RELOAD_CHANGE_STATE:
|
case SM_RELOAD_CHANGE_STATE:
|
||||||
|
sm.in_reload = 1;
|
||||||
|
|
||||||
/* First reload all *.conf in /etc/finit.d/ */
|
/* First reload all *.conf in /etc/finit.d/ */
|
||||||
conf_reload();
|
conf_reload();
|
||||||
|
|
||||||
@@ -367,10 +369,11 @@ restart:
|
|||||||
* let all affected services move to WAITING/HALTED
|
* let all affected services move to WAITING/HALTED
|
||||||
*/
|
*/
|
||||||
dbg("Stopping services not allowed after reconf ...");
|
dbg("Stopping services not allowed after reconf ...");
|
||||||
sm.in_reload = 1;
|
|
||||||
cond_reload();
|
|
||||||
service_step_all(SVC_TYPE_ANY);
|
service_step_all(SVC_TYPE_ANY);
|
||||||
|
|
||||||
|
/* Step the generation ... */
|
||||||
|
cond_reload();
|
||||||
|
|
||||||
sm.state = SM_RELOAD_WAIT_STATE;
|
sm.state = SM_RELOAD_WAIT_STATE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -25,7 +25,8 @@ if [ "$run_make" -eq 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var \
|
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var \
|
||||||
--enable-x11-common-plugin --with-watchdog --with-keventd \
|
--enable-x11-common-plugin --enable-testserv-plugin --with-watchdog \
|
||||||
|
--with-keventd --with-libsystemd \
|
||||||
CFLAGS='-fsanitize=address -ggdb'
|
CFLAGS='-fsanitize=address -ggdb'
|
||||||
|
|
||||||
if [ "$run_make" -eq 1 ]; then
|
if [ "$run_make" -eq 1 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user