Don't try to stop an already stopped service.
[oweals/dinit.git] / TODO
1 For version 0.3.0:
2 ------------------
3 * Skippable services: if they terminate via ^C, treat as a successful startup. Allows
4   skipping filesystem checks.
5 * Provide better status information:
6   - whether a service failed to start (as opposed to just being STOPPED)
7     - directly, and how (error code? died to signal? timed out?) or
8     - due to a dependency.
9   - whether a service has acquired, or is waiting to acquire, the console
10   - whether service was skipped (via ^C/SIGINT) instead of started normally.
11 * Option to send signals to service process leader only (not to process group).
12   
13 For version 1.0:
14 ----------------
15 * Support S6-style startup notification (write to fd)
16 * Man pages for all programs (done for dinit, not for dinitctl/shutdown/etc).
17 * Write wtmp entry on startup (see simpleinit)
18 * "triggered" service type: external process notifies Dinit when the service
19   has started. (maybe?)
20 * on shutdown, after repeated intervals with no activity, display information
21   about services we are waiting on (or, do this when prompted via ^C or C-A-D).
22 * A (perhaps limited) way(s) to modify a service description after it is loaded -
23   eg add/remove dependencies, change properties.
24 * Think about detecting runs-on-console dependency conflicts (i.e. if A runs-on-console and
25   B depends on A and runs-on-consle then B can never start)?
26   - Complicated if service descriptions can be altered after loading. Perhaps not necessary
27     if better status information can be provided.
28 * Documentation must be complete (see section below).
29 * Package-manager-friendly way to enable/disable services.
30   Perhaps a service can specify a dependency file (with dependency type) where
31   the file contains a list of service names, or if it is a directory, each
32   filename within corresponds to a service that is a dependency.
33 * Proper support for socket activation?
34 * Be able to boot and shutdown Linux and FreeBSD.
35
36 For later:
37 ----------
38 * On linux when running with PID != 1, write PID to /proc/sys/kernel/cad_pid so
39   that we still receive SIGINT from ctrl+alt+del (must be done after /proc is
40   mounted, possibly could be left to a service script)
41 * Perhaps need a way to prevent script services from re-starting.
42   (eg there's no need to mount filesystems twice; there might be various other
43    system initialisations that can't or shouldn't really be "undone" and so do
44    not need to be re-done).
45 * Internationalisation
46 * A service can prevent shutdown/reboot by failing to stop. Maybe make
47   multiple CTRL-ALT-DEL presses (or ^C since that's more portable) commence
48   immediate shutdown (or launch a simple control interface).
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 * Allow logging tasks to memory (growing or circular buffer) and later
53   switching to disk logging (allows for filesystem mounted readonly on boot).
54   But perhaps this really the responsibility of another daemon.
55 * Allow running services with different resource limits, chroot, cgroups,
56   namespaces (pid/fs/uid), etc
57 * Support chaining service output to another process (logger) input; if the
58   service dies the file descriptor of its stdout isn't closed and is reassigned
59   when the service is restarted, so that minimal output is lost.
60   - even more, it would be nice if a single logger process could be responsible
61     for receiving output from multiple services. This would require some kind of
62     protocol for passing new output descriptors to the logger (for when a
63     service starts).
64
65 Even later / Maybe never:
66 -------------------------
67 * Support recognising /etc/init.d services automatically (as script services, with
68   no dependency management - or upstart compatible dependency management)
69   Also BSD's rc.d style scripts (PROVIDE, REQUIRE).
70 * Place some reasonable, soft limit on the number of services to be started
71   simultaneously, to prevent thrashing. Services that are taking a long time
72   to start don't count to the limit. Maybe use CPU/IO usage as a controlling
73   factor.
74 * Cron-like tasks (if started, they run a sub-task periodically. Stopping the
75   task will wait until the sub-task is complete). 
76 * Allow to run services attached to virtual tty, allow connection to that tty (ala "screen").
77 * SystemD-like handling of filesystem mounts (see autofs documentation in kernel)
78   i.e. a mount point gets an autofs attached, and lazily gets mounted when accessed
79   (or is mounted in parallel). Probably put the functionality in a separate daemon.
80
81
82 Documentation:
83 --------------
84 * Design philosophy/rationale document
85 * Coding style guidelines
86
87 * What's the best TERM setting? gogetty gives me "linux" but I think other variants may be
88   better (eg "linux-c").
89
90 * Figure out the ConsoleKit/logind / PolicyKit mess & how dinit needs to fit into it.
91   * Consolekit/logind tracks "sessions". Provides a mechanism to mark a session starting,
92     associates processes with sessions, provides calls to terminate sessions etc (why?!!)
93     Can use environment variable or cgroups to track processes in a session.
94     A PAM module exists to create/destroy sessions.
95   * Consolekit/logind also allows for requesting shutdown, reboot, and inhibiting reboot
96     (via dbus API).
97   * "seats" are a set of input/output hardware (mouse/keyboard/monitor) on which a session
98     can be run. You can have multiple sessions on a seat - one is in the foreground
99     (eg linux virtual ttys implement multiple sessions on a single seat).
100     Sessions can run without a seat (eg ssh session).