Move to asynchronous handling of child exec status.
[oweals/dinit.git] / TODO
1 * License
2 * Complete control socket handling and protocol
3   - support for pinned-start and pinned-stop
4   - support for listing all services
5 * Implement a control utility to start/stop services after dinit has started
6   - very basic version exists, needs thorough cleanup
7 * Service rollback (for shutdown/reboot etc) should unpin pinned-started services.
8
9 For version 1.0:
10 ----------------
11 * Think about shutdown. TTY services:
12    - potentially don't respond to SIGTERM (eg interactive bash doesn't, though it
13      does to SIGHUP) or even any signal other than SIGKILL.
14    - but SIGKILL is a big hammer to wield immediately.
15    - termination timeouts could solve this.
16    - another way: the option to not wait for the process to terminate as a
17      per-service flag (or to wait for a limited time)
18    - ideally, we want to signal all processes in the session, not just the session
19      leader.
20 * Re-think handling of crashing daemons. If udevd crashes for example it should not
21   bring the whole system down. On the other hand udevd failing to start *should*
22   prevent the system from booting further.
23    - maybe make it possible to mark services as "once it's up it's up", so eg you
24      can mark loginready and/or tty services as such. These services will not
25      stop if their dependencies stop. On the other hand this subverts the dependency
26      system. ***  Now have this - "pinned started" state.
27    - Another possibility is to mark process services so that they will restart the
28      process without bringing the service itself down. (Maybe this should be the
29      default for auto-restart services anyway).
30    - Perhaps also need a way to prevent script services from re-starting.
31      (eg there's no need to mount filesystems twice).
32 * Add command line arg to start in "PID 1" mode (even if PID != 1).
33   Basically, allow running as a system service monitor, without
34   requiring that dinit runs as PID 1.
35 * if PID != 1, choose a more sensible service definition directory
36   (something like $HOME/dinit.d)
37 * Documentation including sample service definitions
38 * Better error handling, logging of errors
39 * Write wtmp entry on startup (see simpleinit)
40 * Allow running services as a different UID
41
42 For later:
43 * Allow logging tasks to memory (growing or circular buffer) and later
44   switching to disk logging (allows for filesystem mounted readonly on boot)
45 * Rate control on process respawn
46 * Maybe re-implement "shutdown" ("halt", "reboot") from util-linux to better work
47   with dinit.
48 * Allow running services with different resource limits, chroot, cgroups,
49   namespaces (pid/fs/uid), etc
50 * Make default control socket location build-time configurable
51 * Allow specifying a timeout for killing services; if they don't die within
52   the timeout (after a TERM) then hit them with a KILL.
53
54 Even later:
55 * Support recognising /etc/init.d services automatically (as script services, with
56   no dependency management - or upstart compatible dependency management)
57   Also BSD's rc.d style scripts (PROVIDE, REQUIRE).
58 * Place some reasonable, soft limit on the number of services to be started
59   simultaneously, to prevent thrashing. Services that are taking a long time
60   to start don't count to the limit. Maybe use CPU/IO usage as a controlling
61   factor.
62 * Cron-like tasks (if started, they run a sub-task periodically. Stopping the
63   task will wait until the sub-task is complete). 
64 * Socket activation of services? Not sure if enough non-SystemD derived
65   daemons actually support this to warrant implementing it.
66 * Allow to run services attached to virtual tty, allow connection to that tty (ala "screen").
67 * SystemD-like handling of filesystem mounts (see autofs documentation in kernel)
68   i.e. a mount point gets an autofs attached, and lazily gets mounted when accessed
69   (or is mounted in parallel). Probably put the functionality in a separate daemon.
70
71
72 Documentation:
73
74 * What's the best TERM setting? gogetty gives me "linux" but I think other variants may be
75   better (eg "linux-c").
76
77 * Figure out the ConsoleKit/logind / PolicyKit mess & how dinit needs to fit into it.
78   * Consolekit/logind tracks "sessions". Provides a mechanism to mark a session starting,
79     associates processes with sessions, provides calls to terminate sessions etc (why?!!)
80     Can use environment variable or cgroups to track processes in a session.
81     A PAM module exists to create/destroy sessions.
82   * Consolekit/logind also allows for requesting shutdown, reboot, and inhibiting reboot
83     (via dbus API).
84   * "seats" are a set of input/output hardware (mouse/keyboard/monitor) on which a session
85     can be run. You can have multiple sessions on a seat - one is in the foreground
86     (eg linux virtual ttys implement multiple sessions on a single seat).
87     Sessions can run without a seat (eg ssh session).