Fix (remove) noexcept specification for init_log().
[oweals/dinit.git] / TODO
1 * BGPROCESS services:
2   - document security issue if pid file is not correctly protected (via access
3     rights/ownership).
4   - consider using ptrace to attach to process (if not a direct child - which we can
5     check with a probe waitpid() call); this allows us to get status of non-child
6     processes. Probably need dasynq changes.
7   - currently we break if the process is not a child; we'll never see it die. Even
8     if we don't attach with ptrace, we should waitpid()-probe it at stop (and then
9     potentially assume it's exited if we can't otherwise check).
10
11 * libev replacement:
12   - We've replaced libev, so that we don't abort on failure. But now exceptions
13     can be thrown when we register an event watch - need to handle these.
14   - Control socket handling needs to be reworked.
15   - Service I/O / child process waits need to be audited.
16
17 * Long-running "on console" services will back up the circular log buffer.
18   The buffer should just be flushed instead.
19 * When a PROCESS service process dies, and smooth_recovery is false, probably
20   need to force-stop dependents even if the process itself was stopped
21   deliberately.
22 * Complete control socket handling and protocol
23   - support for pinned-start and pinned-stop
24   - support for listing all services
25 * Implement a control utility to start/stop services after dinit has started
26   - very basic version exists, needs thorough cleanup
27
28 For version 1.0:
29 ----------------
30 * Log messages need to be duplicated to file (or to a logging process) once the
31   file system comes up read/write.
32 * Perhaps need a way to prevent script services from re-starting.
33   (eg there's no need to mount filesystems twice; there might be various other
34    system initialisations that can't or shouldn't really be "undone" and so do
35    not need to be re-done).
36 * Documentation including sample service definitions
37 * Better error handling, logging of errors (largely done, still some patches
38   of code where it may be missing).
39 * Write wtmp entry on startup (see simpleinit)
40 * Allow running services as a different UID
41 * On linux when running with PID != 1, write PID to /proc/sys/kernel/cad_pid so
42   that we still receive SIGINT from ctrl+alt+del (must be done after /proc is
43   mounted, possibly could be left to a service script)
44
45 For later:
46 * Internationalisation
47 * A service can prevent shutdown/reboot by failing to stop. Maybe make
48   multiple CTRL-ALT-DEL presses (or ^C since that's more portable) commence
49   immediate shutdown (or launch a simple control interface).
50 * Interruptible scripted services - where it's ok to terminate the start
51   script with a signal (and return the service to the STOPPED state). So a long-
52   running filesystem check, for instance, need not hold up shutdown.
53 * When we take down a service or tty session, it would be ideal if we could kill
54   the whole process tree, not just the leader process.
55 * Investigate using cn_proc netlink connector (cn_proc.h) to receive process
56   termination events even when running with PID != 1 (Linux only).
57   Also, there is the possibility of having a small, simple PID-1 init which
58   sends terminated process IDs over a pipe to Dinit. Finally, it may be possible
59   to run dinit (and subprocesses) in a new PID namespace (again linux-only).
60 * Allow logging tasks to memory (growing or circular buffer) and later
61   switching to disk logging (allows for filesystem mounted readonly on boot).
62   But perhaps this really the responsibility of another daemon.
63 * Rate control on process respawn
64 * Allow running services with different resource limits, chroot, cgroups,
65   namespaces (pid/fs/uid), etc
66 * Make default control socket location build-time configurable
67 * Allow specifying a timeout for killing services; if they don't die within
68   the timeout (after a TERM) then hit them with a KILL.
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).