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