blob: 260569f71f7b5840d6a137771c0f1c9c4c216a51 [file] [log] [blame]
Scott James Remnant6b667b12011-02-17 15:38:40 -080011.x series:
Scott James Remnantfd8a0432008-07-05 17:30:04 +01002
3 * going into runlevel S from !S, need to stty console
4 * going into 6, 0 or 1, need to stty console
5 * reset console before S process
6
Scott James Remnant9f175212009-07-14 18:45:47 +01007 * we should mark fds and sockets close-on-exec when we create them, rather
8 than later
9 * the fork() pipe should be close-on-exec rather than closing it in the
10 child
11
Scott James Remnantbf7399d2009-07-09 00:14:49 +010012 * init needs to grow "utmp XXX", which maintains INIT_PROCESS and
13 DEAD_PROCESS entries for the given ut_id (3 chars max), used for getty
Scott James Remnantfd8a0432008-07-05 17:30:04 +010014
Scott James Remnantbf7399d2009-07-09 00:14:49 +010015 For that we'll probably need to support ${..#...} so that we can do
16 utmp ${TTY#tty}
Scott James Remnantd25ffae2008-06-08 02:12:10 +010017
18 * There's a lot of complicated code that's pretty much duplicated between
19 event_pending_handle_jobs(), job_class_start(), job_class_stop(),
Scott James Remnantb40e4dd2008-06-08 03:26:36 +010020 job_class_restart(), job_class_get_instance() and to a lesser extent,
21 job_start(), job_stop() and job_restart(). We should make an effort to
22 reduce this to common functions, which may become easier as we rationalise
23 the behaviour anyway.
Scott James Remnantab132da2007-02-07 15:48:02 +000024
Scott James Remnante22f7a22008-06-07 01:36:43 +010025 * It may be useful to not just have failed=TRUE/FALSE for job_finished() but a
Scott James Remnant75f6fae2008-05-01 01:39:27 +010026 more detailed reason about why the job is being unblocked, so the command
27 could exit saying "ok", "failed", "stopped by event", etc.
28
Scott James Remnante22f7a22008-06-07 01:36:43 +010029 * It would also be nice, in the case of a job having failed, to be able
30 to include the event-like information in the error. This should be
31 possible, it just needs a marshalling function? (Maybe we should be able
32 to generate those)
33
Scott James Remnantbf7399d2009-07-09 00:14:49 +010034 * Information about what caused a job to stop (failed information or event)
35 should be available to other jobs, and to the job's post-stop script.
36
Scott James Remnant75f6fae2008-05-01 01:39:27 +010037 * I'm still not convinced that just clearing blocking is the right approach,
38 and still think we need some kind of next_blocking list of things that
39 will still be blocked next time around. Restores some of the older
40 behaviour in that "start" will block until stopped, and fail with the
41 fact it was stopped.
42
Scott James Remnant75f6fae2008-05-01 01:39:27 +010043 * Need to add dependencies to jobs, which are files that must exist before
44 the job can be started (because Debian/Ubuntu like to litter config files
45 like jobs)
Scott James Remnantcd157612007-03-03 17:09:09 +000046
Scott James Remnant75f6fae2008-05-01 01:39:27 +010047 * Resources, "uses cpu 1.0" -- where cpu has a defined max (default 1.0);
48 which state do we keep it in while it's waiting?
49
50
51Later:
52
Scott James Remnant02ee2002008-06-05 22:07:43 +010053 * Restore serialisation of state between upstart processes, I guess we'll
54 use a D-Bus API to do this. Most sense would be a peer-to-peer D-Bus
55 connection so don't need the bus (think initramfs), but we also need
56 to pass over the bus connection so we don't drop that.
57
58 - Pass the Event queue first since Jobs refer to it
59 - Register each ConfSource, ConfFile, JobClass and Job, setting
60 the status of each
61 - Join up the Event queue and Job structures
62
63 - What about commends blocked on event emissions or jobs?
64
Scott James Remnant75f6fae2008-05-01 01:39:27 +010065
66Anytime:
67
Scott James Remnantcd157612007-03-03 17:09:09 +000068 * Iterating through every Job's start and stop events is messy; we should
69 have some kind of match lookup table to make it easier.
70
71 * Likewise iterating through all the Jobs to find a pid is messy; we
Scott James Remnant75f6fae2008-05-01 01:39:27 +010072 should have a lookup table for these too. Ideally we'd have a JobProcess
73 structure combining type, pid and a link to the job -- then all the
74 job_process_* functions would just accept those
Scott James Remnantcd157612007-03-03 17:09:09 +000075
Scott James Remnant75f6fae2008-05-01 01:39:27 +010076 * system_setup_console is due for an overhaul as well; especially if
Scott James Remnante72695c2007-02-10 17:11:26 +000077 we want to be able to pass file descriptors in. Am somewhat tempted
78 to add a magic CONSOLE_DEFAULT option which tries fd, logging, null,
Scott James Remnantd25ffae2008-06-08 02:12:10 +010079 etc.
Scott James Remnante72695c2007-02-10 17:11:26 +000080
81 * We always want /dev/fd/NNN to be /dev/fd/3, we should have some way
82 to instruct process_spawn to do that.
83
Scott James Remnantcd157612007-03-03 17:09:09 +000084 * We may need to KILL scripts, e.g. post-start; especially when the goal
85 changes. Or perhaps just after a timeout?
86
87 * May need a way to force ignoring of the KILL signal, and assuming that
88 a job that won't die really has.
89
Scott James Remnantfef12b52006-08-25 16:16:45 +020090 * Get the LANG environment variable somehow.
Scott James Remnantddc3e282006-08-18 18:49:50 +010091
Scott James Remnant5fa15672006-08-09 23:23:17 +010092
Scott James Remnantfef12b52006-08-25 16:16:45 +020093Future Features:
Scott James Remnant5fa15672006-08-09 23:23:17 +010094
Scott James Remnant62f2d862008-03-03 02:13:19 +000095 * Roles; services define roles that they can perform ("web server") and
96 can be found by their role. Other jobs could require that a role be
97 performed for them to start (creeping into deps here). Use affinity
98 tags to work out which of many services to start.
Scott James Remnantd9619482007-06-10 22:11:42 +010099
Scott James Remnantfef12b52006-08-25 16:16:45 +0200100 * Per-user services; will need to use PAM to set up the session.
101 We want to do this for "root-user services" but not for jobs/tasks
Scott James Remnant5fa15672006-08-09 23:23:17 +0100102
Scott James Remnant62f2d862008-03-03 02:13:19 +0000103 * Passing of file descriptors from event over control socket.
Scott James Remnantfef12b52006-08-25 16:16:45 +0200104
Scott James Remnantdc6b5e42007-06-12 14:57:14 +0100105 * Register jobs over the control socket, ideal way is to register some kind
106 of automatic source and attach them to that.
Scott James Remnantfef12b52006-08-25 16:16:45 +0200107
108 * Temporal events ("15m after startup")
109
110 * Scheduled times ("every day at 3:00")
111
112 * Load average checking, maybe have separate CPU, Network and I/O
Scott James Remnant62f2d862008-03-03 02:13:19 +0000113 stats? See also resources.
Scott James Remnant853cc772006-08-16 13:34:51 +0100114
Scott James Remnantadfcc3f2007-02-03 12:24:07 +0000115 * Actions: "reload" and optional replacements for "stop", "start", etc.
Scott James Remnant3ee512d2007-03-08 14:30:21 +0000116
117 This is mostly just a matter of deciding policy for when they can be run,
118 and adding "user processes" onto the end of the job->process array.
119
120 * Alternative script interpreters; "start script python".
121
122 Would be done by making script a char *, and putting the interpreter into
123 command?
Scott James Remnantd055a9d2007-03-11 17:58:15 +0000124
Scott James Remnantfea1e9c2007-05-18 15:42:25 +0100125 * Watershed jobs (this actually might apply to events, since you might
126 want to try starting again if a particular event has come in since you
127 were last started)