Skip to content

Commit

Permalink
Fix #101: remove built-in inetd from finit
Browse files Browse the repository at this point in the history
This patch removes the built-in inetd support from Finit.  We recommend
using an external inetd instead, e.g. xinetd.

If you liked the feature set our inetd provided; filtering per interface
and port redirection, then please let us know or use the code in this
patch (MIT licensed) to recreate it.  We are open to reintroducing it,
but then as a stand-alone daemon like the bundled watchdogd and getty.

So long for now, old friend.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Feb 11, 2021
1 parent 673a9a5 commit e88a9b1
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 1,835 deletions.
21 changes: 4 additions & 17 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ make sure to read the whole changelog when upgrading.

### Changes
* Introducing Finit progress 𝓜𝓸𝓭𝓮𝓻𝓷
* Removed built-in inetd super server. If you need this functionality,
use an external inetd, like xinetd, instead. A pull request for a
stand-alone inetd, like watchdogd and getty, is most welcome!
* Incompatible `configure` script changes, i.e., you must give proper
path arguments to the script, no more guessing just GNU defaults.
There are examples in the documentation and the `contrib/` section
Expand Down Expand Up @@ -76,8 +79,7 @@ make sure to read the whole changelog when upgrading.
* Drop `--enable-rw-roots` configure option, use `rw` for your `/`
partition in `/etc/fstab` instead to trigger remount at boot
* Drop default tty speed (38400) and use 0 (kernel default) instead
* Make `:ID` optional for real, use NULL/zero internally and only
force :ID (numbered) for inetd services, this allows ...
* Make `:ID` optional, use NULL/zero internally this allows ...
* Handle use-cases where multiple services share the same PID filem
and thus the same condition path, e.g. different instances for
different runlevels. Allow custom condition path with `name:foo`
Expand All @@ -95,38 +97,23 @@ make sure to read the whole changelog when upgrading.

* Fix #96: Start udevd as a proper service
* Ensure we track run commands as well as task/service, once per runlevel
* Fix #98: FTBFS with `--disable-inetd`
* Make sure to unblock UDP inetd services when connection terminates.
Regression introduced in v3.1
* Ensure run/tasks also go to stopping state on exit, like services,
otherwise it is unnecessarily hard to restart them
* Fix #99: Do not try to `SIGKILL` inetd services, they are not backed
by a PID. This caused a use after free issue crashing finit. Found
and fixed by Tobias Waldekranz, Westermo
* Fix missing OS/Finit title bug, adds leading newline before banner
* Remove "Failed connecting to watchdog ..." error message on systems
that do not have a watchdog
* Fix #100: Early condition handling may not work if `/var/run` does
not yet exist (symlink to `/run`). Added compat layer for access
* Fix #103: Register multiple getty if `@console` resolves to >1 TTY,
* Fix #105: Only remove /etc/nologin when moving from runlevel 0, 1, 6
* Fix #106: Don't mark inetd connections for deletion at .conf reload.
Fixed by Jonas Johansson, Westermo
* Fix #107: Stop spawned inetd conncections when stopping inetd service.
Fixed by Jonas Johansson, Westermo
* Fix #109: Support for PID files in sub-directories to `/var/run`
* Handle rename of PID files, by Robert Andersson, Atlas Copco
* Fix #111: Only restart inetd services when necessary. E.g., if the
listening interface is changed. Only stop established connections
which are no longer allowed, i.e. do not touch already allowed
established connections. Fixed by Jonas Johansson, Westermo
* Fix #120: Redirect `stdin` to `/dev/null` for services by default
* Fix #122: Switch to `nanosleep()` to achieve "signal safe" sleep,
fixed by Jacques de Laval, Westermo
* Fix #124: Lingering processes in process group when session leader
exits. E.g., lingering `logit` processes when parent dies
* Fix: update inetd service args on config change. Found and fixed by
Petrus Hellgren, Westermo
* Fix service name matching, e.g. for condition handling, may match with
wrong service, by Jonas Holmberg, Westermo
* Run all run-parts scripts using `/bin/sh -c foo` just like the standard
Expand Down
15 changes: 0 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ AC_ARG_ENABLE(redirect,
AS_HELP_STRING([--enable-redirect], [Redirect service output to /dev/null, default: no]),,[
enable_redirect_output=no])

AC_ARG_ENABLE(inetd,
AS_HELP_STRING([--disable-inetd], [Disable built-in inetd super server, default enabled]),,[
enable_inetd=yes])

AC_ARG_ENABLE(logit,
AS_HELP_STRING([--disable-logit], [Disable logit, used for log redirection, default: enable]),,[
enable_logit=yes])
Expand All @@ -99,11 +95,6 @@ enable_all_plugins=auto
AC_PLUGIN([alsa-utils], [no], [Save and restore ALSA sound settings using alsactl])
AC_PLUGIN([dbus], [no], [Setup and start system message bus, D-Bus])
AC_PLUGIN([hotplug], [yes], [Setup and start udev or mdev hotplug daemon])
AC_PLUGIN([inetd-echo], [no], [Inetd plugin: echo server, RFC862])
AC_PLUGIN([inetd-chargen], [no], [Inetd plugin: character generator, RFC864])
AC_PLUGIN([inetd-daytime], [no], [Inetd plugin: daytime server, RFC867])
AC_PLUGIN([inetd-discard], [no], [Inetd plugin: discard server, RFC863])
AC_PLUGIN([inetd-time], [no], [Inetd plugin: time (rdate) server, RFC868])
AC_PLUGIN([modules-load], [no], [Scans /etc/modules-load.d for modules to load])
AC_PLUGIN([resolvconf], [no], [Setup necessary files for resolvconf])
AC_PLUGIN([x11-common], [no], [Console setup (for X)])
Expand Down Expand Up @@ -174,10 +165,6 @@ AS_IF([test "x$enable_redirect" = "xyes"], [
AC_DEFINE(REDIRECT_OUTPUT, 1, [Enable redirection of service output to /dev/null])])

### Disable features ###########################################################################
AS_IF([test "x$enable_inetd" != "xno"], [
enable_inetd="yes"
AC_DEFINE(INETD_ENABLED, 1, [Enable built-in inetd])])

AS_IF([test "x$enable_logit" != "xno"], [
AC_DEFINE(LOGIT_ENABLED, 1, [Enable logit tool, used for log redirection by Finit])])

Expand Down Expand Up @@ -232,7 +219,6 @@ AS_IF([test "x$with_random_seed" != "xno"], [

# Control build with automake flags
AM_CONDITIONAL(STATIC, [test "x$enable_static" = "xyes"])
AM_CONDITIONAL(INETD, [test "x$enable_inetd" = "xyes"])
AM_CONDITIONAL(WATCHDOGD, [test "x$enable_watchdog" = "xyes"])
AM_CONDITIONAL(LOGIT, [test "x$enable_logit" = "xyes"])
AM_CONDITIONAL(DOC, [test "x$enable_doc" = "xyes"])
Expand Down Expand Up @@ -278,7 +264,6 @@ Behavior:
Optional features:
Install doc/..........: $enable_doc
Install contrib/......: $enable_contrib
Built-in inetd........: $enable_inetd
Built-in watchdogd....: $enable_watchdog
Built-in logrotate....: $enable_logrotate
Scripting tool logit..: $enable_logit
Expand Down
44 changes: 0 additions & 44 deletions plugins/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,6 @@ if BUILD_HOTPLUG_PLUGIN
libplug_la_SOURCES += hotplug.c
endif

if INETD
if BUILD_INETD_ECHO_PLUGIN
libplug_la_SOURCES += echo.c
endif

if BUILD_INETD_CHARGEN_PLUGIN
libplug_la_SOURCES += chargen.c
endif

if BUILD_INETD_DAYTIME_PLUGIN
libplug_la_SOURCES += daytime.c
endif

if BUILD_INETD_DISCARD_PLUGIN
libplug_la_SOURCES += discard.c
endif

if BUILD_INETD_TIME_PLUGIN
libplug_la_SOURCES += time.c
endif
endif

if BUILD_MODULES_LOAD_PLUGIN
libplug_la_SOURCES += modules-load.c
endif
Expand Down Expand Up @@ -70,28 +48,6 @@ if BUILD_HOTPLUG_PLUGIN
pkglib_LTLIBRARIES += hotplug.la
endif

if INETD
if BUILD_INETD_ECHO_PLUGIN
pkglib_LTLIBRARIES += echo.la
endif

if BUILD_INETD_CHARGEN_PLUGIN
pkglib_LTLIBRARIES += chargen.la
endif

if BUILD_INETD_DAYTIME_PLUGIN
pkglib_LTLIBRARIES += daytime.la
endif

if BUILD_INETD_DISCARD_PLUGIN
pkglib_LTLIBRARIES += discard.la
endif

if BUILD_INETD_TIME_PLUGIN
pkglib_LTLIBRARIES += time.la
endif
endif

if BUILD_MODULES_LOAD_PLUGIN
pkglib_LTLIBRARIES += modules-load.la
endif
Expand Down
120 changes: 0 additions & 120 deletions plugins/chargen.c

This file was deleted.

102 changes: 0 additions & 102 deletions plugins/daytime.c

This file was deleted.

Loading

0 comments on commit e88a9b1

Please sign in to comment.