Minor updates to Linux Dinit-as-init guidelines.
[oweals/dinit.git] / TODO
1 For version 0.6.0:
2 ------------------
3 * Refuse to start new services during shutdown [DONE].
4 * On service failure (all services stop when no restart issued), allow user to
5   interrupt/ctrl+alt+del when they are prompted to press enter, to allow halt/rebooting instead of
6   re-launching the boot service.  [DONE][ even better, you can now choose from several options! ]
7 * Basic resource limits setting. [DONE, mostly. OpenBSD compilation issues, others need testing].
8 * Per-service environment.
9 * Process start failure: track where in the launch process we get failure (i.e. we send errno over a pipe,
10   we should send a state value as well).
11
12 For version 0.7.0:
13 ------------------
14 * dinitctl: Warn when stopping a service would cause a dependent to stop. Require a force flag to proceed.
15 * dinitctl: implement "restart" command. 
16
17 For version 1.0:
18 ----------------
19 * "triggered" service type: external process notifies Dinit when the service
20   has started. (maybe?)
21 * on shutdown, after repeated intervals with no activity, display information
22   about services we are waiting on (or, do this when prompted via ^C or C-A-D).
23 * Documentation must be complete (see section below).
24 * Proper support for socket activation?
25 * Be able to boot and shutdown Linux and FreeBSD.
26
27 For later:
28 ----------
29 * On linux when running with PID != 1, write PID to /proc/sys/kernel/cad_pid so
30   that we still receive SIGINT from ctrl+alt+del (must be done after /proc is
31   mounted, possibly could be left to a service script)
32 * Perhaps need a way to prevent script services from re-starting.
33   (eg there's no need to mount filesystems twice; there might be various other
34    system initialisations that can't or shouldn't really be "undone" and so do
35    not need to be re-done).
36 * Internationalisation
37 * A service can prevent shutdown/reboot by failing to stop. Maybe make
38   multiple CTRL-ALT-DEL presses (or ^C since that's more portable) commence
39   immediate shutdown (or launch a simple control interface).
40 * When we take down a service or tty session, it would be ideal if we could kill
41   the whole process tree, not just the leader process (need cgroups or pid
42   namespace or other mechanism).
43 * Allow logging tasks to memory (growing or circular buffer) and later
44   switching to disk logging (allows for filesystem mounted readonly on boot).
45   But perhaps this really the responsibility of another daemon.
46 * Allow running services with different resource limits, chroot, cgroups,
47   namespaces (pid/fs/uid), etc
48 * Support chaining service output to another process (logger) input; if the
49   service dies the file descriptor of its stdout isn't closed and is reassigned
50   when the service is restarted, so that minimal output is lost.
51   - even more, it would be nice if a single logger process could be responsible
52     for receiving output from multiple services. This would require some kind of
53     protocol for passing new output descriptors to the logger (for when a
54     service starts).
55
56 Even later / Maybe never:
57 -------------------------
58 * Support recognising /etc/init.d services automatically (as script services, with
59   no dependency management - or upstart compatible dependency management)
60   Also BSD's rc.d style scripts (PROVIDE, REQUIRE).
61 * Place some reasonable, soft limit on the number of services to be started
62   simultaneously, to prevent thrashing. Services that are taking a long time
63   to start don't count to the limit. Maybe use CPU/IO usage as a controlling
64   factor.
65 * Cron-like tasks (if started, they run a sub-task periodically. Stopping the
66   task will wait until the sub-task is complete). 
67 * Allow to run services attached to virtual tty, allow connection to that tty (ala "screen").
68 * SystemD-like handling of filesystem mounts (see autofs documentation in kernel)
69   i.e. a mount point gets an autofs attached, and lazily gets mounted when accessed
70   (or is mounted in parallel). Probably put the functionality in a separate daemon.
71
72
73 Documentation:
74 --------------
75 * Design philosophy/rationale document
76 * Coding style guidelines
77
78 * What's the best TERM setting? gogetty gives me "linux" but I think other variants may be
79   better (eg "linux-c").
80
81 * Figure out the ConsoleKit/logind / PolicyKit mess & how dinit needs to fit into it.
82   * Consolekit/logind tracks "sessions". Provides a mechanism to mark a session starting,
83     associates processes with sessions, provides calls to terminate sessions etc (why?!!)
84     Can use environment variable or cgroups to track processes in a session.
85     A PAM module exists to create/destroy sessions.
86   * Consolekit/logind also allows for requesting shutdown, reboot, and inhibiting reboot
87     (via dbus API).
88   * "seats" are a set of input/output hardware (mouse/keyboard/monitor) on which a session
89     can be run. You can have multiple sessions on a seat - one is in the foreground
90     (eg linux virtual ttys implement multiple sessions on a single seat).
91     Sessions can run without a seat (eg ssh session).