Additional comment to better explain two-phase service transition.
[oweals/dinit.git] / TODO
1 * shutdown command presently hangs if terminal output blocked (scroll lock
2   via ^S). Should use a buffer as dinit does, and pipe output from subcommands
3   via the buffer too - if the buffer becomes full, discard subcommand output
4   and continue to consume it.
5
6 For version 1.0:
7 ----------------
8 * Man pages for all programs (done for dinit, not for dinitctl/shutdown/etc).
9 * Write wtmp entry on startup (see simpleinit)
10 * "triggered" service type: external process notifies Dinit when the service
11   has started.
12 * Some way to specify environment (perhaps a common environment for all
13   processes)
14 * Load services from several different directories, with an order of precedence,
15   to allow for packaged service descriptions and user-modified service
16   descriptions.
17 * on shutdown, after repeated intervals with no activity, display information
18   about services we are waiting on.
19
20 For later:
21 ----------
22 * On linux when running with PID != 1, write PID to /proc/sys/kernel/cad_pid so
23   that we still receive SIGINT from ctrl+alt+del (must be done after /proc is
24   mounted, possibly could be left to a service script)
25 * Perhaps need a way to prevent script services from re-starting.
26   (eg there's no need to mount filesystems twice; there might be various other
27    system initialisations that can't or shouldn't really be "undone" and so do
28    not need to be re-done).
29 * Internationalisation
30 * More logging options. Can currently log to syslog only (well, with the
31   syslog protocol, to /dev/log). Possibly should be able to log directly
32   to a file, or input stream of another process.
33 * A service can prevent shutdown/reboot by failing to stop. Maybe make
34   multiple CTRL-ALT-DEL presses (or ^C since that's more portable) commence
35   immediate shutdown (or launch a simple control interface).
36 * Interruptible scripted services - where it's ok to terminate the start
37   script with a signal (and return the service to the STOPPED state). So a long-
38   running filesystem check, for instance, need not hold up shutdown.
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 * Investigate using cn_proc netlink connector (cn_proc.h) to receive process
43   termination events even when running with PID != 1 (Linux only).
44   Also, there is the possibility of having a small, simple PID-1 init which
45   sends terminated process IDs over a pipe to Dinit. Finally, it may be possible
46   to run dinit (and subprocesses) in a new PID namespace (again linux-only).
47 * Allow logging tasks to memory (growing or circular buffer) and later
48   switching to disk logging (allows for filesystem mounted readonly on boot).
49   But perhaps this really the responsibility of another daemon.
50 * Allow running services with different resource limits, chroot, cgroups,
51   namespaces (pid/fs/uid), etc
52 * Make default control socket location build-time configurable
53 * Allow specifying a timeout for killing services; if they don't die within
54   the timeout (after a TERM) then hit them with a KILL.
55 * A (perhaps limited) way(s) to modify a service description after it is loaded -
56   eg add/remove dependencies, change properties.
57 * Think about detecting runs-on-console dependency conflicts (i.e. if A runs-on-console and
58   B depends on A and runs-on-consle then B can never start).
59
60 Even later / Maybe never:
61 * Support recognising /etc/init.d services automatically (as script services, with
62   no dependency management - or upstart compatible dependency management)
63   Also BSD's rc.d style scripts (PROVIDE, REQUIRE).
64 * Place some reasonable, soft limit on the number of services to be started
65   simultaneously, to prevent thrashing. Services that are taking a long time
66   to start don't count to the limit. Maybe use CPU/IO usage as a controlling
67   factor.
68 * Cron-like tasks (if started, they run a sub-task periodically. Stopping the
69   task will wait until the sub-task is complete). 
70 * Allow to run services attached to virtual tty, allow connection to that tty (ala "screen").
71 * SystemD-like handling of filesystem mounts (see autofs documentation in kernel)
72   i.e. a mount point gets an autofs attached, and lazily gets mounted when accessed
73   (or is mounted in parallel). Probably put the functionality in a separate daemon.
74
75
76 Documentation:
77 * Design philosophy/rationale document
78 * Coding style guidelines
79
80 * What's the best TERM setting? gogetty gives me "linux" but I think other variants may be
81   better (eg "linux-c").
82
83 * Figure out the ConsoleKit/logind / PolicyKit mess & how dinit needs to fit into it.
84   * Consolekit/logind tracks "sessions". Provides a mechanism to mark a session starting,
85     associates processes with sessions, provides calls to terminate sessions etc (why?!!)
86     Can use environment variable or cgroups to track processes in a session.
87     A PAM module exists to create/destroy sessions.
88   * Consolekit/logind also allows for requesting shutdown, reboot, and inhibiting reboot
89     (via dbus API).
90   * "seats" are a set of input/output hardware (mouse/keyboard/monitor) on which a session
91     can be run. You can have multiple sessions on a seat - one is in the foreground
92     (eg linux virtual ttys implement multiple sessions on a single seat).
93     Sessions can run without a seat (eg ssh session).