Log system startup.
[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 * Load services from several different directories, with an order of precedence,
13   to allow for packaged service descriptions and user-modified service
14   descriptions.
15 * on shutdown, after repeated intervals with no activity, display information
16   about services we are waiting on.
17
18 For later:
19 ----------
20 * On linux when running with PID != 1, write PID to /proc/sys/kernel/cad_pid so
21   that we still receive SIGINT from ctrl+alt+del (must be done after /proc is
22   mounted, possibly could be left to a service script)
23 * Perhaps need a way to prevent script services from re-starting.
24   (eg there's no need to mount filesystems twice; there might be various other
25    system initialisations that can't or shouldn't really be "undone" and so do
26    not need to be re-done).
27 * Internationalisation
28 * More logging options. Can currently log to syslog only (well, with the
29   syslog protocol, to /dev/log). Possibly should be able to log directly
30   to a file, or input stream of another process.
31 * A service can prevent shutdown/reboot by failing to stop. Maybe make
32   multiple CTRL-ALT-DEL presses (or ^C since that's more portable) commence
33   immediate shutdown (or launch a simple control interface).
34 * Interruptible scripted services - where it's ok to terminate the start
35   script with a signal (and return the service to the STOPPED state). So a long-
36   running filesystem check, for instance, need not hold up shutdown.
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 * Investigate using cn_proc netlink connector (cn_proc.h) to receive process
41   termination events even when running with PID != 1 (Linux only).
42   Also, there is the possibility of having a small, simple PID-1 init which
43   sends terminated process IDs over a pipe to Dinit. Finally, it may be possible
44   to run dinit (and subprocesses) in a new PID namespace (again linux-only).
45 * Allow logging tasks to memory (growing or circular buffer) and later
46   switching to disk logging (allows for filesystem mounted readonly on boot).
47   But perhaps this really the responsibility of another daemon.
48 * Allow running services with different resource limits, chroot, cgroups,
49   namespaces (pid/fs/uid), etc
50 * Make default control socket location build-time configurable
51 * Allow specifying a timeout for killing services; if they don't die within
52   the timeout (after a TERM) then hit them with a KILL.
53 * A (perhaps limited) way(s) to modify a service description after it is loaded -
54   eg add/remove dependencies, change properties.
55 * Think about detecting runs-on-console dependency conflicts (i.e. if A runs-on-console and
56   B depends on A and runs-on-consle then B can never start).
57
58 Even later / Maybe never:
59 * Support recognising /etc/init.d services automatically (as script services, with
60   no dependency management - or upstart compatible dependency management)
61   Also BSD's rc.d style scripts (PROVIDE, REQUIRE).
62 * Place some reasonable, soft limit on the number of services to be started
63   simultaneously, to prevent thrashing. Services that are taking a long time
64   to start don't count to the limit. Maybe use CPU/IO usage as a controlling
65   factor.
66 * Cron-like tasks (if started, they run a sub-task periodically. Stopping the
67   task will wait until the sub-task is complete). 
68 * Allow to run services attached to virtual tty, allow connection to that tty (ala "screen").
69 * SystemD-like handling of filesystem mounts (see autofs documentation in kernel)
70   i.e. a mount point gets an autofs attached, and lazily gets mounted when accessed
71   (or is mounted in parallel). Probably put the functionality in a separate daemon.
72
73
74 Documentation:
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).