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