Implement socket activation (single, unix-family socket only)
[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
8 For version 1.0:
9 ----------------
10 * Log messages are completely prevented from going to the console if the console
11   is being held by a service, meaning some can get lost. It would be better if
12   there was a (limited) buffer.
13 * Perhaps need a way to prevent script services from re-starting.
14   (eg there's no need to mount filesystems twice; there might be various other
15    system initialisations that can't or shouldn't really be "undone" and so do
16    not need to be re-done).
17 * Add command line arg to start in "PID 1" mode (even if PID != 1).
18   Basically, allow running as a system service monitor, without
19   requiring that dinit runs as PID 1.
20 * if PID != 1, choose a more sensible service definition directory
21   (something like $HOME/dinit.d)
22 * Documentation including sample service definitions
23 * Better error handling, logging of errors
24 * Write wtmp entry on startup (see simpleinit)
25 * Allow running services as a different UID
26
27 For later:
28 * When we take down a service or tty session, it would be ideal if we could kill
29   the whole process tree, not just the leader process.
30 * Investigate using cn_proc netlink connector (cn_proc.h) to receive process
31   termination events even when running with PID != 1 (Linux only).
32   Also, there is the possibility of having a small, simple PID-1 init which
33   sends terminated process IDs over a pipe to Dinit.
34 * Allow logging tasks to memory (growing or circular buffer) and later
35   switching to disk logging (allows for filesystem mounted readonly on boot)
36 * Rate control on process respawn
37 * Maybe re-implement "shutdown" ("halt", "reboot") from util-linux to better work
38   with dinit.
39 * Allow running services with different resource limits, chroot, cgroups,
40   namespaces (pid/fs/uid), etc
41 * Make default control socket location build-time configurable
42 * Allow specifying a timeout for killing services; if they don't die within
43   the timeout (after a TERM) then hit them with a KILL.
44
45 Even later:
46 * Support recognising /etc/init.d services automatically (as script services, with
47   no dependency management - or upstart compatible dependency management)
48   Also BSD's rc.d style scripts (PROVIDE, REQUIRE).
49 * Place some reasonable, soft limit on the number of services to be started
50   simultaneously, to prevent thrashing. Services that are taking a long time
51   to start don't count to the limit. Maybe use CPU/IO usage as a controlling
52   factor.
53 * Cron-like tasks (if started, they run a sub-task periodically. Stopping the
54   task will wait until the sub-task is complete). 
55 * Socket activation of services? Not sure if enough non-SystemD derived
56   daemons actually support this to warrant implementing it.
57 * Allow to run services attached to virtual tty, allow connection to that tty (ala "screen").
58 * SystemD-like handling of filesystem mounts (see autofs documentation in kernel)
59   i.e. a mount point gets an autofs attached, and lazily gets mounted when accessed
60   (or is mounted in parallel). Probably put the functionality in a separate daemon.
61
62
63 Documentation:
64
65 * What's the best TERM setting? gogetty gives me "linux" but I think other variants may be
66   better (eg "linux-c").
67
68 * Figure out the ConsoleKit/logind / PolicyKit mess & how dinit needs to fit into it.
69   * Consolekit/logind tracks "sessions". Provides a mechanism to mark a session starting,
70     associates processes with sessions, provides calls to terminate sessions etc (why?!!)
71     Can use environment variable or cgroups to track processes in a session.
72     A PAM module exists to create/destroy sessions.
73   * Consolekit/logind also allows for requesting shutdown, reboot, and inhibiting reboot
74     (via dbus API).
75   * "seats" are a set of input/output hardware (mouse/keyboard/monitor) on which a session
76     can be run. You can have multiple sessions on a seat - one is in the foreground
77     (eg linux virtual ttys implement multiple sessions on a single seat).
78     Sessions can run without a seat (eg ssh session).