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