Minor fixes to rootfscheck script.
[oweals/dinit.git] / doc / COMPARISON
1 Comparison of Dinit with other supervision / init systems
2 =========================================================
3
4 This is intended to be an objective description of the differences between
5 Dinit and several other similar software packages. Due to a myriad of details,
6 it is difficult to provide a very meaningful comparison without going into
7 great detail (which this document does not). It does, however, serve as a
8 short survey of service supervision and init systems, and provides a starting
9 point for understanding the unique features of Dinit.
10
11
12 Systems without dependency management
13 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
14
15 A variety of init/supervision packages do not perform proper dependency management
16 of supervisions. By this I mean that, broadly speaking:
17  - starting a service should automatically start any services that the former
18    requires (and wait, if appropriate, until they have started)
19  - likewise, stopping a service should automatically stop any dependent services.
20
21 Dinit (and various other packages) perform dependency management. The following
22 packages do not:
23
24  * Daemontools (http://cr.yp.to/daemontools.html)
25  * Epoch (http://universe2.us/epoch.html)
26  * Finit (http://github.com/troglobit/finit)
27  * Minit (http://www.fefe.de/minit)
28  * Perp (http://b0llix.net/perp/)
29  * Runit (http://smarden.org/runit/)
30
31
32 Cinit (http://www.nico.schottelius.org/software/cinit)
33 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
34 An obscure init system which apparently offers portability and dependency
35 management, just as Dinit does. Development appears to have ceased some
36 time ago, unfortunately.
37
38
39 InitNG (http://initng.org/trac)
40 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
41 A highly modular init system which apparently offers dependency management
42 (as Dinit does). Portability status is unclear; may be Linux-only (Dinit
43 strives for portability). Development may have ceased (website is now showing
44 Japanese text which I am unable to read) although there are what looks like
45 maintenance commits in the Github repository at https://github.com/initng/initng.
46
47
48 Nosh (http://homepage.ntlworld.com/jonathan.deboynepollard/Softwares/nosh.html)
49 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
50 Another seemingly modular init system offering dependency management and socket
51 activation, with BSD licensing. Service configuration is expressed through
52 directory structure (symbolic links represent service dependencies, etc). It
53 provides a simple shell-like scripting language which can be used to describe
54 how to start services (and to control resource limits etc).
55
56 It was originally designed for BSD systems but works on Linux too (i.e. is
57 portable). It does not provide a D-Bus interface. Seemingly, this package addresses
58 most of the various complaints that have been levelled against SystemD. Compared to
59 Dinit, it favors chain-loading of smaller utilities to provide even more basic
60 functionality. By comparison Dinit tends to avoid starting additional processes by
61 design, expresses configuration in files and tracks state internally.
62
63 Nosh seems to be a quite mature system with a range of features that makes it
64 appear competitive, feature-wise, with Systemd, though without a lot of the
65 feature-creep extras that can easily be implemented separately.
66
67
68 OpenRC (Gentoo)
69 -=-=-=-=-=-=-=-
70 The OpenRC system used in Gentoo Linux is a dependency-managing service supervision
71 system with functionality that may similar in some respects to Dinit. According to
72 Wikipedia, it provides parallel startup of services (like Dinit).
73
74 It is difficult to find high-level documentation regarding the operation of OpenRC.
75 It seems that services must be specified via a shell script, and service
76 configuration (eg to specify dependencies) is also specified as part of the script.
77
78 Although the build system seems to have some support for BSD OSes, it did not
79 build successfully on OpenBSD when tested (revision 33d3f33).
80
81
82 S6-RC (http://skarnet.org/software/s6-rc/s6-rc.html)
83 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
84 S6-RC provides a dependency-management system over the top of the S6 supervision
85 system. Apparently it maintains most state on disk. S6-RC requires compiling the
86 complete set of service descriptions into a database. New services cannot be added
87 once the system is in operation, and service definitions cannot be changed in
88 general, except by re-compiling the database; S6-RC will then start any new
89 services as required (and stop any processes no longer considered part of an
90 active service).
91
92 S6 in general seems to follow the philosophy of breaking up functionality into smaller
93 parts and implementing these smaller parts as separate programs, wherever
94 practical. Thus, process supervision, log file management, and service management
95 are all separate programs.
96
97 In contrast, Dinit does not requires compiling service definitions, instead
98 loading and parsing them on-the-fly. Also, Dinit incorporates service
99 supervision and management into a single process. Some people may see
100 the more modularised nature of S6/S6-RC as an advantage of that system; I
101 personally feel that Dinit's one-process approach is not particularly
102 problematic and that the various functionality it provides is closely enough
103 related that splitting it into component processes would not be beneficial -
104 However, I can understand the other viewpoint.
105
106 S6-RC nicely manages chaining of service standard input/output, facilitating
107 setting up a logging chain where a logging process consumes the output of a
108 service, and either can be restarted while losing only minimal (if any)
109 output from the logs.
110
111 It appears that S6 supports only hard dependencies: that is if, a service depends
112 on another then that service must start, and stay running. Dinit supports a number
113 of dependency types including "soft" dependencies which allow the dependency to
114 stop or fail without necessarily stopping the dependent.
115
116
117 Systemd
118 -=-=-=-
119 Systemd is probably the most widely used init system on Linux as of the last year
120 or two. Compared to Dinit:
121  - Systemd provides a range of functionality not provided by Dinit, such as:
122    - setting priority and various other attributes of the service process that
123      Dinit does not support [yet].
124    - seat/session management
125    - syslogd replacement (or at least, partial replacement)
126    - ability to run tasks at certain times
127    - inetd replacement (lazily launch services to handle connection to IP ports)
128    - asynchronous filesystem check/mount
129    - control group (cgroup) / container management
130    - private tmp directories for services / login sessions
131    - system time management
132    Some of this functionality can be found in other daemons/packages which can be
133    be used to supplement the functionality of Dinit.
134  - Systemd running in "system" mode does not properly support running with a PID
135    other than 1 [1]. That is, it must replace /sbin/init. Systemd can however be run in
136    "user" mode where it (most likely) provides the same or greater level of functionality
137    as Dinit, though in a more complex package.
138  - Systemd exposes a D-Bus API. Dinit eschews D-Bus in favor of a compact custom protocol.
139  - Systemd makes no attempt to be portable to operating system kernels other than
140    Linux. The maintainers consider it infeasible to port to non-Linux-based OSes
141    and will refuse patches designed to do so [2]. Dinit, by comparison, strives to be
142    portable.
143
144 [1] http://freedesktop.org/software/systemd/man/systemd.html as at 18/11/2015
145 [2] http://freedesktop.org/wiki/Software/systemd/InterfacePortabilityAndStabilityChart/
146     as at 18/11/2015
147
148
149 Upstart (Ubuntu; http://upstart.ubuntu.com)
150 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
151 Upstart does not provide real dependency management; instead "events" (including services
152 starting or stopping) can be specified to trigger start/stop of other services. This is
153 backwards from the Dinit approach (and that taken by most dependency-managing supervision
154 systems) which allow the dependencies of a service to be specified declaratively. That is,
155 if service A depends on service B, Upstart is configured so as to start B whenever A starts
156 (and it's not possible, or at least not trival, to start A without also starting B).
157
158 Upstart apparently offers a D-Bus interface. Dinit eschews D-Bus in favour of a simple
159 custom control protocol.