shutdown: push all output through a cyclic buffer.
[oweals/dinit.git] / TODO
1 For version 0.2.0:
2 ------------------
3 * Load services from several different directories, with an order of precedence,
4   to allow for packaged service descriptions and user-modified service
5   descriptions.
6 * Make default control socket location build-time configurable
7   
8 For version 1.0:
9 ----------------
10 * Support S6-style startup notification (write to fd)
11 * Man pages for all programs (done for dinit, not for dinitctl/shutdown/etc).
12 * Write wtmp entry on startup (see simpleinit)
13 * "triggered" service type: external process notifies Dinit when the service
14   has started. (maybe?)
15 * on shutdown, after repeated intervals with no activity, display information
16   about services we are waiting on (or, do this when prompted via ^C or C-A-D).
17 * A (perhaps limited) way(s) to modify a service description after it is loaded -
18   eg add/remove dependencies, change properties.
19 * Think about detecting runs-on-console dependency conflicts (i.e. if A runs-on-console and
20   B depends on A and runs-on-consle then B can never start).
21 * Documentation must be complete (see section below).
22   
23
24 For later:
25 ----------
26 * On linux when running with PID != 1, write PID to /proc/sys/kernel/cad_pid so
27   that we still receive SIGINT from ctrl+alt+del (must be done after /proc is
28   mounted, possibly could be left to a service script)
29 * Perhaps need a way to prevent script services from re-starting.
30   (eg there's no need to mount filesystems twice; there might be various other
31    system initialisations that can't or shouldn't really be "undone" and so do
32    not need to be re-done).
33 * Internationalisation
34 * A service can prevent shutdown/reboot by failing to stop. Maybe make
35   multiple CTRL-ALT-DEL presses (or ^C since that's more portable) commence
36   immediate shutdown (or launch a simple control interface).
37 * When we take down a service or tty session, it would be ideal if we could kill
38   the whole process tree, not just the leader process (need cgroups or pid
39   namespace or other mechanism).
40 * Allow logging tasks to memory (growing or circular buffer) and later
41   switching to disk logging (allows for filesystem mounted readonly on boot).
42   But perhaps this really the responsibility of another daemon.
43 * Allow running services with different resource limits, chroot, cgroups,
44   namespaces (pid/fs/uid), etc
45
46 Even later / Maybe never:
47 -------------------------
48 * Support recognising /etc/init.d services automatically (as script services, with
49   no dependency management - or upstart compatible dependency management)
50   Also BSD's rc.d style scripts (PROVIDE, REQUIRE).
51 * Place some reasonable, soft limit on the number of services to be started
52   simultaneously, to prevent thrashing. Services that are taking a long time
53   to start don't count to the limit. Maybe use CPU/IO usage as a controlling
54   factor.
55 * Cron-like tasks (if started, they run a sub-task periodically. Stopping the
56   task will wait until the sub-task is complete). 
57 * Allow to run services attached to virtual tty, allow connection to that tty (ala "screen").
58 * SystemD-like handling of filesystem mounts (see autofs documentation in kernel)
59   i.e. a mount point gets an autofs attached, and lazily gets mounted when accessed
60   (or is mounted in parallel). Probably put the functionality in a separate daemon.
61
62
63 Documentation:
64 --------------
65 * Design philosophy/rationale document
66 * Coding style guidelines
67
68 * What's the best TERM setting? gogetty gives me "linux" but I think other variants may be
69   better (eg "linux-c").
70
71 * Figure out the ConsoleKit/logind / PolicyKit mess & how dinit needs to fit into it.
72   * Consolekit/logind tracks "sessions". Provides a mechanism to mark a session starting,
73     associates processes with sessions, provides calls to terminate sessions etc (why?!!)
74     Can use environment variable or cgroups to track processes in a session.
75     A PAM module exists to create/destroy sessions.
76   * Consolekit/logind also allows for requesting shutdown, reboot, and inhibiting reboot
77     (via dbus API).
78   * "seats" are a set of input/output hardware (mouse/keyboard/monitor) on which a session
79     can be run. You can have multiple sessions on a seat - one is in the foreground
80     (eg linux virtual ttys implement multiple sessions on a single seat).
81     Sessions can run without a seat (eg ssh session).