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