Commit Graph
830 Commits
Author SHA1 Message Date
Joachim Nilsson bc84d66018 Allow conditions for tasklets and runlets as well
The introduction of conditions to Finit only focused on
services (monitored daemons) and not parallell one-shot
tasks or blocking one-shot runs.

This patch enables condition support for 'task' and 'run'
stanzas in both finit.conf and finit.d

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 11:47:21 +02:00
Joachim Nilsson 2216923343 Minor whitespace fixes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 11:43:09 +02:00
Joachim Nilsson ac834cfa1c I am the reaper of lost children ...
... but let's keep it quiet, OK?

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 01:16:51 +02:00
Joachim Nilsson f191266a33 Add --with-random-seed to enable urandom plugin
By default the urandom plugin will use /var/lib/misc/random-seed across
reboots to seed /dev/urandom at boot.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 00:41:23 +02:00
Joachim Nilsson 796275af62 HowTo: Finit on Alpine Linux 3.4
Mini HowTo with config files :)

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 00:29:49 +02:00
Joachim Nilsson a7e52914d2 Set a default description for all services
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 00:08:56 +02:00
Joachim Nilsson fcfbd57ca8 With 'log' keyword, always log process name
Do not tag log messages with service description, but use process name.
Possibly add :ID later to denote instance if multiple instances exist.

Also, add priority daemon.info log level.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-20 19:59:27 +02:00
Joachim Nilsson 5b81d14e51 x11-common: If restorecon exists, run it
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-20 19:58:42 +02:00
Joachim Nilsson 329af172de Fix default GREET
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-20 19:58:21 +02:00
Joachim Nilsson 33ce1592c1 bootmisc: Create /var/log/wtmp and lastlog too
Set correct permission bits, the utmp group must have write permission.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-20 19:57:39 +02:00
Joachim Nilsson 7a954e3743 Run user network start script cleanly
If user has no start script fall back to set up at least loopback.  This
fixes (at least) a problem on Alpine Linux where `ifup -a` returns error
if `lo` is already up.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-20 18:27:11 +02:00
Joachim Nilsson 48c2937f4f Simplify bootstrap message for rc.local start
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-20 18:24:30 +02:00
Joachim Nilsson 24961eb3ba Minor grammar fix in bootstrap message
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-20 17:30:36 +02:00
Joachim Nilsson aced97c2e6 Handle systems with new /run tmpfs
Modern systems today use a RAM disk for /run and /run/lock, with
symlinks to the FHS locations in /var/run and /var/lock.  See the
following link for details http://lwn.net/Articles/436012/

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-20 17:30:29 +02:00
Joachim Nilsson a67350ebf6 Little bit more careful with init/telinit symlinks
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-19 17:00:40 +02:00
Joachim Nilsson c47a0cd812 Conditionalize 'rlimit rttime', not available yet on musl libc
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-19 15:56:49 +02:00
Joachim Nilsson 67c0d43912 Merge branch 'refactor-readme'
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 20:26:11 +02:00
Joachim Nilsson 7b00969f6c Merge remote-tracking branch 'origin/inetd-plugins'
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 20:25:36 +02:00
Joachim Nilsson 875080d1e1 Minor update
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 17:30:56 +02:00
Joachim Nilsson 1121965167 Do not build inetd plugins if inetd is disabled
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 17:30:29 +02:00
Joachim Nilsson 45bdadebb6 Minor cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 17:30:14 +02:00
Joachim Nilsson 7dfdc2395b Add protection against UDP inetd looping attacks
This patch adds protection against a common inetd attack vector wherein
the reply port to UDP inetd services is forged to an internal inetd
service port.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 17:27:37 +02:00
Joachim Nilsson 5723b2e75b Refactor RFC 868, time protocol plugin
- Always do a dummy read to get peer address.
- Refactor to new format used by other built-ins

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 12:28:40 +02:00
Joachim Nilsson d4fdf50636 Add optional support for RFC867, Daytime Protocol
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 12:06:59 +02:00
Joachim Nilsson 4f7366640b Add optional support for RFC864, Character Generator Protocol
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 11:48:04 +02:00
Joachim Nilsson 90497af7bb Add optional support for RFC863, Discard Protocol
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-18 09:55:19 +02:00
Joachim Nilsson cd0983a7f6 First draft of README refactor and split
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-15 15:52:19 +02:00
Joachim Nilsson c7573fedad Replace 'initctl emit <EV>' with 'initctl cond <cmd> <COND>'
This patch replaces the old 'initctl emit <EV>' idea with a more
full blown condition generator:

    initctl cond <set|clear|flux> <COND>

This aligns better with terminology used elsewhere in the new Finit
service state machine and dependency handling already documented.

The 'flux' sub-command is mostly intended for simulation/test of
Finit itself and should perhaps not be documented.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-15 15:51:57 +02:00
Joachim Nilsson 2b74fb0e93 Minor cleanup and corrections for new terminology
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-15 15:51:57 +02:00
Joachim Nilsson eb57457522 Document /etc/rc.local support
- Document /etc/rc.local support
- Update documentation around runparts(8)

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-15 13:53:10 +02:00
Joachim Nilsson f0cda83d24 Clean up AC_ARG_WITH and use config.h also for default paths
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-15 13:17:09 +02:00
Joachim Nilsson fbacae7071 Minor cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-15 13:17:09 +02:00
Joachim Nilsson 48e2cbd183 Add convenient SysV init /etc/rc.local compat
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-15 13:17:09 +02:00
Joachim Nilsson 8f9ea0ae57 Fix stupid spelling error
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-15 08:41:06 +02:00
Joachim Nilsson 1c0776b818 Tie in service and condition documents with README
This is a first effort at cleaning up and consolidating all information
about the new service state machine and how conditions control this
state machine.

Also, clarified and added sections for all documents regarding how
services and conditions relate.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-14 16:08:44 +02:00
Joachim Nilsson 6ff9cb2ff3 Rename condition net/gw --> net/route/default in netlink plugin
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-14 15:41:47 +02:00
Joachim Nilsson fbef03a4c6 Update Inetd features and service dependencies
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-14 10:03:19 +02:00
Joachim Nilsson 66f22a0a5f Add syntax highlighting helpers for Emacs
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-14 09:52:22 +02:00
Joachim Nilsson 171ae7dc85 Add support for disabling the Netlink plugin
Some vendors provide their own Netlink plugin to Finit.  This patch
makes it possible to disable the default netlink plugin from being
built.  However, even before this patch it was possible to overload
the plugin.  This just discards it from being built.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-13 13:23:07 +02:00
Joachim Nilsson ebfa8f061c Fix default handling in M4 macro AC_PLUGIN()
The AC_PLUGIN() could not properly handle if a plugin is to be enabled
by default.  This patch adds support for outputting the correct help
text.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-13 13:20:56 +02:00
Joachim Nilsson 2baa4f8ea9 Followup to 38203ab, remove queue.h from Makefile as well
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-13 13:07:28 +02:00
Joachim Nilsson 38203ab9e8 Migrate to libite version (newer) of BSD queue.h
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-12 15:34:52 +02:00
Joachim Nilsson 88a4ebf9e7 Use <> instead of "" for external header includes
Libraries and system headers should be included with <> instead of "".
This makes a great difference for the automatic dependency tracking.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-12 15:32:36 +02:00
Joachim Nilsson 51f61939da Do not build insecure inetd time (rdate) plugin by default
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-12 13:36:47 +02:00
Joachim Nilsson 7262a25c85 Merge pull request #34 from troglobit/echo
Basic inetd echo server support and bugfix

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-12 12:38:14 +02:00
Joachim Nilsson 8b9309ee41 Fix regression in starting internal inetd services
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-12 12:24:28 +02:00
Joachim Nilsson affc6a97b9 Add support for inetd RFC862 echo server
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-12 09:58:25 +02:00
Joachim Nilsson ec041b3c02 Update configure and build section
Prune standard configure flags and focus on the most important, whatever
they may be.  Mention --disable-inetd and describe how --enable-static
works.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-09 12:38:45 +02:00
Joachim Nilsson 267eeb9692 Fix --enable-static build, only C library shared
This patch fixes regressions in --enable-static introduced with the
conversion to the GNU configure and build system.

The default link flag to libtool is set to -static-libtool-libs, meaning
not a fully static build -- the C library will still be used as an .so
which is usually what people want -- whereas libite (-lite) and libuEv
are linked statically.

$ ldd /sbin/finit /sbin/initctl
/sbin/finit:
	linux-vdso.so.1 =>  (0x00007ffffde62000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6979ad8000)
	/lib64/ld-linux-x86-64.so.2 (0x000055d893e96000)
/sbin/initctl:
	linux-vdso.so.1 =>  (0x00007ffed0dd6000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007feb3a29c000)
	/lib64/ld-linux-x86-64.so.2 (0x00005556ebd2b000)

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-09 12:14:21 +02:00
Joachim Nilsson 58e00fe52e Fix #17: Mention kernel CONFIG_UEVENT_HELPER_PATH and /etc/fstab
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-09 11:15:33 +02:00