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: |
|
||||
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var \
|
||||
--enable-x11-common-plugin --enable-testserv-plugin --with-watchdog \
|
||||
--with-keventd \
|
||||
--with-keventd --with-libsystemd \
|
||||
CFLAGS="-fsanitize=address -ggdb"
|
||||
make -j3 clean
|
||||
make -j3 V=1
|
||||
|
||||
@@ -66,7 +66,8 @@ jobs:
|
||||
- name: Configure
|
||||
run: |
|
||||
./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
|
||||
run: |
|
||||
export PATH=`pwd`/coverity/bin:$PATH
|
||||
|
||||
@@ -39,9 +39,10 @@ jobs:
|
||||
- name: Creating Makefiles ...
|
||||
run: |
|
||||
./autogen.sh
|
||||
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc --localstatedir=/var \
|
||||
--enable-x11-common-plugin --enable-testserv-plugin --with-watchdog \
|
||||
--with-keventd
|
||||
./configure --prefix=/usr --exec-prefix= --sysconfdir=/etc \
|
||||
--localstatedir=/var --enable-x11-common-plugin \
|
||||
--enable-testserv-plugin --with-watchdog \
|
||||
--with-keventd --with-libsystemd
|
||||
- name: Enable unprivileged userns (unshare)
|
||||
run: |
|
||||
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 \
|
||||
--enable-testserv-plugin --enable-x11-common-plugin \
|
||||
--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/])
|
||||
AC_CONFIG_AUX_DIR(aux)
|
||||
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])
|
||||
@@ -171,7 +171,7 @@ AC_ARG_WITH(watchdog,
|
||||
|
||||
AC_ARG_WITH(libsystemd,
|
||||
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,
|
||||
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.
|
||||
|
||||
|
||||
|
||||
[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
|
||||
---------------------
|
||||
|
||||
|
||||
@@ -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_url: https://troglobit.github.io/finit/
|
||||
repo_url: https://github.com/troglobit/finit
|
||||
@@ -6,6 +6,8 @@ repo_name: troglobit/finit
|
||||
copyright: Copyright © 2008-2025 Joachim Wiberg
|
||||
docs_dir: doc/
|
||||
edit_uri: edit/master/doc/
|
||||
extra_css:
|
||||
- extra.css
|
||||
|
||||
exclude_docs: |
|
||||
TODO.md
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# include <lite/lite.h>
|
||||
#endif
|
||||
|
||||
#include "conf.h"
|
||||
#include "finit.h"
|
||||
#include "helpers.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;
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@@ -1147,10 +1147,11 @@ int service_stop(svc_t *svc)
|
||||
args[i++] = "stop";
|
||||
args[i] = NULL;
|
||||
|
||||
switch (fork()) {
|
||||
switch (service_fork(svc)) {
|
||||
case 0:
|
||||
setsid();
|
||||
redirect(svc);
|
||||
setsid();
|
||||
sig_unblock();
|
||||
exec_runtask(args[0], &args[1]);
|
||||
_exit(0);
|
||||
break;
|
||||
@@ -1420,9 +1421,9 @@ static void parse_killdelay(svc_t *svc, char *delay)
|
||||
const char *errstr;
|
||||
long long sec;
|
||||
|
||||
sec = strtonum(delay, 1, 60, &errstr);
|
||||
sec = strtonum(delay, 1, 300, &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;
|
||||
}
|
||||
|
||||
@@ -1464,7 +1465,7 @@ static void parse_script(svc_t *svc, char *type, char *script, int *tmo, char *b
|
||||
|
||||
found = which(path);
|
||||
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;
|
||||
}
|
||||
free(found);
|
||||
@@ -2097,6 +2098,7 @@ void service_unregister(svc_t *svc)
|
||||
return;
|
||||
|
||||
service_stop(svc);
|
||||
service_timeout_cancel(svc);
|
||||
|
||||
for (c = strtok(svc->cond, ","); c; c = strtok(NULL, ","))
|
||||
devmon_del_cond(c);
|
||||
@@ -2136,6 +2138,10 @@ void service_monitor(pid_t lost, int status)
|
||||
: (svc->state == SVC_CLEANUP_STATE
|
||||
? svc->cleanup_script
|
||||
: 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 */
|
||||
dbg("Killing lingering children in same process group ...");
|
||||
kill(-svc->pid, SIGKILL);
|
||||
@@ -2467,6 +2473,10 @@ static void service_retry(svc_t *svc)
|
||||
int timeout;
|
||||
|
||||
service_timeout_cancel(svc);
|
||||
|
||||
if (is_norespawn())
|
||||
return;
|
||||
|
||||
if (svc->respawn) {
|
||||
dbg("%s crashed/exited, respawning ...", svc_ident(svc, NULL, 0));
|
||||
svc_unblock(svc);
|
||||
@@ -2518,8 +2528,13 @@ static void service_retry(svc_t *svc)
|
||||
timeout = ((*restart_cnt) <= (svc->restart_max / 2)) ? 2000 : 5000;
|
||||
/* If a longer timeout was specified in the conf, use that instead. */
|
||||
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)",
|
||||
svc_ident(svc, NULL, 0), svc->oldpid, svc->restart_tmo, *restart_cnt, svc->restart_max);
|
||||
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,
|
||||
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);
|
||||
service_step(svc);
|
||||
@@ -2771,6 +2786,9 @@ restart:
|
||||
if (sm_in_reload())
|
||||
break;
|
||||
|
||||
if (is_norespawn())
|
||||
break;
|
||||
|
||||
/* Don't start if it conflicts with something else already started */
|
||||
if (svc_conflicts(svc)) {
|
||||
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;
|
||||
if (UEV_ERROR == events) {
|
||||
dbg("%s(): spurious problem, restarting.", __func__);
|
||||
dbg("spurious problem, restarting.");
|
||||
uev_timer_start(w);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -359,6 +359,8 @@ restart:
|
||||
break;
|
||||
|
||||
case SM_RELOAD_CHANGE_STATE:
|
||||
sm.in_reload = 1;
|
||||
|
||||
/* First reload all *.conf in /etc/finit.d/ */
|
||||
conf_reload();
|
||||
|
||||
@@ -367,10 +369,11 @@ restart:
|
||||
* let all affected services move to WAITING/HALTED
|
||||
*/
|
||||
dbg("Stopping services not allowed after reconf ...");
|
||||
sm.in_reload = 1;
|
||||
cond_reload();
|
||||
service_step_all(SVC_TYPE_ANY);
|
||||
|
||||
/* Step the generation ... */
|
||||
cond_reload();
|
||||
|
||||
sm.state = SM_RELOAD_WAIT_STATE;
|
||||
break;
|
||||
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@ if [ "$run_make" -eq 1 ]; then
|
||||
fi
|
||||
|
||||
./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'
|
||||
|
||||
if [ "$run_make" -eq 1 ]; then
|
||||
|
||||
Reference in New Issue
Block a user