Combine start/stop queues, and add propagation queue.
[oweals/dinit.git] / TODO
1 For version 1.0:
2 ----------------
3 * Documentation including sample service definitions
4   - Man pages
5 * Better error handling, logging of errors (largely done, still some patches
6   of code where it may be missing - check TODO's in code).
7 * Write wtmp entry on startup (see simpleinit)
8 * Allow running services as a different UID
9 * Must be able to specify kill timeout (after which kill -9!)
10 * Must rate-limit restart of services. Trying to start at a greater rate
11   should trigger failed-to-start notification.
12 * "triggered" service type: external process notifies Dinit when the service
13   has started.
14
15 For later:
16 * On linux when running with PID != 1, write PID to /proc/sys/kernel/cad_pid so
17   that we still receive SIGINT from ctrl+alt+del (must be done after /proc is
18   mounted, possibly could be left to a service script)
19 * Perhaps need a way to prevent script services from re-starting.
20   (eg there's no need to mount filesystems twice; there might be various other
21    system initialisations that can't or shouldn't really be "undone" and so do
22    not need to be re-done).
23 * Internationalisation
24 * More logging options. Can currently log to syslog only (well, with the
25   syslog protocol, to /dev/log). Possibly should be able to log directly
26   to a file, or input stream of another process.
27 * A service can prevent shutdown/reboot by failing to stop. Maybe make
28   multiple CTRL-ALT-DEL presses (or ^C since that's more portable) commence
29   immediate shutdown (or launch a simple control interface).
30 * Interruptible scripted services - where it's ok to terminate the start
31   script with a signal (and return the service to the STOPPED state). So a long-
32   running filesystem check, for instance, need not hold up shutdown.
33 * When we take down a service or tty session, it would be ideal if we could kill
34   the whole process tree, not just the leader process.
35 * Investigate using cn_proc netlink connector (cn_proc.h) to receive process
36   termination events even when running with PID != 1 (Linux only).
37   Also, there is the possibility of having a small, simple PID-1 init which
38   sends terminated process IDs over a pipe to Dinit. Finally, it may be possible
39   to run dinit (and subprocesses) in a new PID namespace (again linux-only).
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 * Rate control on process respawn
44 * Allow running services with different resource limits, chroot, cgroups,
45   namespaces (pid/fs/uid), etc
46 * Make default control socket location build-time configurable
47 * Allow specifying a timeout for killing services; if they don't die within
48   the timeout (after a TERM) then hit them with a KILL.
49
50 Even later / Maybe never:
51 * Support recognising /etc/init.d services automatically (as script services, with
52   no dependency management - or upstart compatible dependency management)
53   Also BSD's rc.d style scripts (PROVIDE, REQUIRE).
54 * Place some reasonable, soft limit on the number of services to be started
55   simultaneously, to prevent thrashing. Services that are taking a long time
56   to start don't count to the limit. Maybe use CPU/IO usage as a controlling
57   factor.
58 * Cron-like tasks (if started, they run a sub-task periodically. Stopping the
59   task will wait until the sub-task is complete). 
60 * Allow to run services attached to virtual tty, allow connection to that tty (ala "screen").
61 * SystemD-like handling of filesystem mounts (see autofs documentation in kernel)
62   i.e. a mount point gets an autofs attached, and lazily gets mounted when accessed
63   (or is mounted in parallel). Probably put the functionality in a separate daemon.
64
65
66 Documentation:
67 * Design philosophy/rationale document
68 * Coding style guidelines
69
70 * What's the best TERM setting? gogetty gives me "linux" but I think other variants may be
71   better (eg "linux-c").
72
73 * Figure out the ConsoleKit/logind / PolicyKit mess & how dinit needs to fit into it.
74   * Consolekit/logind tracks "sessions". Provides a mechanism to mark a session starting,
75     associates processes with sessions, provides calls to terminate sessions etc (why?!!)
76     Can use environment variable or cgroups to track processes in a session.
77     A PAM module exists to create/destroy sessions.
78   * Consolekit/logind also allows for requesting shutdown, reboot, and inhibiting reboot
79     (via dbus API).
80   * "seats" are a set of input/output hardware (mouse/keyboard/monitor) on which a session
81     can be run. You can have multiple sessions on a seat - one is in the foreground
82     (eg linux virtual ttys implement multiple sessions on a single seat).
83     Sessions can run without a seat (eg ssh session).