Scott James Remnant | 9c44a42 | 2007-02-03 12:17:14 +0000 | [diff] [blame] | 1 | 2007-02-03 Scott James Remnant <scott@netsplit.com> |
| 2 | |
Scott James Remnant | 2e204b7 | 2007-02-03 23:15:28 +0000 | [diff] [blame^] | 3 | * init/main.c (main): Being unable tp open the control socket, or |
| 4 | parse the configuration, should be a fatal error; stop being so |
| 5 | damned liberal! <g> Don't reset the signal state if we're |
| 6 | being restarted, as this loses any pending signals -- be happy |
| 7 | that our parent left them in a good state. Set SIGCHLD to the |
| 8 | standard handler, otherwise we might lose this before we start |
| 9 | the main loop (which does the same anyway). |
| 10 | (term_handler): Rework so we don't need to close and open the |
| 11 | control socket; instead we just close it in the child that's |
| 12 | going to send the state, and notify the parent that it's safe to |
| 13 | exec (which will cause it to be closed so the new init can open it). |
| 14 | |
Scott James Remnant | 3af8546 | 2007-02-03 18:31:54 +0000 | [diff] [blame] | 15 | * init/tests/test_control.c (test_open): Fix valgrind error |
| 16 | * init/tests/test_notify.c (test_subscribe): Fix valgrind error |
| 17 | |
Scott James Remnant | e443b9c | 2007-02-03 18:24:18 +0000 | [diff] [blame] | 18 | * init/notify.c (notify_subscribe): Make safe against ENOMEM. |
| 19 | * init/tests/test_notify.c (test_subscribe): Use TEST_ALLOC_FAIL |
| 20 | |
Scott James Remnant | 4b601d1 | 2007-02-03 18:20:00 +0000 | [diff] [blame] | 21 | * init/control.c: Add needed attributes; tidy up formatting. |
| 22 | (control_open): Don't let ENOMEM fail opening the control socket. |
| 23 | * init/control.h: Add needed attributes. |
| 24 | * init/tests/test_control.c (test_open): Test for failed allocation. |
| 25 | * init/main.c (term_handler): Make sure we catch failure to open |
| 26 | the control socket again. |
| 27 | |
Scott James Remnant | d308b43 | 2007-02-03 17:36:41 +0000 | [diff] [blame] | 28 | * TODO: Update |
| 29 | |
Scott James Remnant | 272938f | 2007-02-03 17:35:11 +0000 | [diff] [blame] | 30 | * init/cfgfile.c (cfg_watch_dir): Clean this up a bit; now we only |
| 31 | output a warning if inotify failed for any reason other than not |
| 32 | being supported AND walking worked. |
| 33 | |
Scott James Remnant | d78d00e | 2007-02-03 17:27:32 +0000 | [diff] [blame] | 34 | * init/cfgfile.c (cfg_watch_dir): Update to even newer watch API; |
| 35 | our create_handler is now always called if inotify is successful, |
| 36 | so we just need to fall back to walking the directory when it |
| 37 | isn't -- if inotify isn't supported, don't even bother complaining. |
| 38 | (cfg_create_modify_handler): Check the stat of the file visited to |
| 39 | make sure it's a regular file. |
| 40 | (cfg_visitor): Check the stat of the file visited to make sure it's |
| 41 | a regular file. |
| 42 | |
Scott James Remnant | bcbb112 | 2007-02-03 17:11:21 +0000 | [diff] [blame] | 43 | * init/cfgfile.c: Update include to upstart/enum.h |
| 44 | * init/job.c: Update include to upstart/enum.h |
| 45 | * init/job.h: Update include to upstart/enum.h |
| 46 | |
Scott James Remnant | 801f9e1 | 2007-02-03 17:10:06 +0000 | [diff] [blame] | 47 | * logd/main.c: Add attribute to open_logging |
| 48 | |
Scott James Remnant | cbd0cf8 | 2007-02-03 17:05:39 +0000 | [diff] [blame] | 49 | * util/initctl.c: Split out the command functions into new files; |
| 50 | * util/jobs.c: This gets the job-related commands |
| 51 | * util/events.h: This gets the event-related commands |
| 52 | * util/initctl.h, util/jobs.h, util/events.h: Headers |
| 53 | * util/tests/test_jobs.c: Test suite for job-related commands. |
| 54 | * util/tests/test_events.c: Test suite for event-related commands. |
| 55 | * util/Makefile.am (initctl_SOURCES): Add new files. |
| 56 | (TESTS): Build new test suites. |
| 57 | (test_jobs_SOURCES, test_jobs_LDFLAGS, test_jobs_LDADD): |
| 58 | Details for job-related commands test suite binary. |
| 59 | (test_events_SOURCES, test_events_LDFLAGS, test_events_LDADD): |
| 60 | Details for event-related commands test suite binary. |
| 61 | * TODO: Remove item about splitting initctl now we've done it. |
| 62 | |
Scott James Remnant | adfcc3f | 2007-02-03 12:24:07 +0000 | [diff] [blame] | 63 | * TODO: Big update; strip anything we have a spec for. |
| 64 | |
Scott James Remnant | 1157bbf | 2007-02-03 12:17:55 +0000 | [diff] [blame] | 65 | * upstart/message.c (upstart_message_handle): Make sure that if we |
| 66 | fail to parse a message, we don't leave strings around in memory. |
| 67 | * upstart/tests/test_message.c (test_open): Check that we get a |
| 68 | raised EADDRINUSE if we try an open a socket twice. |
| 69 | (test_handle): Add lots of checks for things like NULL names and |
| 70 | incomplete messages; as well as the obvious unknown message. |
| 71 | (test_reader): Make sure that errors while handling messages are |
| 72 | dealt with by logging it. |
| 73 | |
Scott James Remnant | 9c44a42 | 2007-02-03 12:17:14 +0000 | [diff] [blame] | 74 | * upstart/job.c, upstart/job.h, upstart/tests/test_job.c: Rename to |
| 75 | enum.c, enum.h and tests/test_enum.c; since this just includes enums |
| 76 | and convert functions really. |
| 77 | * upstart/Makefile.am: Update. |
| 78 | * upstart/libupstart.h: Update include. |
| 79 | * upstart/tests/test_message.c: Update include. |
| 80 | |
Scott James Remnant | 1e57ab2 | 2007-02-01 16:51:28 +0000 | [diff] [blame] | 81 | 2007-02-01 Scott James Remnant <scott@netsplit.com> |
| 82 | |
Scott James Remnant | 0f1d9b6 | 2007-02-01 18:20:00 +0000 | [diff] [blame] | 83 | * logd/main.c (main): Ensure we error if daemonise fails. |
| 84 | |
Scott James Remnant | 3691157 | 2007-02-01 18:18:27 +0000 | [diff] [blame] | 85 | * compat/sysv/shutdown.c (main): Ensure that signals and timers |
| 86 | are added, even if we run out of memory. |
| 87 | |
Scott James Remnant | 9b705ee | 2007-02-01 17:34:39 +0000 | [diff] [blame] | 88 | * upstart/tests/test_message.c: Change from assert to assert0 |
| 89 | * upstart/tests/test_wire.c: Change from assert to assert0 |
| 90 | * init/tests/test_notify.c: Change from assert to assert0 |
| 91 | * init/tests/test_control.c: nih_io_message_send should always return |
| 92 | a value greater than zero. |
| 93 | |
Scott James Remnant | 91c6eb7 | 2007-02-01 17:19:32 +0000 | [diff] [blame] | 94 | * upstart/tests/test_wire.c: Change to use assert instead of NIH_ZERO; |
| 95 | the rationale here is that in test cases we just want to fail, not |
| 96 | try again repeatedly. |
| 97 | * upstart/tests/test_message.c: Likewise. |
| 98 | |
Scott James Remnant | 9caf282 | 2007-02-01 17:04:34 +0000 | [diff] [blame] | 99 | * init/tests/test_control.c: Use assert to ensure we get the expected |
| 100 | return values of functions that raise errors. |
| 101 | * init/tests/test_notify.c: Use assert to ensure we get the expected |
| 102 | return values of functions that raise errors. |
| 103 | |
Scott James Remnant | 1e57ab2 | 2007-02-01 16:51:28 +0000 | [diff] [blame] | 104 | * init/cfgfile.c (cfg_watch_dir): Port to the new NihWatch API and |
| 105 | use nih_dir_walk(). This also fixes the long-standing bug where we |
| 106 | wouldn't watch the configuration directory if inotify was disabled. |
| 107 | Drop both the parent and prefix members for now, until we clean this |
| 108 | up later. |
| 109 | (cfg_create_modify_handler): Wrap cfg_read_job after figuring out |
| 110 | the job name. |
| 111 | (cfg_job_name): Function to figure out the job name from a path. |
| 112 | (cfg_visitor): Visitor function to handle initial parsing, figuring |
| 113 | out the job name; otherwise identical to the standard handler. |
| 114 | * init/cfgfile.h: Update prototype for cfg_watch_dir. |
| 115 | * init/main.c (main): Update call to cfg_watch_dir. |
| 116 | |
Scott James Remnant | bfd712d | 2007-01-31 12:13:25 +0000 | [diff] [blame] | 117 | 2007-01-31 Scott James Remnant <scott@netsplit.com> |
| 118 | |
| 119 | * upstart/tests/test_message.c: Use TEST_ALLOC_FAIL to make sure |
| 120 | allocations are handled properly. |
| 121 | |
Scott James Remnant | 4482847 | 2007-01-30 11:53:33 +0000 | [diff] [blame] | 122 | 2007-01-30 Scott James Remnant <scott@netsplit.com> |
| 123 | |
Scott James Remnant | 2cc3654 | 2007-01-30 17:12:34 +0000 | [diff] [blame] | 124 | * upstart/wire.c: Note that if any of the push functions fail, the |
| 125 | entire buffer should be discarded. |
| 126 | * upstart/tests/test_wire.c (test_push_int, test_push_unsigned) |
| 127 | (test_push_string, test_push_header, test_push_pack): Us |
| 128 | TEST_ALLOC_FAIL to ensure that failing to allocate memory is caught. |
| 129 | |
Scott James Remnant | 1084c68 | 2007-01-30 15:17:41 +0000 | [diff] [blame] | 130 | * upstart/tests/test_message.c (my_handler): Free the name and |
| 131 | description after checking; they aren't otherwise. |
| 132 | |
Scott James Remnant | dc8b329 | 2007-01-30 15:01:30 +0000 | [diff] [blame] | 133 | * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Consume |
| 134 | a copy of the va_list, so these can be called multiple times on the |
| 135 | same list without ill effect. |
| 136 | |
Scott James Remnant | 92d8744 | 2007-01-30 15:01:21 +0000 | [diff] [blame] | 137 | * upstart/message.h: Add warn_unused_result attributes to |
| 138 | upstart_message_handle and upstart_message_handle_using as they raise |
| 139 | errors. |
| 140 | |
Scott James Remnant | 2de2501 | 2007-01-30 14:57:27 +0000 | [diff] [blame] | 141 | * upstart/wire.c: push functions return negative values to indicate |
| 142 | insufficient memory. |
| 143 | * upstart/wire.h: Add warn_unused_result attributes to push functions |
| 144 | |
Scott James Remnant | 4ccebcf | 2007-01-30 14:51:17 +0000 | [diff] [blame] | 145 | * upstart/tests/test_message.c: Guard calls to nih_io_buffer_push and |
| 146 | nih_io_message_add_control with NIH_ZERO to ensure they succeed. |
| 147 | * upstart/tests/test_wire.c: Guard calls to nih_io_buffer_push |
| 148 | |
Scott James Remnant | 4482847 | 2007-01-30 11:53:33 +0000 | [diff] [blame] | 149 | * HACKING: Update from libnih with new Documentation, |
| 150 | Function Attributes and Test Cases sections. |
| 151 | |
Scott James Remnant | 16a286f | 2007-01-10 15:38:33 +0000 | [diff] [blame] | 152 | 2007-01-10 Scott James Remnant <scott@netsplit.com> |
| 153 | |
Scott James Remnant | de44301 | 2007-01-10 18:45:40 +0000 | [diff] [blame] | 154 | * init/main.c (crash_handler): s/SEGV/SIGSEGV/ |
| 155 | |
Scott James Remnant | 505f928 | 2007-01-10 18:44:38 +0000 | [diff] [blame] | 156 | * init/main.c (main): Rename variable |
| 157 | |
Scott James Remnant | 56a4d06 | 2007-01-10 17:33:39 +0000 | [diff] [blame] | 158 | * TODO: Update. |
| 159 | |
Scott James Remnant | 78626fb | 2007-01-10 16:48:10 +0000 | [diff] [blame] | 160 | * init/main.c (main): Change the way we clear the arguments; by |
| 161 | deleting just the final NULL terminator, we fool the kernel into |
| 162 | only returning one argument in cmdline. |
| 163 | |
Scott James Remnant | 16a286f | 2007-01-10 15:38:33 +0000 | [diff] [blame] | 164 | * init/main.c (segv_handler): Rename to crash_handler and handle |
| 165 | SIGABRT as well, so we can catch assertion errors. Of course, in |
| 166 | theory, with our high test converage this should never happen in |
| 167 | practice <chortle> |
| 168 | |
Scott James Remnant | 39ec35b | 2007-01-09 08:16:01 +0000 | [diff] [blame] | 169 | 2007-01-09 Scott James Remnant <scott@netsplit.com> |
| 170 | |
Scott James Remnant | 7f4db42 | 2007-01-09 20:51:08 +0000 | [diff] [blame] | 171 | * init/main.c (main): Clear arguments so that upstart only ever |
| 172 | appears as /sbin/init in ps, top, etc. |
| 173 | |
Scott James Remnant | 8fd06de | 2007-01-09 20:38:27 +0000 | [diff] [blame] | 174 | * TODO: Update. |
| 175 | |
Scott James Remnant | 4d0481d | 2007-01-09 20:38:07 +0000 | [diff] [blame] | 176 | * util/initctl.c: Add data pointer to functions and handle calls. |
| 177 | |
Scott James Remnant | bcf9e97 | 2007-01-09 20:34:47 +0000 | [diff] [blame] | 178 | * init/control.c: Add data pointer to all functions. |
| 179 | * init/tests/test_control.c: Pass data pointer to |
| 180 | upstart_message_handle_using() |
| 181 | * init/tests/test_notify.c: Pass data pointer to |
| 182 | upstart_message_handle_using() |
| 183 | |
Scott James Remnant | 6aa008c | 2007-01-09 20:26:44 +0000 | [diff] [blame] | 184 | * upstart/message.c (upstart_message_handle) |
| 185 | (upstart_message_handle_using): Add a data pointer argument to these |
| 186 | functions and pass it to the handler. |
| 187 | (upstart_message_reader): Pass the io structure's data pointer. |
| 188 | * upstart/message.h (UpstartMessageHandler): Add a data pointer to |
| 189 | the message handler. |
| 190 | * upstart/tests/test_message.c (test_handle, test_handle_using): |
| 191 | Pass a data pointer to the function call and check it's passed |
| 192 | to the handler correctly. |
| 193 | (test_reader): Check that the io data pointer gets passed. |
| 194 | |
Scott James Remnant | c7017d3 | 2007-01-09 18:44:58 +0000 | [diff] [blame] | 195 | * init/tests/test_cfgfile.c (test_stanza_console, test_stanza_env) |
| 196 | (test_stanza_umask, test_stanza_nice, test_stanza_limit): Finish off |
| 197 | the newer style test cases. |
| 198 | |
Scott James Remnant | e63ef80 | 2007-01-09 17:54:56 +0000 | [diff] [blame] | 199 | * init/cfgfile.c (cfg_stanza_console, cfg_stanza_umask) |
| 200 | (cfg_stanza_nice, cfg_stanza_limit, cfg_stanza_chroot) |
| 201 | (cfg_stanza_chdir): Guard against duplicate uses of the stanzas. |
| 202 | * init/tests/test_cfgfile.c (test_stanza_daemon) |
| 203 | (test_stanza_respawn): Check that neither daemon or respawn override |
| 204 | exec if they have no arguments. |
| 205 | (test_stanza_script): Add missing function |
| 206 | (test_stanza_chroot, test_stanza_chdir): Add tests for these simple |
| 207 | stanzas. |
| 208 | |
Scott James Remnant | 0cd393d | 2007-01-09 17:36:34 +0000 | [diff] [blame] | 209 | * init/cfgfile.c: Change remaining uses of nih_error_raise and |
| 210 | return to just nih_return_error. |
| 211 | |
Scott James Remnant | c352b63 | 2007-01-09 17:31:41 +0000 | [diff] [blame] | 212 | * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_daemon) |
| 213 | (cfg_stanza_respawn, cfg_stanza_script): Disallow duplicates, |
| 214 | both of command strings, scripts, limits and of just the flags. |
| 215 | * init/tests/test_cfgfile.c (test_stanza_exec) |
| 216 | (test_stanza_daemon, test_stanza_respawn, test_stanza_instance): |
| 217 | Check the behaviour of these stanzas. |
| 218 | |
Scott James Remnant | 94188d4 | 2007-01-09 16:43:58 +0000 | [diff] [blame] | 219 | * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop): Disallow |
| 220 | duplicate values for the script. |
| 221 | * init/tests/test_cfgfile.c (test_stanza_start, test_stanza_stop): |
| 222 | Test cases for those two functions. |
| 223 | |
Scott James Remnant | 474a6ff | 2007-01-09 16:17:49 +0000 | [diff] [blame] | 224 | * init/cfgfile.c (cfg_stanza_description, cfg_stanza_author) |
| 225 | (cfg_stanza_version): Don't allow stanza to be duplicated anymore. |
| 226 | * init/tests/test_cfgfile.c (test_stanza_description) |
| 227 | (test_stanza_author, test_stanza_version): Test cases for these |
| 228 | simple stanza; making sure duplication is not permitted. |
| 229 | (test_stanza_on): Add a test case for this stanza too. |
| 230 | |
Scott James Remnant | 49e8bb8 | 2007-01-09 15:57:59 +0000 | [diff] [blame] | 231 | * init/cfgfile.c (cfg_stanza_kill): Guard against duplicate uses |
| 232 | of the kill timeout stanza. |
| 233 | * init/tests/test_cfgfile.c (test_stanza_kill): Test the complex |
| 234 | kill stanza. |
| 235 | (test_stanza_pid): Check duplicate usage results in an error. |
| 236 | |
Scott James Remnant | 443ef2e | 2007-01-09 15:47:24 +0000 | [diff] [blame] | 237 | * init/job.h (Job): Rename pidfile to pid_file and binary to pid_binary |
| 238 | * init/job.c (job_new): Update names here too. |
| 239 | * init/errors.h: Add a new "duplicate value" error. |
| 240 | * init/cfgfile.c (cfg_read_job): Change name of variables, and catch |
| 241 | the duplicate value error to add the line number. |
| 242 | (cfg_stanza_pid): Change variable names, and clean this function up |
| 243 | a little. Make it an error to use a stanza more than once. |
| 244 | * init/tests/test_cfgfile.c (test_stanza_pid): Write a newer test |
| 245 | case function for the pid stanza. |
| 246 | |
Scott James Remnant | 34ff87d | 2007-01-09 09:00:30 +0000 | [diff] [blame] | 247 | * init/cfgfile.c (cfg_stanza_normalexit): Use do/while instead of |
| 248 | while, that we don't have to test has_token first as next_arg does |
| 249 | that for us. |
| 250 | |
Scott James Remnant | a735469 | 2007-01-09 08:56:02 +0000 | [diff] [blame] | 251 | * init/cfgfile.c (cfg_stanza_normalexit): Change to peek at the next |
| 252 | token to see whether it's missing or not, and then just fetch each |
| 253 | next argument at a time. This is more efficient than parsing them |
| 254 | all in one go, and also means we can report the error in the right |
| 255 | place! |
| 256 | * init/tests/test_cfgfile.c (test_stanza_normalexit): Since we've |
| 257 | changed the function that parses the stanza, add a proper test case |
| 258 | function for it, covering all the behaviours. |
| 259 | |
Scott James Remnant | 92e7fda | 2007-01-09 08:40:13 +0000 | [diff] [blame] | 260 | * init/job.c (job_new): Initialise the emits member to an empty list. |
| 261 | * init/job.h (Job): Add the emits member as a list. |
| 262 | * init/tests/test_job.c (test_new): Check the emits list starts off |
| 263 | empty. |
| 264 | * init/tests/test_cfgfile.c (test_stanza_emits): Test the new emits |
| 265 | stanza; this function will also serve as a prototype for cleaning up |
| 266 | the config tests. |
| 267 | |
| 268 | * init/cfgfile.c (cfg_stanza_emits): Add function to parse the new |
| 269 | emits stanza. |
| 270 | |
Scott James Remnant | 39ec35b | 2007-01-09 08:16:01 +0000 | [diff] [blame] | 271 | * init/cfgfile.c (cfg_stanza_depends): Remove the depends stanza |
| 272 | from the configuration file. Dependency support has never been used, |
| 273 | and is to be replaced by a more flexible event/state configuration |
| 274 | and blocking on the starting/stopping events. |
| 275 | * init/tests/test_cfgfile.c: Remove references and tests for the |
| 276 | depends stanza. |
| 277 | * init/job.h: Remove the depends list from the job structure. |
| 278 | * init/job.c (job_new): No depends list to initialise. |
| 279 | (job_change_state): No dependencies to release |
| 280 | (job_start): No dependencies to iterate; this removes a particularly |
| 281 | hairy and complex interaction between state changes. Remove the |
| 282 | dependency event. |
| 283 | (job_release_depends): Drop this function. |
| 284 | * init/tests/test_job.c (test_start, test_stop): Massively simplify |
| 285 | these tests cases now we don't have dependencies to worry about. |
| 286 | (test_release_depends): Drop tests |
| 287 | |
Scott James Remnant | d4f5fb8 | 2007-01-08 23:25:23 +0000 | [diff] [blame] | 288 | 2007-01-08 Scott James Remnant <scott@netsplit.com> |
| 289 | |
| 290 | * init/cfgfile.c: Rewrite using the nih_config API, rather than one |
| 291 | huge function we now just have seperate handler functions for each |
| 292 | stanza. We can also use more fine-grained parsing than slurping |
| 293 | all args in and counting them. |
| 294 | (cfg_read_job): Catch exceptions from the configuration parser and |
| 295 | add the line number where the problem occurred to an output message. |
| 296 | Parser errors are now fatal, and not ignored. |
| 297 | * init/errors.h: Add a file containing errors raised within the init |
| 298 | daemon codebase. |
| 299 | * init/Makefile.am (init_SOURCES): Build with errors.h |
| 300 | * init/tests/test_cfgfile.c: Update test cases now we don't expect |
| 301 | a job to be returned if there's a parser error. |
| 302 | |
| 303 | * TODO: Update |
| 304 | |
Scott James Remnant | 6638420 | 2007-01-06 14:23:18 +0000 | [diff] [blame] | 305 | 2007-01-06 Scott James Remnant <scott@netsplit.com> |
| 306 | |
Scott James Remnant | 4f96819 | 2007-01-06 20:31:13 +0000 | [diff] [blame] | 307 | * logd/main.c (logging_reader): Fix inadvertent shadowing of the |
| 308 | len parameter. |
| 309 | |
Scott James Remnant | da10027 | 2007-01-06 20:24:18 +0000 | [diff] [blame] | 310 | * compat/sysv/telinit.c: Oops, nearly forgot to port this to send |
| 311 | the messages in the new way. |
| 312 | * compat/sysv/shutdown.c (shutdown_now): Likewise, port this too. |
| 313 | |
Scott James Remnant | 83a8652 | 2007-01-06 19:55:38 +0000 | [diff] [blame] | 314 | * TODO: Update. |
| 315 | |
Scott James Remnant | 6e94188 | 2007-01-06 14:38:57 +0000 | [diff] [blame] | 316 | * util/initctl.c (handle_job_status): Output the process argument, |
| 317 | not the pid argument which contains the origin of the message. |
| 318 | |
Scott James Remnant | 17d6dca | 2007-01-06 14:33:30 +0000 | [diff] [blame] | 319 | * upstart/message.c (upstart_message_handle): Raise a new unknown |
| 320 | message error if we don't have a handler and a new illegal message |
| 321 | error if the source is illegal. |
| 322 | * upstart/tests/test_message.c (test_handle): Adjust tests to check |
| 323 | for the new errors that we raise. |
| 324 | * upstart/errors.h: Define strings for new errors. |
| 325 | |
Scott James Remnant | 6638420 | 2007-01-06 14:23:18 +0000 | [diff] [blame] | 326 | * util/initctl.c: Yet another makeover for this little program, |
| 327 | port it to the new message/control framework using handler functions |
| 328 | and NihIoMessage. This starts to make each action function look |
| 329 | very similar, so there's method to this madness. |
| 330 | |
Scott James Remnant | b4725d9 | 2007-01-05 13:10:21 +0000 | [diff] [blame] | 331 | 2007-01-05 Scott James Remnant <scott@netsplit.com> |
| 332 | |
Scott James Remnant | 3d6bb79 | 2007-01-05 22:33:43 +0000 | [diff] [blame] | 333 | * logd/main.c (main): Make sure that we add the SIGTERM handler. |
| 334 | |
Scott James Remnant | efbaafb | 2007-01-05 18:12:15 +0000 | [diff] [blame] | 335 | * init/tests/test_job.c (test_run_script): This test case relies |
| 336 | on there only being one file descriptor watch, which won't be true |
| 337 | if the control socket has been opened because there's a message to |
| 338 | go out. Make sure it's closed first. |
| 339 | |
Scott James Remnant | be1941f | 2007-01-05 17:57:59 +0000 | [diff] [blame] | 340 | * init/init.supp: Update supressions file now that control_init |
| 341 | has been renamed to notify_init |
| 342 | |
Scott James Remnant | 71cc4d8 | 2007-01-05 17:53:32 +0000 | [diff] [blame] | 343 | * init/Makefile.am: Include notify.o from all tests. |
| 344 | * init/job.c (job_change_state, job_kill_process, job_start) |
| 345 | (job_stop): Use the new notify_job function name. |
| 346 | * init/event.c (event_queue_run): Use the new notify_event function |
| 347 | name. |
| 348 | |
Scott James Remnant | fea6cb6 | 2007-01-05 17:49:13 +0000 | [diff] [blame] | 349 | * init/control.c (control_error_handler): Handle ECONNREFUSED now |
| 350 | that the process id is available to us. |
| 351 | * init/tests/test_control.c (test_error_handler): Make sure children |
| 352 | going away is handled properly. |
| 353 | |
Scott James Remnant | 3dfb213 | 2007-01-05 17:44:48 +0000 | [diff] [blame] | 354 | * upstart/message.c (upstart_message_new): Store the process id in |
| 355 | the int_data message field. |
| 356 | * upstart/tests/test_message.c (test_new): Check the int_data field |
| 357 | is filled in. |
| 358 | |
Scott James Remnant | 5d70295 | 2007-01-05 17:21:34 +0000 | [diff] [blame] | 359 | * init/main.c (main): Guard against various things returning an error |
| 360 | that we weren't catching. |
| 361 | |
Scott James Remnant | 601a0e3 | 2007-01-05 17:06:31 +0000 | [diff] [blame] | 362 | * init/tests/test_notify.c: Whitespace fix. |
| 363 | |
Scott James Remnant | 15cd086 | 2007-01-05 17:06:20 +0000 | [diff] [blame] | 364 | * init/control.c (control_watch_jobs, control_unwatch_jobs) |
| 365 | (control_watch_events, control_unwatch_events): Restore functionality |
| 366 | to subscribe and unsubscribe from job and event notifications. |
| 367 | * init/tests/test_control.c (test_watch_jobs, test_unwatch_jobs) |
| 368 | (test_watch_events, test_unwatch_events): Check that the subscription |
| 369 | and unsubscription messages work. |
| 370 | * init/Makefile.am (test_control_LDADD): Link to notify.o |
| 371 | |
| 372 | * init/control.c: Drop unused include of upstart/errors.h |
| 373 | |
Scott James Remnant | 58cef57 | 2007-01-05 16:18:42 +0000 | [diff] [blame] | 374 | * init/notify.c: Move functions that handle subscription and |
| 375 | notification from control.c. Other than changing the names, we're |
| 376 | keeping the API the same for now; expect it to change later when we |
| 377 | add the ability to subscribe to individual jobs or events. |
| 378 | (notify_init): initialise the subscriptions list; we don't have a |
| 379 | separate send queue now that the control I/O is always asynchronous. |
| 380 | * init/notify.h: Moved notification enum, structure and prototypes |
| 381 | from control.h, changing the names so they match notify_* in the |
| 382 | process. |
| 383 | * init/Makefile.am (init_SOURCES): Build and link notify.c using |
| 384 | notify.h |
| 385 | (TESTS): Build the notify test suite binary. |
| 386 | (test_notify_SOURCES, test_notify_LDFLAGS, test_notify_LDADD): Details |
| 387 | for notify test suite binary. |
| 388 | * init/tests/test_notify.c: Rewrite test cases in the manner of |
| 389 | test_control.c so that we have one function for notify_job and |
| 390 | one for notify_event, each of which contains the child process that |
| 391 | receives the notification, |
| 392 | |
Scott James Remnant | b1679c6 | 2007-01-05 15:49:54 +0000 | [diff] [blame] | 393 | * init/control.c (control_open): Allow this to be called to obtain |
| 394 | the control socket, which means we can make it static. |
| 395 | * init/tests/test_control.c (test_open): Check that it works. |
| 396 | |
Scott James Remnant | f7c6b06 | 2007-01-05 15:33:33 +0000 | [diff] [blame] | 397 | * init/control.c, init/control.h, init/tests/test_control.c: Move |
| 398 | functions that handle subscription and notification to new notify.c |
| 399 | (control_init): Drop completely, no need to maintain a send queue now |
| 400 | (control_open): Change to return an NihIo that uses the default |
| 401 | control watcher, and our error handler. Split socket opening into |
| 402 | (control_open_sock): which can be called from other functions. |
| 403 | (control_close): Use nih_io_close() to close the socket and free the |
| 404 | structure in one go. |
| 405 | (control_reopen): Close the open control socket and open it again |
| 406 | without destroying the NihIo structure, its queues or state. |
| 407 | (control_close_handler): Handle the control socket going away |
| 408 | (control_error_handler): Handle errors on the control socket, |
| 409 | including the connection refused error that indicates a client went |
| 410 | away. |
| 411 | (control_handle): Split this into a miriad of small functions with |
| 412 | a table to link them to the message type; this will make expanding |
| 413 | each message handler much easier in future. |
| 414 | * init/control.h: Update. |
| 415 | * init/tests/test_control.c: Rewrite test cases to check the new |
| 416 | handler functions; as a side-effect, this gets rid of the evil giant |
| 417 | child/parent functions in favour of one test function per handler |
| 418 | function. |
| 419 | |
Scott James Remnant | b4725d9 | 2007-01-05 13:10:21 +0000 | [diff] [blame] | 420 | * upstart/message.c (upstart_message_handle_using): Wrapper function |
| 421 | around upstart_message_handle that ensures all messages as passed to |
| 422 | a single function. |
| 423 | * upstart/message.h: Update. |
| 424 | * upstart/tests/test_message.c (test_handle_using): Make sure it |
| 425 | calls the single function. |
| 426 | |
Scott James Remnant | de3666f | 2007-01-04 23:00:07 +0000 | [diff] [blame] | 427 | 2007-01-04 Scott James Remnant <scott@netsplit.com> |
| 428 | |
| 429 | * upstart/message.c (upstart_message_reader): Handle any errors |
| 430 | that occurred while handling the message. |
| 431 | |
Scott James Remnant | 92feed9 | 2007-01-02 15:27:47 +0000 | [diff] [blame] | 432 | 2007-01-02 Scott James Remnant <scott@netsplit.com> |
| 433 | |
Scott James Remnant | 7833bbf | 2007-01-02 20:57:23 +0000 | [diff] [blame] | 434 | * upstart/message.c (upstart_message_handle): Check that the name |
| 435 | argument is never NULL. |
| 436 | (upstart_message_reader): Simple message reader function that can |
| 437 | be associated with an I/O watch and handles each message received. |
| 438 | * upstart/message.h: Add prototype. |
| 439 | * upstart/tests/test_message.c (test_reader): Test the reader function. |
| 440 | |
Scott James Remnant | 0e3b5fe | 2007-01-02 18:39:03 +0000 | [diff] [blame] | 441 | * upstart/control.c: Rename to upstart/message.c |
| 442 | * upstart/control.h: Rename to upstart/message.h |
| 443 | * upstart/tests/test_control.c: Rename to upstart/tests/test_message.c |
| 444 | * upstart/libupstart.h: Update includes. |
| 445 | * upstart/wire.c: Include message.h |
| 446 | * upstart/wire.h: Update includes. |
| 447 | * upstart/tests/test_wire.c: Update includes. |
| 448 | * upstart/errors.h: Rename UPSTART_INVALID_MESSAGE to |
| 449 | UPSTART_MESSAGE_INVALID so that it's prefixed. |
| 450 | * upstart/Makefile.am (libupstart_la_SOURCES) |
| 451 | (upstartinclude_HEADERS, TESTS): Update filenames. |
| 452 | |
Scott James Remnant | 2ad9a04 | 2007-01-02 18:29:49 +0000 | [diff] [blame] | 453 | * upstart/control.c (upstart_message_new): New function that |
| 454 | creates an NihIoMessage directly from its arguments, which are a type |
| 455 | followed by a variable number of args depending on that type. |
| 456 | (upstart_message_handler): Function to find a handler function for |
| 457 | a particular message type and origin process. |
| 458 | (upstart_message_handle): New function that takes an NihIoMessage |
| 459 | and invokes a handler function with a variable number of args |
| 460 | depending on the message type. |
| 461 | (upstart_send_msg, upstart_send_msg_to, upstart_recv_msg): Drop these |
| 462 | functions, leave it up to the caller to decide whether to send and |
| 463 | receive the messages synchronously or asynchronously; now that the |
| 464 | capability is in nih_io_*. |
| 465 | * upstart/control.h (UpstartMsgType): Rename to UpstartMessageType. |
| 466 | (UpstartMessageHandler): Function with variable number of arguments |
| 467 | that handles a message received. |
| 468 | (UpstartMsg): Drop this structure entirely, we'll encode or decode |
| 469 | the wire format directly from or into a function call, rather than |
| 470 | use an intermediate structure to marshal it. |
| 471 | (UpstartMessage): New structure to make a table that can be passed |
| 472 | to upstart_message_handle to determine which handler should be called. |
| 473 | * upstart/tests/test_control.c: Test new behaviour. |
| 474 | * upstart/wire.c (upstart_push_header, upstart_pop_header): Change |
| 475 | structure name for type parameter. |
| 476 | * upstart/wire.h: Update. |
| 477 | * upstart/tests/test_wire.c: Update. |
| 478 | |
Scott James Remnant | 92feed9 | 2007-01-02 15:27:47 +0000 | [diff] [blame] | 479 | * configure.ac (AC_COPYRIGHT): Update copyright to 2007. |
| 480 | |
Scott James Remnant | 67546d1 | 2006-12-29 13:08:32 +0000 | [diff] [blame] | 481 | 2006-12-29 Scott James Remnant <scott@netsplit.com> |
| 482 | |
| 483 | * upstart/wire.c (upstart_write_int, upstart_write_unsigned) |
| 484 | (upstart_write_string, upstart_write_header, upstart_write_packv) |
| 485 | (upstart_write_pack): Rename to *_push_* |
| 486 | (upstart_read_int, upstart_read_unsigned, upstart_read_string) |
| 487 | (upstart_read_header, upstart_read_packv, upstart_read_pack): Rename |
| 488 | to *_pop_*. |
| 489 | All of the above modified to modify an NihIoMessage structure, |
| 490 | instead of trying to carry around buffers ourself. |
| 491 | * upstart/wire.h: Update to match above. |
| 492 | * upstart/tests/test_wire.c: Update all tests to match the above |
| 493 | changes. |
| 494 | |
Scott James Remnant | d76e8e3 | 2006-12-21 18:34:31 +0000 | [diff] [blame] | 495 | 2006-12-21 Scott James Remnant <scott@netsplit.com> |
| 496 | |
Scott James Remnant | f922a98 | 2006-12-21 18:45:30 +0000 | [diff] [blame] | 497 | * upstart/wire.c (upstart_read_packv, upstart_write_packv): Change |
| 498 | nih_assert_notreached to nih_assert_not_reached. |
| 499 | |
Scott James Remnant | d76e8e3 | 2006-12-21 18:34:31 +0000 | [diff] [blame] | 500 | * init/job.c (job_run_script): Open the NihIo structure in stream mode. |
| 501 | * logd/main.c (logging_watcher): Open the NihIo structure in |
| 502 | stream mode. |
| 503 | (logging_reader): Need to pass the length of the size_t as a pointer |
| 504 | so that it can be modified if less is read. |
| 505 | |
Scott James Remnant | a038523 | 2006-12-17 15:21:39 +0000 | [diff] [blame] | 506 | 2006-12-17 Scott James Remnant <scott@netsplit.com> |
| 507 | |
Scott James Remnant | 00cc688 | 2006-12-17 19:54:36 +0000 | [diff] [blame] | 508 | * upstart/wire.c (upstart_write_packv, upstart_write_pack) |
| 509 | (upstart_read_packv, upstart_read_pack): Functions to write a pack |
| 510 | of different variables to the stream, or read them from it |
| 511 | * upstart/wire.h: Add prototypes. |
| 512 | * upstart/tests/test_wire.c (test_write_pack, test_read_pack): |
| 513 | Check we can read and write a pack of variables at once. |
| 514 | |
Scott James Remnant | 518e1c1 | 2006-12-17 18:12:14 +0000 | [diff] [blame] | 515 | * upstart/wire.c (upstart_write_header, upstart_read_header): Drop |
| 516 | the version from the header, we'll just keep the protocol always |
| 517 | backwards compatible. |
| 518 | * upstart/wire.h: Update. |
| 519 | * upstart/tests/test_wire.c (test_write_header, test_read_header): |
| 520 | Check that everything works. |
| 521 | |
Scott James Remnant | 64e378f | 2006-12-17 17:24:44 +0000 | [diff] [blame] | 522 | * upstart/wire.c (upstart_write_string, upstart_read_string): |
| 523 | Transmit the length as an unsigned, and use 0xffffffff to mean NULL |
| 524 | instead of zero so we can still transmit the empty string. |
| 525 | * upstart/wire.h: Update. |
| 526 | * upstart/tests/test_wire.c (test_write_string, test_read_string): |
| 527 | Tests for the functions to make sure the wire is at it should be. |
| 528 | |
Scott James Remnant | d6dde95 | 2006-12-17 17:00:56 +0000 | [diff] [blame] | 529 | * upstart/wire.c (upstart_read_str, upstart_write_str): Rename to |
| 530 | upstart_read_string and upstart_write_string. |
| 531 | * upstart/wire.h: Update. |
| 532 | |
Scott James Remnant | c71ab3b | 2006-12-17 16:58:28 +0000 | [diff] [blame] | 533 | * upstart/wire.c (upstart_write_unsigned, upstart_read_unsigned): |
| 534 | Functions to send unsigned values over the wire, which we'll use |
| 535 | to get a bit extra for the string lengths. |
| 536 | * upstart/wire.h: Update. |
| 537 | * upstart/tests/test_wire.c (test_write_unsigned) |
| 538 | (test_read_unsigned): Test the new functions. |
| 539 | |
Scott James Remnant | 0218e3a | 2006-12-17 16:39:33 +0000 | [diff] [blame] | 540 | * upstart/wire.c (upstart_write_ints, upstart_read_ints): Drop |
| 541 | these functions, we'll go with something far more generic and |
| 542 | useful. |
| 543 | * upstart/wire.h: Remove prototypes. |
| 544 | |
Scott James Remnant | 9ee4430 | 2006-12-17 16:37:59 +0000 | [diff] [blame] | 545 | * upstart/wire.c (upstart_write_int, upstart_read_int): Transmit |
| 546 | integers as signed 32-bit values in network byte order. |
| 547 | * upstart/tests/test_wire.c (test_write_int, test_read_int): Test |
| 548 | the functions to make sure the wire is at it should be, |
| 549 | |
Scott James Remnant | 5cef53e | 2006-12-17 15:41:13 +0000 | [diff] [blame] | 550 | * upstart/control.c (upstart_read_int, upstart_write_int) |
| 551 | (upstart_read_ints, upstart_write_ints, upstart_read_str) |
| 552 | (upstart_write_str, upstart_read_header, upstart_write_header): Move |
| 553 | functions to new wire.c file. |
| 554 | * upstart/wire.c: Source file to hold wire protocol functions. |
| 555 | * upstart/wire.h: Prototypes. |
| 556 | * upstart/tests/test_wire.c: (empty) test suite. |
| 557 | * upstart/libupstart.h: Include wire.h |
| 558 | * upstart/Makefile.am (libupstart_la_SOURCES): Build and link wire.c |
| 559 | (upstartinclude_HEADERS): Install wire.h |
| 560 | (TESTS): Build and run wire test suite. |
| 561 | (test_wire_SOURCES, test_wire_LDFLAGS, test_wire_LDADD): Details for |
| 562 | wire test suite binary. |
| 563 | |
Scott James Remnant | a038523 | 2006-12-17 15:21:39 +0000 | [diff] [blame] | 564 | * upstart/control.c (MAGIC): Change to "upstart\n", the final |
| 565 | character was originally \0 and then was a " " for the 0.2 series. |
| 566 | * upstart/tests/test_control.c (test_recv_msg): Change to match. |
| 567 | |
Scott James Remnant | fb9412a | 2006-12-15 18:03:22 +0000 | [diff] [blame] | 568 | 2006-12-15 Scott James Remnant <scott@netsplit.com> |
| 569 | |
Scott James Remnant | 2e5fe2b | 2006-12-15 18:27:58 +0000 | [diff] [blame] | 570 | * util/initctl.c, compat/sysv/telinit.c, compat/sysv/shutdown.c: |
| 571 | Update all uses of the UpstartMsg structure to avoid the |
| 572 | intermediate union that no longer exists. |
| 573 | |
Scott James Remnant | fb52146 | 2006-12-15 18:24:57 +0000 | [diff] [blame] | 574 | * init/control.c, init/tests/test_control.c: Update all uses of |
| 575 | the UpstartMsg structure to avoid the intermediate union that no |
| 576 | longer exists. |
| 577 | |
Scott James Remnant | 99b9766 | 2006-12-15 18:15:22 +0000 | [diff] [blame] | 578 | * upstart/control.h: Combine all the previous message structures |
| 579 | into just one that has all of the fields anyway. |
| 580 | * upstart/control.c, upstart/tests/test_control.c: Update all uses of |
| 581 | the UpstartMsg structure to avoid the intermediate union that no |
| 582 | longer exists. |
| 583 | |
Scott James Remnant | d452ab1 | 2006-12-15 18:05:23 +0000 | [diff] [blame] | 584 | * upstart/control.h (UPSTART_API_VERSION): Define API version macro |
| 585 | to be public. |
| 586 | * upstart/control.c (MSG_VERSION, upstart_send_msg_to): Replacing the |
| 587 | previous MSG_VERSION macro here. |
| 588 | |
Scott James Remnant | fb9412a | 2006-12-15 18:03:22 +0000 | [diff] [blame] | 589 | * upstart/control.c (upstart_read_int, upstart_write_int) |
| 590 | (upstart_read_ints, upstart_write_ints, upstart_read_str) |
| 591 | (upstart_write_str, upstart_read_header, upstart_write_header): |
| 592 | New functions to replace the old "write a struct" protocol with |
| 593 | something a little more regimented and supportable. |
| 594 | (IOVEC_ADD, IOVEC_READ, WireHdr, WireJobPayload, WireJobStatusPayload) |
| 595 | (WireEventPayload): Remove these structures, use the functions |
| 596 | instead. |
| 597 | (upstart_send_msg_to): Call write functions intead of using macros, |
| 598 | this makes the code somewhat neater. |
| 599 | (upstart_recv_msg): Call read functions instead of using macros, |
| 600 | again making the code somewhat neater. |
| 601 | * upstart/tests/test_control.c (test_recv_msg): Change wire |
| 602 | tests to match new protocol, and thus actually work properly, |
| 603 | previously these were endian sensitive. |
| 604 | |
Scott James Remnant | 27ebd79 | 2006-12-14 11:37:14 +0000 | [diff] [blame] | 605 | 2006-12-14 Scott James Remnant <scott@netsplit.com> |
| 606 | |
Scott James Remnant | 136dc6f | 2006-12-14 12:36:43 +0000 | [diff] [blame] | 607 | * compat/sysv/shutdown.c (wall): Construct the wall message so that |
| 608 | we don't put \r into a po file; for some reason, gettext hates that |
| 609 | and bitches about it. Someone's confusing internationalisation with |
| 610 | operating system portability, I expect. |
| 611 | |
Scott James Remnant | f334f84 | 2006-12-14 11:46:14 +0000 | [diff] [blame] | 612 | * util/man/initctl.8: Drop reference to start(8), as that's just |
| 613 | a symlink to initctl now. |
| 614 | |
Scott James Remnant | 8884743 | 2006-12-14 11:44:36 +0000 | [diff] [blame] | 615 | * init/man/init.8: Link to initctl. |
| 616 | |
Scott James Remnant | f6b237a | 2006-12-14 11:40:49 +0000 | [diff] [blame] | 617 | * compat/sysv/reboot.c (main): Clear up help text a little. |
| 618 | |
Scott James Remnant | 3b4b227 | 2006-12-14 11:39:05 +0000 | [diff] [blame] | 619 | * HACKING: Correct some typos. |
| 620 | |
Scott James Remnant | 27ebd79 | 2006-12-14 11:37:14 +0000 | [diff] [blame] | 621 | * configure.ac (AC_INIT): Correct bug reporting address. |
| 622 | |
Scott James Remnant | 1d8763a | 2006-12-13 17:49:38 +0000 | [diff] [blame] | 623 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 624 | |
Scott James Remnant | ecec0fe | 2006-12-13 21:55:28 +0000 | [diff] [blame] | 625 | * configure.ac: Bump version to 0.3.2 |
| 626 | |
Scott James Remnant | f642ffa | 2006-12-13 18:24:22 +0000 | [diff] [blame] | 627 | * NEWS: Update. |
| 628 | |
Scott James Remnant | 1d8763a | 2006-12-13 17:49:38 +0000 | [diff] [blame] | 629 | * util/initctl.c (print_job_status): Drop the newline from the |
| 630 | output. |
| 631 | |
Scott James Remnant | 567cbdc | 2006-12-13 17:07:58 +0000 | [diff] [blame] | 632 | 2006-12-13 Alex Smith <alex@alex-smith.me.uk> |
| 633 | |
| 634 | * util/initctl.c (print_job_status): Clean up initctl job status |
| 635 | output, which was badly converted from printf to nih_message. |
| 636 | |
Scott James Remnant | e2cf639 | 2006-12-13 17:02:20 +0000 | [diff] [blame] | 637 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 638 | |
| 639 | * compat/sysv/man/shutdown.8: Add missing documentation on the |
| 640 | format of TIME by copying it from --help output. |
| 641 | |
Scott James Remnant | fec9056 | 2006-12-13 17:00:40 +0000 | [diff] [blame] | 642 | 2006-12-13 Alex Smith <alex@alex-smith.me.uk> |
| 643 | |
| 644 | * init/process.c (process_setup_console): Actually send output to |
| 645 | /dev/null instead of /dev/console, when CONSOLE_NONE. |
| 646 | |
Scott James Remnant | f233c9d | 2006-12-13 16:45:35 +0000 | [diff] [blame] | 647 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 648 | |
Scott James Remnant | fbf7a5c | 2006-12-13 16:54:42 +0000 | [diff] [blame] | 649 | * Makefile.am (EXTRA_DIST): Distribute the nih ChangeLog as well. |
| 650 | |
Scott James Remnant | f233c9d | 2006-12-13 16:45:35 +0000 | [diff] [blame] | 651 | * init/tests/test_job.c: Port to the new test framework. |
| 652 | * init/job.c (job_set_idle_event): Fix a slight memory leak, |
| 653 | repeated setting of the idle event never freed the previous one set. |
| 654 | |
Scott James Remnant | 1abced4 | 2006-12-12 11:28:49 +0000 | [diff] [blame] | 655 | 2006-12-12 Scott James Remnant <scott@netsplit.com> |
| 656 | |
Scott James Remnant | fbad50c | 2006-12-12 18:47:43 +0000 | [diff] [blame] | 657 | * init/tests/test_cfgfile.c: Port to the new test framework. |
| 658 | |
Scott James Remnant | ef37223 | 2006-12-12 17:23:05 +0000 | [diff] [blame] | 659 | * init/tests/test_control.c: Port to the new test framework. |
| 660 | * init/init.supp: Suppress the list head allocated within control_init. |
| 661 | |
Scott James Remnant | 2c2e01a | 2006-12-12 17:22:40 +0000 | [diff] [blame] | 662 | * init/control.c (control_watcher): Need to save the pid when we |
| 663 | get ECONNREFUSED, otherwise we lose it when we free the message. |
| 664 | |
Scott James Remnant | 40f7d91 | 2006-12-12 15:31:35 +0000 | [diff] [blame] | 665 | * init/tests/test_process.c: Port to the new test framework. |
| 666 | * init/init.supp: Suppress the list head allocated within job_init. |
| 667 | |
Scott James Remnant | fc45659 | 2006-12-12 14:09:45 +0000 | [diff] [blame] | 668 | * init/init.supp: Include a valgrind suppressions file. |
| 669 | * init/Makefile.am (EXTRA_DIST): Distribute the suppressions file. |
| 670 | |
Scott James Remnant | 96c9b07 | 2006-12-12 14:07:30 +0000 | [diff] [blame] | 671 | * init/tests/test_event.c: Port to the new test framework. |
| 672 | |
Scott James Remnant | 237c7f6 | 2006-12-12 13:49:19 +0000 | [diff] [blame] | 673 | * logd/Makefile.am, util/Makefile.am, compat/sys/Makefile.am |
| 674 | (AM_CPPFLAGS): Add -I$(srcdir), necessary for testing "programs" |
| 675 | that don't have usual library path semantics. |
| 676 | |
Scott James Remnant | 2a35ab9 | 2006-12-12 13:23:10 +0000 | [diff] [blame] | 677 | * upstart/tests/test_control.c: Port to the new test framework. |
| 678 | * upstart/control.c (upstart_free): Drop this function, while not |
| 679 | exposing libnih is a valiant effort, it already slips out because |
| 680 | of the error handling. |
| 681 | |
Scott James Remnant | 905dd27 | 2006-12-12 12:38:34 +0000 | [diff] [blame] | 682 | * upstart/tests/test_job.c: Add missing include. |
| 683 | |
Scott James Remnant | e77567f | 2006-12-12 12:25:46 +0000 | [diff] [blame] | 684 | * upstart/tests/test_job.c: Port to the new test framework. |
| 685 | (test_process_state_name): Check that this returns NULL. |
| 686 | |
Scott James Remnant | b798306 | 2006-12-12 11:34:49 +0000 | [diff] [blame] | 687 | * HACKING: Update location of download directory. Document |
| 688 | requirement that all code have test cases. |
| 689 | |
Scott James Remnant | 0c577ce | 2006-12-12 11:31:13 +0000 | [diff] [blame] | 690 | * logd/main.c (open_logging): Likewise. |
| 691 | |
Scott James Remnant | c654baf | 2006-12-12 11:30:44 +0000 | [diff] [blame] | 692 | * init/control.c (control_open): No need to set ENOMEM, errno is |
| 693 | always set anyway. |
| 694 | |
Scott James Remnant | 1abced4 | 2006-12-12 11:28:49 +0000 | [diff] [blame] | 695 | * configure.ac (AM_INIT_AUTOMAKE): Include nostdinc so we don't get |
| 696 | Automake's broken default includes. |
| 697 | * upstart/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 698 | we don't need it. |
| 699 | (DEFS, INCLUDES): Replace these variables with the combined |
| 700 | (AM_CPPFLAGS): variable that declares everything. |
| 701 | * init/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 702 | we don't need it. |
| 703 | (DEFS, INCLUDES): Replace these variables with the combined |
| 704 | (AM_CPPFLAGS): variable that declares everything. |
| 705 | * util/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 706 | we don't need it. |
| 707 | (DEFS, INCLUDES): Replace these variables with the combined |
| 708 | (AM_CPPFLAGS): variable that declares everything. |
| 709 | * compat/sysv/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 710 | we don't need it. |
| 711 | (DEFS, INCLUDES): Replace these variables with the combined |
| 712 | (AM_CPPFLAGS): variable that declares everything. |
| 713 | * logd/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 714 | we don't need it. |
| 715 | (DEFS, INCLUDES): Replace these variables with the combined |
| 716 | (AM_CPPFLAGS): variable that declares everything. |
| 717 | |
Scott James Remnant | acec3b2 | 2006-11-02 16:36:53 +0000 | [diff] [blame] | 718 | 2006-11-02 Scott James Remnant <scott@netsplit.com> |
| 719 | |
| 720 | * util/initctl.c (start_action): Remove break calls which shouldn't |
| 721 | be there. |
| 722 | |
Scott James Remnant | ea806b7 | 2006-10-18 15:01:00 +0100 | [diff] [blame] | 723 | 2006-10-18 Sean E. Russell <ser@ser1.net> |
| 724 | |
| 725 | * init/main.c: Include sys/time.h |
| 726 | * init/cfgfile.c: Include sys/time.h and sys/resource.h |
| 727 | * init/job.c: Include sys/time.h and sys/resource.h |
| 728 | |
Scott James Remnant | 6702ac1 | 2006-10-17 18:55:24 +0100 | [diff] [blame] | 729 | 2006-10-17 Scott James Remnant <scott@netsplit.com> |
| 730 | |
Scott James Remnant | d5758f4 | 2006-10-17 19:21:25 +0100 | [diff] [blame] | 731 | * configure.ac: Bump version to 0.3.1 |
| 732 | |
Scott James Remnant | fd029da | 2006-10-17 19:21:07 +0100 | [diff] [blame] | 733 | * NEWS: Update. |
| 734 | * TODO: Update. |
| 735 | |
Scott James Remnant | 9f67cb8 | 2006-10-17 19:12:28 +0100 | [diff] [blame] | 736 | * configure.ac (AM_GNU_GETTEXT_VERSION): Quote version number. |
| 737 | |
Scott James Remnant | 4ebe87f | 2006-10-17 19:04:40 +0100 | [diff] [blame] | 738 | * logd/Makefile.am (event.d/logd): Make the event.d sub-directory |
| 739 | in case we're building outside of the source tree. |
| 740 | |
Scott James Remnant | 6702ac1 | 2006-10-17 18:55:24 +0100 | [diff] [blame] | 741 | * compat/sysv/runlevel.c (store): Don't break strict-aliasing rules |
| 742 | by avoiding dereferencing type-punned pointer. Answers on a |
| 743 | postcard, please. |
| 744 | |
Scott James Remnant | 7f13301 | 2006-10-13 12:00:34 +0100 | [diff] [blame] | 745 | 2006-10-13 Scott James Remnant <scott@netsplit.com> |
| 746 | |
Scott James Remnant | ecbb2b5 | 2006-10-13 15:18:24 +0100 | [diff] [blame] | 747 | * util/initctl.c (start_action, emit_action): Add missing \n |
| 748 | |
Scott James Remnant | 4862298 | 2006-10-13 15:15:50 +0100 | [diff] [blame] | 749 | * util/initctl.c: Rewrite using nih_command_parser. |
| 750 | * util/man/initctl.8: Improve. |
| 751 | |
| 752 | * util/start.c: Remove, replaced by initctl. |
| 753 | * util/man/start.8: Remove, replaced by initctl. |
| 754 | * util/Makefile.am (sbin_PROGRAMS): Drop start, now just a symlink |
| 755 | to initctl. |
| 756 | (dist_man_MANS): Drop start.8, now a symlink to initctl.8 |
| 757 | (install-exec-hook): Make symlinks to initctl, add start |
| 758 | (install-data-hook): Make symlinks to initctl.8, add start.8 |
| 759 | |
Scott James Remnant | b1d8a7d | 2006-10-13 13:57:31 +0100 | [diff] [blame] | 760 | * initctl: Rename to util again, I don't want a separate directory |
| 761 | for every single little tool; and we'll be shipping more than just |
| 762 | initctl (e.g. a non-compat reboot). |
| 763 | * configure.ac (AC_CONFIG_FILES): Make util/Makefile instead of |
| 764 | initctl/Makefile. |
| 765 | * Makefile.am (SUBDIRS): Descend into util, not initctl. |
| 766 | |
Scott James Remnant | a48b4fe | 2006-10-13 13:49:46 +0100 | [diff] [blame] | 767 | * compat/sysv/reboot.c: Remove long options where they didn't exist |
| 768 | before. Write help text. |
| 769 | * compat/sysv/man/reboot.8: Update. |
| 770 | |
Scott James Remnant | 462734c | 2006-10-13 13:36:00 +0100 | [diff] [blame] | 771 | * init/main.c (main): Formatting. |
| 772 | * logd/main.c (main): Formatting. |
| 773 | * logd/man/logd.8: Formatting. |
| 774 | * compat/sysv/runlevel.c (main): Formatting. |
| 775 | * compat/sysv/telinit.c (main): Formatting. |
| 776 | * compat/sysv/man/shutdown.8: Remove long options. |
| 777 | |
Scott James Remnant | eff01f1 | 2006-10-13 13:32:12 +0100 | [diff] [blame] | 778 | * compat/sysv/shutdown.c: Remove -e/--event, it has no place in a |
| 779 | compatibility tool. Get rid of long options that never existed |
| 780 | before. Specify help text to describe the options. |
| 781 | * compat/sysv/man/shutdown.8: Spruce up a bit. |
| 782 | |
Scott James Remnant | 4a5cd21 | 2006-10-13 12:59:15 +0100 | [diff] [blame] | 783 | * compat/sysv/telinit.c (main): Set help text to list the valid |
| 784 | runlevels. |
| 785 | * compat/sysv/man/telinit.8: Refine the notes to mention runlevel(8). |
| 786 | |
Scott James Remnant | f781962 | 2006-10-13 12:54:43 +0100 | [diff] [blame] | 787 | * compat/sysv/runlevel.c (main): Make the help text describe the |
| 788 | options, rather than the behaviour. |
Scott James Remnant | 4a5cd21 | 2006-10-13 12:59:15 +0100 | [diff] [blame] | 789 | * compat/sysv/man/runlevel.8: Flesh out a little more. |
Scott James Remnant | f781962 | 2006-10-13 12:54:43 +0100 | [diff] [blame] | 790 | |
Scott James Remnant | 930e25a | 2006-10-13 12:28:05 +0100 | [diff] [blame] | 791 | * configure.ac (AC_INIT): Change bug reporting address to the |
| 792 | mailing list, since Launchpad doesn't accept random bugs without |
| 793 | accounts and complicated control messages. |
| 794 | * init/main.c, logd/main.c: Add a period to the synopsis. |
| 795 | |
Scott James Remnant | a6ed7eb | 2006-10-13 12:14:45 +0100 | [diff] [blame] | 796 | * init/main.c (main): Set the synopsis, and direct people to look |
| 797 | at telinit in the --help output. |
| 798 | * init/man/init.8: Flesh this out a little more, still a lot of |
| 799 | explaining to do about jobs and events, but we'll wait until we've |
| 800 | changed that code before documentating the behaviour. |
| 801 | |
Scott James Remnant | 7f13301 | 2006-10-13 12:00:34 +0100 | [diff] [blame] | 802 | * logd/main.c (main): Correct help text to describe the options, |
| 803 | rather than what the program does. As per standard style. |
| 804 | Don't become a daemon until the logging socket is open, and make |
| 805 | that exclusive with waiting for SIGCONT. |
| 806 | * logd/man/logd.8: Write some more extensive documentation, |
| 807 | including describing the startup interlock and the socket protocol. |
| 808 | * TODO: Plan to get rid of the signal interlock from logd. |
| 809 | |
Scott James Remnant | 8985dd3 | 2006-10-12 15:26:29 +0100 | [diff] [blame] | 810 | 2006-10-12 Scott James Remnant <scott@netsplit.com> |
| 811 | |
| 812 | * configure.ac: Expand AC_GNU_SOURCE so we get _GNU_SOURCE and so |
| 813 | that gettext doesn't complain. |
| 814 | (AM_GNU_GETTEXT_VERSION): Increase to 0.15 |
| 815 | (AC_PREREQ): Increase to 2.60 |
| 816 | * HACKING: Update autoconf and gettext requirements. |
| 817 | |
Scott James Remnant | c16a9b4 | 2006-10-11 17:08:58 +0100 | [diff] [blame] | 818 | 2006-10-11 Scott James Remnant <scott@netsplit.com> |
| 819 | |
Scott James Remnant | 74a1144 | 2006-10-11 17:58:56 +0100 | [diff] [blame] | 820 | * init/control.c (control_init): Pass NULL to nih_list_new. |
| 821 | Clarify list item types. |
| 822 | * init/event.c (event_init): Pass NULL to nih_list_new. |
| 823 | * init/job.c (job_init): Pass NULL to nih_list_new. |
| 824 | |
Scott James Remnant | c34c4be | 2006-10-11 17:56:34 +0100 | [diff] [blame] | 825 | * init/main.c: Change nih_signal_add_callback to nih_signal_add_handler |
| 826 | and NihSignalCb to NihSignalHandler. |
| 827 | |
Scott James Remnant | 8b22740 | 2006-10-11 17:55:27 +0100 | [diff] [blame] | 828 | * init/cfgfile.c, init/cfgfile.h, init/control.c, init/control.h, |
| 829 | init/event.c, init/event.h, init/job.c, init/job.h, init/main.c, |
| 830 | init/process.c: Clean up documentation strings and parent pointer |
| 831 | types. |
| 832 | |
Scott James Remnant | d033c86 | 2006-10-11 17:41:22 +0100 | [diff] [blame] | 833 | * compat/sysv/shutdown.c: Change nih_signal_add_callback to |
| 834 | nih_signal_add_handler. |
| 835 | |
Scott James Remnant | 1ee0f48 | 2006-10-11 17:40:41 +0100 | [diff] [blame] | 836 | * compat/sysv/reboot.c: Set synopsis text depending on command |
| 837 | used (probably should use nih_command_parser?) |
| 838 | * compat/sysv/runlevel.c: Set synopsis and help text, and correct |
| 839 | usage. |
| 840 | * compat/sysv/shutdown.c: Set synopsis text. |
| 841 | * compat/sysv/telinit.c: Set synopsis text. |
| 842 | |
Scott James Remnant | 3b73464 | 2006-10-11 17:22:33 +0100 | [diff] [blame] | 843 | * compat/sysv/runlevel.c, compat/sysv/shutdown.c: Clean up |
| 844 | documentation strings. |
| 845 | |
Scott James Remnant | c6e4f00 | 2006-10-11 17:22:03 +0100 | [diff] [blame] | 846 | * logd/main.c: Set synopsis and help text. |
| 847 | |
Scott James Remnant | 5e31d74 | 2006-10-11 17:16:55 +0100 | [diff] [blame] | 848 | * logd/main.c: Clean up documentation strings. |
| 849 | Change nih_signal_add_callback to nih_signal_add_handler. |
| 850 | |
Scott James Remnant | 4835938 | 2006-10-11 17:13:48 +0100 | [diff] [blame] | 851 | * upstart/control.c, upstart/control.h, upstart/job.c: Clean up |
| 852 | documentation strings and correct parent pointer type. |
| 853 | |
Scott James Remnant | c16a9b4 | 2006-10-11 17:08:58 +0100 | [diff] [blame] | 854 | * HACKING: Detail function documentation requirement and format. |
| 855 | |
Scott James Remnant | 59093a8 | 2006-10-10 13:09:58 +0100 | [diff] [blame] | 856 | 2006-10-10 Scott James Remnant <scott@netsplit.com> |
| 857 | |
Scott James Remnant | 335947d | 2006-10-11 17:08:34 +0100 | [diff] [blame] | 858 | * event.d/logd.in: Move to logd/event.d |
| 859 | * event.d/Makefile.am: Remove |
| 860 | * logd/Makefile.am: Create the logd job definition and install |
| 861 | * Makefile.am (SUBDIRS): event.d directory has been removed. |
| 862 | * configure.ac (AC_CONFIG_FILES): No longer make event.d/Makefile |
| 863 | |
Scott James Remnant | 59093a8 | 2006-10-10 13:09:58 +0100 | [diff] [blame] | 864 | * configure.ac: Check for --enable-compat, default to sysv if given |
| 865 | or no compat if not given. |
| 866 | * compat/sysv/Makefile.am: Don't build binaries or install manpages |
| 867 | unless COMPAT_SYSV is defined. |
| 868 | |
Scott James Remnant | 4515094 | 2006-10-06 16:36:27 +0100 | [diff] [blame] | 869 | 2006-10-06 Scott James Remnant <scott@netsplit.com> |
| 870 | |
| 871 | * doc/upstart-logo.svg: Include the logo Alexandre designed. |
| 872 | * doc/Makefile.am (EXTRA_DIST): Ship the logo in the tarball. |
| 873 | * Makefile.am (SUBDIRS): Install under doc |
| 874 | * configure.ac: Generate doc/Makefile |
| 875 | * AUTHORS: Ensure he's credited fully. |
| 876 | |
Scott James Remnant | 10b8c0e | 2006-09-27 21:27:38 +0100 | [diff] [blame] | 877 | 2006-09-27 Scott James Remnant <scott@netsplit.com> |
| 878 | |
Scott James Remnant | 44052a3 | 2006-09-28 00:04:32 +0100 | [diff] [blame] | 879 | * event.d/Makefile.am (do_subst): Eliminate duplicate /s |
| 880 | |
Scott James Remnant | 5222c40 | 2006-09-27 22:48:48 +0100 | [diff] [blame] | 881 | * man/init.8: Move to init/man |
| 882 | * init/Makefile.am: Update to install man page. |
| 883 | * man/logd.8: Move to logd/man |
| 884 | * logd/Makefile.am: Update to install man page. |
| 885 | * man/initctl.8, man/start.8: Move to initctl/man |
| 886 | * initctl/Makefile.am: Update to install man pages. |
| 887 | * man/reboot.8, man/runlevel.8, man/shutdown.8, man/telinit.8: |
| 888 | Move to compat/sysv/man |
| 889 | * compat/sysv/Makefile.am: Update to install man pages. |
| 890 | * man/Makefile.am: Remove |
| 891 | * configure.ac (AC_CONFIG_FILES): Remove man/Makefile |
| 892 | * Makefile.am (SUBDIRS): Don't build in man |
| 893 | |
Scott James Remnant | 545cb8c | 2006-09-27 21:32:49 +0100 | [diff] [blame] | 894 | * util: Rename to initctl |
| 895 | * configure.ac (AC_CONFIG_FILES): Update. |
| 896 | * Makefile.am (SUBDIRS): Update. |
| 897 | |
Scott James Remnant | 960c82d | 2006-09-27 21:30:42 +0100 | [diff] [blame] | 898 | * util/reboot.c: Move to compat/sysv |
| 899 | * util/shutdown.c: Move to compat/sysv |
| 900 | * util/Makefile.am: Update. |
| 901 | * compat/sysv/Makefile.am: Update. |
| 902 | |
Scott James Remnant | 10b8c0e | 2006-09-27 21:27:38 +0100 | [diff] [blame] | 903 | * configure.ac: Replace macros with single call to NIH_INIT. |
| 904 | Bump version to 0.3.0 to begin new development cycle. |
| 905 | |
Scott James Remnant | e559199 | 2006-09-21 05:49:34 +0100 | [diff] [blame] | 906 | 2006-09-21 Scott James Remnant <scott@netsplit.com> |
| 907 | |
| 908 | * logd/main.c: Revert the change that logged to the console, in |
| 909 | practice this doesn't work so well. I want to get rid of logd |
| 910 | in the long term, or at least just have it as a simple logging |
| 911 | proxy, so giving it features seems wrong. |
| 912 | |
Scott James Remnant | 9b58b84 | 2006-09-20 05:37:47 +0100 | [diff] [blame] | 913 | 2006-09-20 Scott James Remnant <scott@netsplit.com> |
| 914 | |
Scott James Remnant | 97f08fa | 2006-09-20 06:34:12 +0100 | [diff] [blame] | 915 | * configure.ac: Bump version to 0.2.8 |
| 916 | * NEWS: Updated. |
| 917 | |
Scott James Remnant | e59c71e | 2006-09-20 06:14:32 +0100 | [diff] [blame] | 918 | * logd/main.c (main): Check the kernel command-line for "quiet" |
| 919 | (line_reader): Write to console unless silent or a daemon |
| 920 | |
Scott James Remnant | 9b58b84 | 2006-09-20 05:37:47 +0100 | [diff] [blame] | 921 | * man/Makefile.am (dist_man_MANS): Drop sulogin.8 |
| 922 | * man/sulogin.8: Drop, we don't include an sulogin |
| 923 | |
Scott James Remnant | 0fafba4 | 2006-09-20 01:36:29 +0100 | [diff] [blame] | 924 | 2006-09-19 Michael Biebl <mbiebl@gmail.com> |
| 925 | |
| 926 | * event.d/Makefile.am (logd): Drop $(srcdir) |
| 927 | * init/Makefile.am (init_SOURCES): Distribute paths.h |
| 928 | |
Scott James Remnant | 58f165f | 2006-09-18 19:43:07 +0100 | [diff] [blame] | 929 | 2006-09-18 Michael Biebl <mbiebl@gmail.com> |
| 930 | |
| 931 | * configure.ac: Check for sys/inotify.h |
| 932 | |
Scott James Remnant | e371cab | 2006-09-18 16:16:00 +0100 | [diff] [blame] | 933 | 2006-09-18 Scott James Remnant <scott@netsplit.com> |
| 934 | |
| 935 | * util/shutdown.c (warning_message): Adjust method of constructing |
| 936 | the message to not confuse poor translators who think \r and \n are |
| 937 | the same thing! |
| 938 | |
Scott James Remnant | f2b1c05 | 2006-09-14 10:34:45 +0100 | [diff] [blame] | 939 | 2006-09-14 Scott James Remnant <scott@netsplit.com> |
| 940 | |
Scott James Remnant | b2e03d0 | 2006-09-14 11:20:13 +0100 | [diff] [blame] | 941 | * init/job.c (job_change_state): Catch runaway respawns when we |
| 942 | enter the running state, so we catch stop/start loops too. |
| 943 | * init/tests/test_job.c (test_change_state): Update test. |
| 944 | |
Scott James Remnant | b7714f7 | 2006-09-14 11:07:38 +0100 | [diff] [blame] | 945 | * event.d/logd: Rename to logd.in |
| 946 | * event.d/logd.in: Replace /sbin with @sbindir@ so we can transform |
| 947 | * event.d/Makefile.am: Generate logd from logd.in |
| 948 | |
Scott James Remnant | 7e6bdb3 | 2006-09-14 10:57:03 +0100 | [diff] [blame] | 949 | * util/reboot.c: Don't hardcode the location of /sbin/shutdown |
| 950 | * util/Makefile.am (DEFS): Use autoconf to seed it |
| 951 | * util/shutdown.c (sysvinit_shutdown): Don't hardcode the location |
| 952 | of /dev/initctl |
| 953 | |
Scott James Remnant | e0d0dd1 | 2006-09-14 10:51:05 +0100 | [diff] [blame] | 954 | * init/paths.h: Create a new configuration file that can contain |
| 955 | all of the path definitions, and in particular, allow them to be |
| 956 | overidden elsewhere. |
| 957 | * init/Makefile.am (DEFS): Override definitions of CFG_DIR and |
| 958 | TELINIT using autoconf |
| 959 | * init/main.c: Include paths.h. Don't hardcode location of telinit |
| 960 | * init/job.c: Include paths.h |
| 961 | * init/process.c: Include paths.h |
| 962 | * init/process.h: Remove definitions from here. |
| 963 | |
Scott James Remnant | f2b1c05 | 2006-09-14 10:34:45 +0100 | [diff] [blame] | 964 | * configure.ac: Bump version to 0.2.7 |
| 965 | |
Scott James Remnant | 0b8f23f | 2006-09-13 16:51:38 +0100 | [diff] [blame] | 966 | 2006-09-13 Scott James Remnant <scott@netsplit.com> |
| 967 | |
Scott James Remnant | 948ab87 | 2006-09-14 10:34:34 +0100 | [diff] [blame] | 968 | * NEWS: Updated. |
| 969 | |
Scott James Remnant | 0b8f23f | 2006-09-13 16:51:38 +0100 | [diff] [blame] | 970 | * TODO: More TODO. |
| 971 | |
Scott James Remnant | 080dd8d | 2006-09-10 12:42:03 +0100 | [diff] [blame] | 972 | 2006-09-10 Scott James Remnant <scott@netsplit.com> |
| 973 | |
| 974 | * util/reboot.c (main): Don't give -H with "halt". |
| 975 | |
Scott James Remnant | d704286 | 2006-09-09 00:50:10 +0100 | [diff] [blame] | 976 | 2006-09-09 Scott James Remnant <scott@netsplit.com> |
| 977 | |
Scott James Remnant | edb9790 | 2006-09-09 05:48:42 +0100 | [diff] [blame] | 978 | * configure.ac: Bump version to 0.2.6 |
| 979 | |
Scott James Remnant | 760237e | 2006-09-09 05:38:32 +0100 | [diff] [blame] | 980 | * NEWS: Update. |
| 981 | * TODO: Update. |
| 982 | |
Scott James Remnant | 5e267a4 | 2006-09-09 05:21:28 +0100 | [diff] [blame] | 983 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Change |
| 984 | the magic to be the package string. |
| 985 | * upstart/tests/test_control.c (test_recv_msg): Update tests. |
| 986 | |
Scott James Remnant | 17fec6e | 2006-09-09 05:05:42 +0100 | [diff] [blame] | 987 | * util/initctl.c (main): Set the usage string. |
| 988 | * util/shutdown.c (main): Set the usage string. |
| 989 | * util/start.c (main): Set the usage string. |
| 990 | * compat/sysv/runlevel.c (main): Set the usage string. |
| 991 | * compat/sysv/telinit.c (main): Set the usage string. |
| 992 | |
Scott James Remnant | abede80 | 2006-09-09 05:01:45 +0100 | [diff] [blame] | 993 | * man/Makefile.am: Use install-data-hook and $(man8dir) |
| 994 | * util/Makefile.am: Also use install-exec-hook |
| 995 | |
Scott James Remnant | c6c2005 | 2006-09-09 04:58:11 +0100 | [diff] [blame] | 996 | * Makefile.am (SUBDIRS): Install contents of the man directory |
| 997 | * configure.ac (AC_CONFIG_FILES): Generate man/Makefile |
| 998 | * man/Makefile.am: Install manpages in the appropriate places. |
| 999 | * man/init.8, man/logd.8, man/initctl.8, man/reboot.8, |
| 1000 | * man/shutdown.8, man/start.8, man/sulogin.8, man/runlevel.8, |
| 1001 | * man/telinit.8: Include some basic manpages so we at least have |
| 1002 | some level of documentation. |
| 1003 | |
Scott James Remnant | 33e4711 | 2006-09-09 03:45:00 +0100 | [diff] [blame] | 1004 | * init/job.c (job_child_reaper): Don't check the exit status of |
| 1005 | a respawning job if the goal is to stop it. |
| 1006 | |
Scott James Remnant | 1889aa6 | 2006-09-09 03:41:53 +0100 | [diff] [blame] | 1007 | * compat/sysv/telinit.c (main): Generate events rather than |
| 1008 | starting and stopping jobs directly, the events are named |
| 1009 | "runlevel-X". 0, 1, 6 and s/S are shutdown events. |
| 1010 | |
Scott James Remnant | 515b2b9 | 2006-09-09 03:41:27 +0100 | [diff] [blame] | 1011 | * logd/main.c (main): Raise SIGSTOP before entering the main loop. |
| 1012 | * init/main.c (main): Interlock with logd. |
| 1013 | |
Scott James Remnant | 17eb905 | 2006-09-09 03:41:04 +0100 | [diff] [blame] | 1014 | * event.d/logd: Should not be a console owner, but should stop |
| 1015 | on shutdown. |
| 1016 | |
Scott James Remnant | 3475226 | 2006-09-09 01:38:02 +0100 | [diff] [blame] | 1017 | * init/process.c (process_setup_console): Revert part of the previous |
| 1018 | change, should just output to /dev/null if we don't have logd. |
| 1019 | |
Scott James Remnant | e553333 | 2006-09-09 01:36:07 +0100 | [diff] [blame] | 1020 | * configure.ac: Bump version to 0.2.5 |
| 1021 | |
Scott James Remnant | b4a1c2b | 2006-09-09 01:28:26 +0100 | [diff] [blame] | 1022 | * init/main.c (main): Start the logd job if it exists. |
| 1023 | |
| 1024 | * init/process.c (process_setup_console): Ignore ECONNREFUSED as |
| 1025 | that just means that logd isn't around, handle errors by falling |
| 1026 | back to opening the console. |
| 1027 | |
Scott James Remnant | 9fb20d4 | 2006-09-09 01:22:03 +0100 | [diff] [blame] | 1028 | * init/process.c (process_setup_console): Implement handling for |
| 1029 | CONSOLE_LOGGED and generally clean up the other handling. |
| 1030 | * init/process.h: Update. |
| 1031 | * init/main.c (main): Pass NULL for the job to setup console. |
| 1032 | * TODO: Update. |
| 1033 | |
Scott James Remnant | d704286 | 2006-09-09 00:50:10 +0100 | [diff] [blame] | 1034 | * logd/main.c: Implement the logging daemon, it accepts connections |
| 1035 | on a unix stream socket with the abstract name |
| 1036 | "/com/ubuntu/upstart/logd", expects the length of the name and the |
| 1037 | name to follow; then sequences of lines which are logged to |
| 1038 | /var/log/boot, or memory until that file can be opened. |
| 1039 | |
Scott James Remnant | 527b945 | 2006-09-08 17:15:07 +0100 | [diff] [blame] | 1040 | 2006-09-08 Scott James Remnant <scott@netsplit.com> |
| 1041 | |
Scott James Remnant | cb655e7 | 2006-09-08 17:49:20 +0100 | [diff] [blame] | 1042 | * util/shutdown.c (event_setter): Change the event names to |
| 1043 | distinguish between "shutdown -h" and "shutdown -h -H". |
| 1044 | |
Scott James Remnant | 90732d3 | 2006-09-08 17:33:19 +0100 | [diff] [blame] | 1045 | * init/job.c (job_handle_event): Allow jobs to react to their own |
| 1046 | events, this is how we'll do respawn eventually. |
| 1047 | * init/tests/test_job.c (test_handle_event): Remove test. |
| 1048 | |
Scott James Remnant | bb3cc3f | 2006-09-08 17:17:47 +0100 | [diff] [blame] | 1049 | * init/main.c (cad_handler, kbd_handler): Generate the new event |
| 1050 | names. |
| 1051 | * init/event.h (CTRLALTDEL_EVENT, KBDREQUEST_EVENT): Add definitions |
| 1052 | of these event names, change the ctrlaltdel event to just that. |
| 1053 | |
Scott James Remnant | 527b945 | 2006-09-08 17:15:07 +0100 | [diff] [blame] | 1054 | * logd/main.c (main): Add the code to daemonise, etc. |
| 1055 | |
Scott James Remnant | a17917d | 2006-09-07 00:18:28 +0100 | [diff] [blame] | 1056 | 2006-09-07 Scott James Remnant <scott@netsplit.com> |
| 1057 | |
Scott James Remnant | 214ebe8 | 2006-09-07 21:48:55 +0100 | [diff] [blame] | 1058 | * TODO: Long discussion today on #upstart, many improvements to the |
| 1059 | job and event model that make it more elegant. |
| 1060 | * AUTHORS: Include a list of thanks. |
| 1061 | |
Scott James Remnant | b828007 | 2006-09-07 03:19:00 +0100 | [diff] [blame] | 1062 | * util/shutdown.c (shutdown_now): If we get ECONNREFUSED when we |
| 1063 | try and send the shutdown event to init, it probably means we're |
| 1064 | still in sysvinit. So try that instead. |
| 1065 | (sysvinit_shutdown): Function to send a hand-crafted runlevel |
| 1066 | change message across /dev/initctl. |
| 1067 | |
Scott James Remnant | ae96906 | 2006-09-07 00:43:57 +0100 | [diff] [blame] | 1068 | * util/initctl.c (main): Add a shutdown command that takes an |
| 1069 | arbitrary event name to be issued after "shutdown". You'll |
| 1070 | nearly always want the /sbin/shutdown tool instead. |
| 1071 | |
Scott James Remnant | 987bcc4 | 2006-09-07 00:38:24 +0100 | [diff] [blame] | 1072 | * init/job.c (job_detect_idle): Only generate the stalled event |
| 1073 | if at least one job handles it in its start_events list. |
| 1074 | * init/tests/test_job.c (test_detect_idle): Make sure that works. |
| 1075 | |
Scott James Remnant | ea204d4 | 2006-09-07 00:30:53 +0100 | [diff] [blame] | 1076 | * init/event.h (STARTUP_EVENT, SHUTDOWN_EVENT, STALLED_EVENT): |
| 1077 | Macros to define the standard event names. |
| 1078 | * init/main.c (main): Use STARTUP_EVENT macro instead of "startup" |
| 1079 | * init/control.c (control_handle): Use SHUTDOWN_EVENT macro |
| 1080 | instead of "shutdown". |
| 1081 | * init/job.c (job_detect_idle): Use STALLED_EVENT macro instead |
| 1082 | of "stalled". |
| 1083 | |
Scott James Remnant | 84607df | 2006-09-07 00:27:22 +0100 | [diff] [blame] | 1084 | * init/job.c (job_detect_idle): Add some log messages for when we |
| 1085 | detect the idle or stalled states. |
| 1086 | (job_kill_process, job_kill_timer): Increase log verbosity. |
| 1087 | * init/event.c (event_queue_run): Log which events we're handling |
| 1088 | if --debug is given. |
| 1089 | |
Scott James Remnant | a17917d | 2006-09-07 00:18:28 +0100 | [diff] [blame] | 1090 | * compat/sysv/telinit.c (main): Send a shutdown command when |
| 1091 | requesting to enter runlevel 0 or runlevel 6, likewise for |
| 1092 | runlevel 1, s or S which all run "rc1" not "rcS". |
| 1093 | * init/main.c (main): When called directory (pid != 1) try and |
| 1094 | run telinit before complaining that we're not init. Make sure |
| 1095 | errors aren't lost. |
| 1096 | |
Scott James Remnant | f5c376c | 2006-09-04 16:25:04 +0100 | [diff] [blame] | 1097 | 2006-09-04 Johan Kiviniemi <johan@kiviniemi.name> |
Scott James Remnant | edcae30 | 2006-09-04 07:06:23 +0100 | [diff] [blame] | 1098 | |
Scott James Remnant | f5c376c | 2006-09-04 16:25:04 +0100 | [diff] [blame] | 1099 | * upstart/control.c (upstart_addr): Replace use of __builtin_offsetof |
| 1100 | with offsetof. |
| 1101 | * upstart/tests/test_control.c (test_recv_msg): Likewise. |
| 1102 | |
| 1103 | 2006-09-04 Scott James Remnant <scott@netsplit.com> |
| 1104 | |
Scott James Remnant | edcae30 | 2006-09-04 07:06:23 +0100 | [diff] [blame] | 1105 | * util/shutdown.c (main): Exit normally after sending the warning |
| 1106 | message if -k is given. |
| 1107 | |
Scott James Remnant | e94bd20 | 2006-09-01 00:48:36 +0100 | [diff] [blame] | 1108 | 2006-09-01 Scott James Remnant <scott@netsplit.com> |
Scott James Remnant | d4cdaca | 2006-08-31 00:47:11 +0100 | [diff] [blame] | 1109 | |
Scott James Remnant | 294cde7 | 2006-09-01 19:58:35 +0100 | [diff] [blame] | 1110 | * configure.ac: Bump version to 0.2.2 |
| 1111 | |
Scott James Remnant | 7663bfb | 2006-09-01 19:58:19 +0100 | [diff] [blame] | 1112 | * NEWS: Update. |
| 1113 | * configure.ac: Bump version to 0.2.1 |
| 1114 | |
Scott James Remnant | 6798214 | 2006-09-01 19:47:39 +0100 | [diff] [blame] | 1115 | * init/process.c (process_setup_console): Ensure that the console |
| 1116 | is always initialised to at least /dev/null |
| 1117 | * init/job.c (job_change_state): Initialise event to NULL. |
| 1118 | * init/event.c (event_read_state): Don't mask initialisation of |
| 1119 | other variable. |
| 1120 | * init/cfgfile.c (cfg_job_stanza, cfg_parse_script, cfg_next_token): |
| 1121 | Print lineno using %zi not %d |
| 1122 | * compat/sysv/runlevel.c (store): Cast pointer type of timeval. |
| 1123 | |
Scott James Remnant | 097b2a9 | 2006-09-01 19:30:37 +0100 | [diff] [blame] | 1124 | * init/main.c: Move the kernel headers include beneath the C |
| 1125 | library ones, so that compilation doesn't fail on !i386. |
| 1126 | * util/reboot.c: Likewise. |
| 1127 | |
Scott James Remnant | 28fcc92 | 2006-09-01 04:15:57 +0100 | [diff] [blame] | 1128 | * init/main.c (term_handler): Close the control connection if we |
| 1129 | re-exec init, otherwise it won't be able to bind. Drop debugging. |
| 1130 | |
Scott James Remnant | 6f46496 | 2006-09-01 04:10:20 +0100 | [diff] [blame] | 1131 | * init/main.c (term_handler): It always helps if we dup2 the |
| 1132 | right file descriptor. |
| 1133 | |
Scott James Remnant | 1db8804 | 2006-09-01 03:14:19 +0100 | [diff] [blame] | 1134 | * init/main.c: Use the TERM signal instead of USR1, as old init |
| 1135 | used that for something else. Also rather than passing across |
| 1136 | file descriptor numbers, use a fixed descriptor and just pass |
| 1137 | "--restart". When we get that option we need to unmask signals |
| 1138 | otherwise we sit there looking like a lemon. |
| 1139 | |
Scott James Remnant | e7a7326 | 2006-09-01 02:32:27 +0100 | [diff] [blame] | 1140 | * init/job.c (job_change_state): Don't free the event unless we |
| 1141 | generate one. |
| 1142 | |
Scott James Remnant | 12dd725 | 2006-09-01 02:27:04 +0100 | [diff] [blame] | 1143 | * NEWS: Update. |
| 1144 | |
Scott James Remnant | 694172a | 2006-09-01 02:26:45 +0100 | [diff] [blame] | 1145 | * init/cfgfile.c (cfg_watcher): Ignore any file with '.' or '~' |
| 1146 | |
Scott James Remnant | c6e63dd | 2006-09-01 02:16:43 +0100 | [diff] [blame] | 1147 | * TODO: Update. |
| 1148 | |
Scott James Remnant | 3401ab7 | 2006-09-01 02:14:47 +0100 | [diff] [blame] | 1149 | * init/main.c (main): Parse command-line arguments, specifically |
| 1150 | look for --state-fd which we'll use for reexec. Don't do a couple |
| 1151 | of things if we're passed this. |
| 1152 | (read_state): Parse the line-buffered state. |
| 1153 | * init/job.c (job_read_state, job_write_state): Job state |
| 1154 | serialisation so that we can re-exec ourselves. |
| 1155 | * init/job.h: Update. |
| 1156 | * init/tests/test_job.c: Test the serialisation. |
| 1157 | * init/event.c (event_read_state, event_write_state): And similar |
| 1158 | functions for serialising the event queue. |
| 1159 | * init/event.h: Update. |
| 1160 | * init/tests/test_event.c: Test the serialisation. |
| 1161 | * init/cfgfile.c (cfg_read_job): Fix a bug, need to subtract current |
| 1162 | time to get due time. |
| 1163 | |
Scott James Remnant | e94bd20 | 2006-09-01 00:48:36 +0100 | [diff] [blame] | 1164 | * upstart/job.c (job_goal_from_name, job_state_from_name) |
| 1165 | (process_state_from_name): Add opposite numbers that convert a |
| 1166 | string back into an enumeration. |
| 1167 | * upstart/job.h: Update. |
| 1168 | * upstart/tests/test_job.c: Test the new functions. |
| 1169 | |
| 1170 | 2006-08-31 Scott James Remnant <scott@netsplit.com> |
Scott James Remnant | 694172a | 2006-09-01 02:26:45 +0100 | [diff] [blame] | 1171 | |
Scott James Remnant | b7260a7 | 2006-08-31 22:08:56 +0100 | [diff] [blame] | 1172 | * init/job.h (Job): Add respawn_limit, respawn_interval, |
| 1173 | respawn_count and respawn_time members so that we can keep track of |
| 1174 | runaway processes. |
| 1175 | * init/job.c (job_catch_runaway): Increment the respawn_count |
| 1176 | within respawn_interval, or reset it if we go over. |
| 1177 | (job_new): Initialise respawn_limit and respawn_interval to sensible |
| 1178 | defaults. |
| 1179 | * init/tests/test_job.c (test_new): Check the defaults are set. |
| 1180 | (test_change_state): Check the respawning code works. |
| 1181 | * init/cfgfile.c (cfg_job_stanza): Parse the "respawn limit" stanza. |
| 1182 | * init/tests/test_cfgfile.c (test_read_job): Test the new stanza. |
| 1183 | |
Scott James Remnant | ff0d26a | 2006-08-31 20:49:43 +0100 | [diff] [blame] | 1184 | * init/process.c (process_setup_console): Remove the console reset |
| 1185 | code, it tends to just crash X and seems to do nothing interesting. |
| 1186 | * init/main.c (reset_console): Instead put it here and just do it |
| 1187 | on startup. |
| 1188 | |
Scott James Remnant | 25b263a | 2006-08-31 18:59:02 +0100 | [diff] [blame] | 1189 | * configure.ac: Bump version to 0.2.0 |
| 1190 | |
Scott James Remnant | 4b61be9 | 2006-08-31 17:08:44 +0100 | [diff] [blame] | 1191 | * util/Makefile.am (install-exec-local): Create symbolic links, |
| 1192 | not hard links. |
| 1193 | |
Scott James Remnant | af1404f | 2006-08-31 16:04:16 +0100 | [diff] [blame] | 1194 | * init/main.c: Can't catch STOP. |
| 1195 | |
Scott James Remnant | 242b50b | 2006-08-31 15:40:42 +0100 | [diff] [blame] | 1196 | * util/reboot.c: Pause init while shutting down or rebooting. |
| 1197 | |
Scott James Remnant | eabb780 | 2006-08-31 15:39:04 +0100 | [diff] [blame] | 1198 | * init/main.c (stop_handler): Catch STOP/TSTP and CONT. |
| 1199 | * init/event.c (event_queue_run): Don't run the event queue while |
| 1200 | paused. |
| 1201 | * init/job.c (job_detect_idle): Don't detect idle jobs while paused. |
| 1202 | |
Scott James Remnant | 1cd8d86 | 2006-08-31 15:17:16 +0100 | [diff] [blame] | 1203 | * util/reboot.c: if we get the -w argument ("only write to wtmp") |
| 1204 | we need to exit, and not behave as halt normally would. |
| 1205 | |
Scott James Remnant | ff63cf7 | 2006-08-31 04:39:34 +0100 | [diff] [blame] | 1206 | * compat/sysv/runlevel.c (main): Add missing newline. |
| 1207 | * compat/sysv/telinit.c (main): And here too. |
| 1208 | |
Scott James Remnant | 32de922 | 2006-08-31 04:34:27 +0100 | [diff] [blame] | 1209 | * init/main.c (main): Check for idle after the startup event queue |
| 1210 | has been run, otherwise we may just sit there. |
| 1211 | |
Scott James Remnant | 13ffffe | 2006-08-31 04:33:39 +0100 | [diff] [blame] | 1212 | * compat/sysv/Makefile.am (sbin_PROGRAMS): Build and install telinit |
| 1213 | (telinit_SOURCES, telinit_LDFLAGS, telinit_LDADD): Details for |
| 1214 | telinit binary. |
| 1215 | * compat/sysv/telinit.c: Trivial telinit program that just runs |
| 1216 | the appropriate rcX job. |
| 1217 | * compat/sysv/runlevel.c (main): Suggest help on illegal runlevel. |
| 1218 | |
Scott James Remnant | 40f0901 | 2006-08-31 04:21:49 +0100 | [diff] [blame] | 1219 | * util/Makefile.am: Tidy up. |
| 1220 | |
Scott James Remnant | 1247356 | 2006-08-31 04:21:05 +0100 | [diff] [blame] | 1221 | * configure.ac (AC_CONFIG_FILES): Create compat/sysv/Makefile |
| 1222 | * Makefile.am (SUBDIRS): Build things found in compat/sysv |
| 1223 | * compat/sysv/Makefile.am (sbin_PROGRAMS): Build and install runlevel |
| 1224 | (runlevel_SOURCES, runlevel_LDFLAGS, runlevel_LDADD): Details for |
| 1225 | runlevel binary. |
| 1226 | * compat/sysv/runlevel.c: Helper to store and retrieve the current |
| 1227 | "runlevel" from utmp/wtmp; as well as the reboot time. |
| 1228 | |
Scott James Remnant | d909cca | 2006-08-31 04:20:14 +0100 | [diff] [blame] | 1229 | * init/main.c (main): Drop debugging set. |
| 1230 | |
Scott James Remnant | cedd11a | 2006-08-31 02:59:29 +0100 | [diff] [blame] | 1231 | * init/job.c (job_change_state): As well as the job/state events, |
| 1232 | send the job event when a service is running or a task is stopping. |
| 1233 | * init/tests/test_job.c (test_change_state): Check the events get |
| 1234 | sent properly. |
| 1235 | |
Scott James Remnant | 44b684a | 2006-08-31 02:58:45 +0100 | [diff] [blame] | 1236 | * util/start.c: Write a simple utility to start, stop, or query |
| 1237 | the status of the named jobs. |
| 1238 | * util/Makefile.am (sbin_PROGRAMS): Build and install start |
| 1239 | (start_SOURCES, start_LDFLAGS, start_LDADD): Details for start |
| 1240 | (install-exec-local): Also install as stop and status. |
| 1241 | * util/reboot.c (main): Drop the debugging set. |
| 1242 | |
Scott James Remnant | b8ed2d1 | 2006-08-31 02:15:48 +0100 | [diff] [blame] | 1243 | * init/cfgfile.c (cfg_job_stanza): Correct nih_alloc error. |
| 1244 | |
Scott James Remnant | a6125ae | 2006-08-31 02:14:25 +0100 | [diff] [blame] | 1245 | * init/process.c (process_setup_environment): Guard memory alloc. |
| 1246 | * init/job.c (job_set_idle_event): Likewise. |
| 1247 | (job_change_state): And here too. |
| 1248 | (job_run_command): Likewise. |
| 1249 | * init/control.c (control_send): Likewise. |
| 1250 | * init/cfgfile.c: And throughout this file. |
| 1251 | * upstart/control.c (upstart_recv_msg): And once here too. |
| 1252 | |
Scott James Remnant | 0b358ab | 2006-08-31 02:07:32 +0100 | [diff] [blame] | 1253 | * upstart/control.h: Abolish the separate halt, reboot and poweroff |
| 1254 | messages and replace with a single shutdown message that takes |
| 1255 | an event name (for the idle event issued afterwards). |
| 1256 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Handle |
| 1257 | the new shutdown event type by just treating it as an event. |
| 1258 | * upstart/tests/test_control.c (test_messages): Update tests. |
| 1259 | * init/job.c (job_set_idle_event): Store a copy of the idle event |
| 1260 | name. |
| 1261 | * init/control.c (control_send): Copy the shutdown event name. |
| 1262 | (control_handle): Replace individual handling with the new |
| 1263 | single event. |
| 1264 | * init/tests/test_control.c (test_watcher): Update. |
| 1265 | * util/initctl.c: Drop handling for things that shutdown does now. |
| 1266 | * util/shutdown.c: Send the UPSTART_SHUTDOWN event and let the user |
| 1267 | specify anything they want, just give defaults. |
| 1268 | |
Scott James Remnant | ff5efb9 | 2006-08-31 01:45:19 +0100 | [diff] [blame] | 1269 | This is quite a big change and abolishes level events entirely, |
| 1270 | along with the event history. We now just treat events as a |
| 1271 | transient queue of strings that go past, may cause things to change, |
| 1272 | but are otherwise forgotten. This turns out to be much easier to |
| 1273 | understand and has no real loss of power. |
| 1274 | |
| 1275 | * init/event.c: Vastly simplify; gone are the separate notions of |
| 1276 | edge and level events, instead we just treat them as one-shot |
| 1277 | things that go past and are forgotten about. |
| 1278 | * init/event.h (Event): Remove value member. |
| 1279 | Update prototypes. |
| 1280 | * init/tests/test_event.c: Update. |
| 1281 | * init/job.c (job_change_state): Change the event pattern to be |
| 1282 | one that includes the job name and a description of the transition |
| 1283 | instead of the new state. |
| 1284 | (job_detect_idle): Call event_queue rather than event_queue_edge. |
| 1285 | * init/tests/test_job.c: Update. |
| 1286 | * init/cfgfile.c (cfg_job_stanza): Drop "when" and "while". |
| 1287 | * init/tests/test_cfgfile.c (test_read_job): Drop mentions of |
| 1288 | "when" and "while". |
| 1289 | * init/control.c (control_send, control_handle): Drop cases for |
| 1290 | level events. |
| 1291 | (control_handle_event): Don't include a level in the event. |
| 1292 | * init/tests/test_control.c: Update |
| 1293 | * init/main.c: Call event_queue rather than event_queue_edge. |
| 1294 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Change |
| 1295 | event handling so that only a name is read. |
| 1296 | * upstart/control.h: Remove value/level event structures. |
| 1297 | * upstart/tests/test_control.c (test_messages): Update. |
| 1298 | * upstart/job.c (process_state_name): Not used for events, adjust |
| 1299 | documentation so it doesn't lie. |
| 1300 | * util/initctl.c (main): Drop the set function, simplify trigger. |
| 1301 | * util/shutdown.c (shutdown_now): Call UPSTART_EVENT_QUEUE for |
| 1302 | shutdown into maintenance mode. |
| 1303 | |
Scott James Remnant | fcbee2d | 2006-08-31 00:49:36 +0100 | [diff] [blame] | 1304 | * init/control.c (control_handle): Place a message in the syslog |
| 1305 | before halting, powering off or rebooting. |
| 1306 | |
Scott James Remnant | d4cdaca | 2006-08-31 00:47:11 +0100 | [diff] [blame] | 1307 | * util/shutdown.c: Adjust so that the warning message is sent out |
| 1308 | if shutdown is immediate, and when it actually happens. Include |
| 1309 | the hostname as wall does. |
| 1310 | |
Scott James Remnant | 255c5f2 | 2006-08-30 16:05:01 +0100 | [diff] [blame] | 1311 | 2006-08-30 Scott James Remnant <scott@netsplit.com> |
| 1312 | |
Scott James Remnant | 5be5566 | 2006-08-30 19:13:25 +0100 | [diff] [blame] | 1313 | * TODO: Update. |
| 1314 | |
Scott James Remnant | 4a9245f | 2006-08-30 19:13:00 +0100 | [diff] [blame] | 1315 | * util/shutdown.c: Implement shutdown utility along the same lines |
| 1316 | as the sysvinit one, but with rather different code. |
| 1317 | |
Scott James Remnant | 2a71aaa | 2006-08-30 16:34:06 +0100 | [diff] [blame] | 1318 | * util/initctl.c (main): Call setuid on the effective user id so |
| 1319 | that we can be made setuid root and executable by a special group. |
| 1320 | * util/reboot.c (main): Likewise. |
| 1321 | |
Scott James Remnant | 70cc229 | 2006-08-30 16:06:03 +0100 | [diff] [blame] | 1322 | * util/initctl.c (main): Check the effective rather than the real |
| 1323 | user id, if we're effectively root, that's good enough. |
| 1324 | |
Scott James Remnant | 255c5f2 | 2006-08-30 16:05:01 +0100 | [diff] [blame] | 1325 | * util/reboot.c: Implement reboot/halt/poweroff utility. |
| 1326 | * util/Makefile.am (sbin_PROGRAMS): Build and install reboot |
| 1327 | (reboot_SOURCES, reboot_LDFLAGS, reboot_LDADD): Details for reboot |
| 1328 | (install-exec-local): Create hardlinks to reboot for halt and poweroff. |
| 1329 | |
Scott James Remnant | dc8877d | 2006-08-29 16:56:48 +0100 | [diff] [blame] | 1330 | 2006-08-29 Scott James Remnant <scott@netsplit.com> |
| 1331 | |
| 1332 | * init/main.c (main): Actually run the idle-detect function. |
| 1333 | * init/job.c (job_detect_idle): Interrupt the main loop, otherwise |
| 1334 | we may end up waiting for a signal before we process the event |
| 1335 | we just issued. |
| 1336 | |
Scott James Remnant | f43bdf3 | 2006-08-27 18:20:29 +0100 | [diff] [blame] | 1337 | 2006-08-27 Scott James Remnant <scott@netsplit.com> |
| 1338 | |
Scott James Remnant | 4715848 | 2006-08-27 22:37:10 +0100 | [diff] [blame] | 1339 | * util/shutdown.c: Template main function. |
| 1340 | * util/Makefile.am (sbin_PROGRAMS): Build and install the |
| 1341 | shutdown binary. |
| 1342 | (shutdown_SOURCES, shutdown_LDFLAGS, shutdown_LDADD): Details for |
| 1343 | the shutdown binary |
| 1344 | |
Scott James Remnant | 70a6ec6 | 2006-08-27 22:23:50 +0100 | [diff] [blame] | 1345 | * util/initctl.c (main): Add commands for halt, poweroff and reboot. |
| 1346 | |
Scott James Remnant | 0c7e72a | 2006-08-27 22:22:53 +0100 | [diff] [blame] | 1347 | * init/event.c (event_queue_run): Remove the parameters. |
| 1348 | * init/event.h: Update. |
| 1349 | * init/main.c (main): Update. |
| 1350 | * init/tests/test_control.c (test_watcher): Update. |
| 1351 | * init/tests/test_job.c (test_detect_idle): Update. |
| 1352 | |
Scott James Remnant | 96ae9e4 | 2006-08-27 22:15:34 +0100 | [diff] [blame] | 1353 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Deal |
| 1354 | with halting, rebooting and powering off; or at least the appropriate |
| 1355 | messages. |
| 1356 | * upstart/control.h: Add control message structures for halting, |
| 1357 | powering off and rebooting the machine. |
| 1358 | * upstart/tests/test_control.c (test_messages): Run the tests. |
| 1359 | * init/control.c (control_handle): Add handling for halt, power off |
| 1360 | and reboot that issue the shutdown event and arrange for the halt, |
| 1361 | poweroff or reboot to be issued the next time the system is idle. |
| 1362 | * init/tests/test_control.c (test_watcher): Test the events. |
| 1363 | |
Scott James Remnant | 01a3708 | 2006-08-27 21:51:00 +0100 | [diff] [blame] | 1364 | * TODO: Update. |
| 1365 | |
Scott James Remnant | e02892b | 2006-08-27 21:49:44 +0100 | [diff] [blame] | 1366 | * init/job.c (job_detect_idle): Function to detect when the system is |
| 1367 | stalled or idle. |
| 1368 | * init/job.h: Update |
| 1369 | * init/tests/test_job.c (test_detect_idle): Test the new function. |
| 1370 | |
Scott James Remnant | 6a8508c | 2006-08-27 19:10:44 +0100 | [diff] [blame] | 1371 | * util/initctl.c (main): Handle the list command. |
| 1372 | |
Scott James Remnant | a9476ad | 2006-08-27 19:07:23 +0100 | [diff] [blame] | 1373 | * TODO: Update. |
| 1374 | |
Scott James Remnant | 4da474d | 2006-08-27 19:06:35 +0100 | [diff] [blame] | 1375 | * upstart/control.c (WireJobStatusPayload): add description to the |
| 1376 | job status payload. |
| 1377 | (upstart_send_msg_to, upstart_recv_msg): Send and receieve the |
| 1378 | description over the wire. |
| 1379 | * upstart/control.h (UpstartJobStatusMsg): add a description field |
| 1380 | * upstart/tests/test_control.c: Update test cases. |
| 1381 | * init/control.c (control_handle): Include the job description in |
| 1382 | the message. |
| 1383 | (control_send): Copy the description when we put the message on |
| 1384 | the queue. |
| 1385 | (control_handle_job): Copy the description here too |
| 1386 | * init/tests/test_control.c: Update test cases. |
| 1387 | |
Scott James Remnant | 84f5e93 | 2006-08-27 18:49:25 +0100 | [diff] [blame] | 1388 | * init/job.c (job_list): Add a function to return the job list. |
| 1389 | * init/job.h: Update. |
| 1390 | * init/control.c (control_handle): Handle the JOB_LIST message |
| 1391 | by sending back a list of job status messages followed by the |
| 1392 | JOB_LIST_END message. |
| 1393 | * init/tests/test_control.c (test_watcher_child): Check the |
| 1394 | JOB_LIST message works properly. |
| 1395 | |
Scott James Remnant | f4ad6d1 | 2006-08-27 18:40:01 +0100 | [diff] [blame] | 1396 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Handle |
| 1397 | the JOB_LIST and JOB_LIST_END messages which have no payload. |
| 1398 | * upstart/control.h: Add enums and structures for job list messages. |
| 1399 | * upstart/tests/test_control.c (test_messages): Update tests. |
| 1400 | |
Scott James Remnant | f497081 | 2006-08-27 18:27:19 +0100 | [diff] [blame] | 1401 | * init/main.c (main): Check that we're both uid and process #1 |
| 1402 | |
Scott James Remnant | f43bdf3 | 2006-08-27 18:20:29 +0100 | [diff] [blame] | 1403 | * init/main.c (main): Stop handling SIGTERM, we never want people |
| 1404 | to kill init. Handle SIGINT and SIGWINCH through the ordinary |
| 1405 | handler and SIGSEGV through a direct handler. |
| 1406 | (segv_handler): Write a sensible core dump handler, we use a child |
| 1407 | to dump core while we carry on in the parent hopefully stepping over |
| 1408 | the bad instruction. |
| 1409 | (cad_handler): Generate the control-alt-delete event. |
| 1410 | (kbd_handler): Generate the kbdrequest event. |
| 1411 | |
Scott James Remnant | 33e64d0 | 2006-08-25 14:44:32 +0200 | [diff] [blame] | 1412 | 2006-08-25 Scott James Remnant <scott@netsplit.com> |
| 1413 | |
Scott James Remnant | 2167925 | 2006-08-25 16:22:13 +0200 | [diff] [blame] | 1414 | * configure.ac: Bump version to 0.1.2 |
| 1415 | * NEWS: Update. |
| 1416 | |
Scott James Remnant | fef12b5 | 2006-08-25 16:16:45 +0200 | [diff] [blame] | 1417 | * TODO: Update. |
| 1418 | |
Scott James Remnant | 94d0098 | 2006-08-25 15:38:22 +0200 | [diff] [blame] | 1419 | * init/process.c (process_setup_environment): Inherit the PATH |
| 1420 | and TERM environment variables from the init process, so the |
| 1421 | console works properly. |
| 1422 | * init/process.h (PATH): Declare a default value for this variable |
| 1423 | * init/main.c (main): Set the value of PATH to the default. |
| 1424 | * init/tests/test_process.c (child): Update test case. |
| 1425 | |
Scott James Remnant | 33e64d0 | 2006-08-25 14:44:32 +0200 | [diff] [blame] | 1426 | * NEWS: Update. |
| 1427 | * configure.ac: Bump version to 0.1.1 |
| 1428 | |
Scott James Remnant | 68ccc9e | 2006-08-24 00:10:41 +0200 | [diff] [blame] | 1429 | 2006-08-24 Scott James Remnant <scott@netsplit.com> |
| 1430 | |
Scott James Remnant | 279d435 | 2006-08-24 15:33:19 +0200 | [diff] [blame] | 1431 | * init/cfgfile.h (CFG_DIR): Change configuration directory to |
| 1432 | /etc/event.d -- it's not been used by anyone, but is similar to |
| 1433 | other directories that have which is a good precedent. |
| 1434 | * event.d/Makefile.am (eventdir, dist_event_DATA): Install files |
| 1435 | into the new directory name. |
| 1436 | * Makefile.am (SUBDIRS): Rename sub directory |
| 1437 | * configure.ac (AC_CONFIG_FILES): Rename generated Makefile |
| 1438 | |
Scott James Remnant | 937192c | 2006-08-24 02:57:50 +0200 | [diff] [blame] | 1439 | * init/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 1440 | directories so out of tree builds work. |
| 1441 | * logd/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 1442 | directories so out of tree builds work. |
| 1443 | * upstart/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 1444 | directories so out of tree builds work. |
| 1445 | (upstartinclude_HEADERS): Install errors.h |
| 1446 | * util/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 1447 | directories so out of tree builds work. |
| 1448 | |
| 1449 | * Makefile.am (SUBDIRS): Add m4 to the list |
| 1450 | * configure.ac (AC_CONFIG_FILES): Generate m4/Makefile |
| 1451 | * upstart/Makefile.am (upstartinclude_HEADERS): Add errors.h |
| 1452 | |
| 1453 | * upstart/control.c (upstart_open): |
| 1454 | |
Scott James Remnant | e4c3d55 | 2006-08-24 02:34:01 +0200 | [diff] [blame] | 1455 | * init/control.c (control_open): Raise the error before |
| 1456 | performing other actions so errno is not lost. |
Scott James Remnant | 7355009 | 2006-08-24 02:27:03 +0200 | [diff] [blame] | 1457 | |
Scott James Remnant | e4c3d55 | 2006-08-24 02:34:01 +0200 | [diff] [blame] | 1458 | * TODO: Update.o |
Scott James Remnant | f8b776b | 2006-08-24 00:36:15 +0200 | [diff] [blame] | 1459 | * init/cfgfile.c (cfg_next_token): Don't count quote characters |
| 1460 | unless we're actually planning to dequote the file, otherwise we |
| 1461 | end up allocating short. |
| 1462 | |
Scott James Remnant | 9e17fc0 | 2006-08-24 00:28:10 +0200 | [diff] [blame] | 1463 | * init/control.c (control_close): Free the io_watch using list_free |
| 1464 | in case a destructor has been set. |
| 1465 | * init/tests/test_control.c: Initialise the type of the message, and |
| 1466 | free job correctly. |
| 1467 | |
Scott James Remnant | 68ccc9e | 2006-08-24 00:10:41 +0200 | [diff] [blame] | 1468 | * upstart/tests/test_control.c: Fix overwrite of buffer. |
| 1469 | * init/tests/test_job.c: Clean up not-freed job. |
| 1470 | |
Scott James Remnant | c961ce3 | 2006-08-23 19:46:29 +0200 | [diff] [blame] | 1471 | 2006-08-23 Scott James Remnant <scott@netsplit.com> |
| 1472 | |
Scott James Remnant | 013e972 | 2006-08-23 23:00:14 +0200 | [diff] [blame] | 1473 | * init/tests/test_event.c: free the entry allocated and initialise |
| 1474 | the return values. |
| 1475 | |
Scott James Remnant | c961ce3 | 2006-08-23 19:46:29 +0200 | [diff] [blame] | 1476 | * init/cfgfile.c (cfg_skip_token): Drop this function; we'll |
| 1477 | make sure *pos is pointing at the start of the thing we want |
| 1478 | to parse, not the first token. Update the other functions |
| 1479 | accordingly. |
| 1480 | (cfg_read_job): Implement function to look over a job file and |
| 1481 | parse all of the stanzas that are found. Also sanity checks the |
| 1482 | job afterwards and deals with reloading existing jobs. |
| 1483 | (cfg_job_stanza): Function that parses an individual stanza, |
| 1484 | calling out to the other parse functions; this is the main config |
| 1485 | file parser! |
| 1486 | (cfg_parse_args, cfg_parse_command): Drop requirement that filename |
| 1487 | and lineno be passed, so we can be called to reparse arguments after |
| 1488 | we've already done so. |
| 1489 | (cfg_parse_script): Remove requirement that it be called at the |
| 1490 | start of the entire stanza, and instead at the start of the script. |
| 1491 | When hitting EOF, return the script so far, not NULL. |
| 1492 | (cfg_parse_args): Correct bug where we didn't check sufficient |
| 1493 | characters while skipping whitespace. |
| 1494 | (cfg_next_token): Correct bug where we didn't copy the character |
| 1495 | after a slash into the text, instead of just not copying the slash. |
| 1496 | Adjust line numbers to match the fact that it's zero based now. |
| 1497 | * init/cfgfile.h: Define prototype. |
| 1498 | * init/tests/test_cfgfile.c (test_read_job): Pretty thoroughly |
| 1499 | test the config file parser code. |
| 1500 | |
Scott James Remnant | 0c58ed0 | 2006-08-22 11:42:19 +0200 | [diff] [blame] | 1501 | 2006-08-22 Scott James Remnant <scott@netsplit.com> |
| 1502 | |
Scott James Remnant | 214168f | 2006-08-22 18:52:51 +0200 | [diff] [blame] | 1503 | * init/cfgfile.c (cfg_tokenise): Rename to cfg_next_token. |
| 1504 | (cfg_skip_token): Code to skip whitespace, token and whitespace. |
| 1505 | (cfg_parse_args): Function to parse an argument list. |
| 1506 | (cfg_next_token): Extend to support the removal of quotes and |
| 1507 | slashes from the token. |
| 1508 | |
Scott James Remnant | 21590a2 | 2006-08-22 17:40:48 +0200 | [diff] [blame] | 1509 | * init/cfgfile.c (cfg_parse_script): Pass filename and lineno and |
| 1510 | increment the latter as we go. |
| 1511 | (cfg_script_end): Pass and increment lineno. |
| 1512 | |
Scott James Remnant | eed2e8d | 2006-08-22 17:31:07 +0200 | [diff] [blame] | 1513 | * init/cfgfile.c: Correct a missing semi-colon in prototypes. |
| 1514 | (cfg_parse_command): Function to parse any stanza that requires |
| 1515 | a command and arguments list, e.g. exec/respawn/daemon. We don't |
| 1516 | want to require that the list be quoted, etc. and do want to allow |
| 1517 | it to be folded over lines. |
| 1518 | (cfg_tokenise): Function used by the above to tokenise the file, |
| 1519 | handling things like \, quoted strings and newlines, etc. Can be |
| 1520 | used both to determine the length of the token and to copy it. |
| 1521 | |
Scott James Remnant | fcc98ad | 2006-08-22 12:28:19 +0200 | [diff] [blame] | 1522 | * init/cfgfile.c (cfg_read_script): Rename to cfg_parse_script. |
| 1523 | |
Scott James Remnant | fd32dd3 | 2006-08-22 11:46:01 +0200 | [diff] [blame] | 1524 | * init/cfgfile.c (cfg_read_script): Function to parse a script |
| 1525 | fragment ("foo script\n....end script\n") from the job file, which |
| 1526 | is the most complex form we can find. Write it assuming the file is |
| 1527 | in a character array which may not be NULL terminated (ie. a mmap'd |
| 1528 | file). |
| 1529 | (cfg_script_end): Used by the above to detect the end of the |
| 1530 | fragment. |
| 1531 | * init/cfgfile.h: Empty header file. |
| 1532 | * init/Makefile.am (init_SOURCES): Build and link cfgfile.c |
| 1533 | using the cfgfile.h header |
| 1534 | (TESTS): Build and run the config file test cases. |
| 1535 | (test_cfgfile_SOURCES, test_cfgfile_LDFLAGS, test_cfgfile_LDADD): |
| 1536 | Details for config file test case binary. |
| 1537 | |
Scott James Remnant | 0c58ed0 | 2006-08-22 11:42:19 +0200 | [diff] [blame] | 1538 | * init/main.c (main): Remove the calls to the unfinished config |
| 1539 | file code. |
| 1540 | |
Scott James Remnant | 6ce4481 | 2006-08-21 08:46:32 +0200 | [diff] [blame] | 1541 | 2006-08-21 Scott James Remnant <scott@netsplit.com> |
| 1542 | |
Scott James Remnant | 027dd7b | 2006-08-21 09:01:25 +0200 | [diff] [blame] | 1543 | * init/main.c: Add missing include for unistd.h |
| 1544 | * init/process.c (process_setup_console): Drop use of job. |
| 1545 | * util/initctl.c (main): Check that we're run as root. |
| 1546 | |
Scott James Remnant | 77e8db3 | 2006-08-21 08:47:50 +0200 | [diff] [blame] | 1547 | * init/main.c (main): Write the main function |
| 1548 | |
Scott James Remnant | 6ecceb8 | 2006-08-21 08:47:23 +0200 | [diff] [blame] | 1549 | * init/event.c (event_queue_cb): Rename to event_queue_run. |
| 1550 | * init/event.h: Update. |
| 1551 | |
Scott James Remnant | 6ce4481 | 2006-08-21 08:46:32 +0200 | [diff] [blame] | 1552 | * init/process.c (process_setup_console): Become an exported |
| 1553 | function that includes the code to reset a console. |
| 1554 | |
Scott James Remnant | 5befd93 | 2006-08-19 19:24:54 +0100 | [diff] [blame] | 1555 | 2006-08-19 Scott James Remnant <scott@netsplit.com> |
| 1556 | |
Scott James Remnant | cd39a7c | 2006-08-19 20:02:17 +0100 | [diff] [blame] | 1557 | * logd/main.c (main): Write the basic main function. |
| 1558 | |
Scott James Remnant | 3bcd15e | 2006-08-19 19:50:12 +0100 | [diff] [blame] | 1559 | * util/initctl.c (main): Fill in the details to give us a basic |
| 1560 | test client. |
| 1561 | |
Scott James Remnant | 3dc965c | 2006-08-19 19:25:23 +0100 | [diff] [blame] | 1562 | * TODO: Update. |
| 1563 | |
Scott James Remnant | 5befd93 | 2006-08-19 19:24:54 +0100 | [diff] [blame] | 1564 | * util/initctl.c (main): Provide the most basic main function. |
| 1565 | * util/Makefile.am (sbin_PROGRAMS): Build the initctl binary |
| 1566 | * Makefile.am (SUBDIRS): Build the utilities. |
| 1567 | * configure.ac (AC_CONFIG_FILES): Generate the util Makefile. |
| 1568 | |
Scott James Remnant | 1fe38a8 | 2006-08-18 17:06:25 +0100 | [diff] [blame] | 1569 | 2006-08-18 Scott James Remnant <scott@netsplit.com> |
| 1570 | |
Scott James Remnant | c265961 | 2006-08-18 22:19:47 +0100 | [diff] [blame] | 1571 | * init/Makefile.am (test_job_LDADD): Remove the duplicate link. |
| 1572 | |
Scott James Remnant | d5e0705 | 2006-08-18 20:39:30 +0100 | [diff] [blame] | 1573 | * TODO: Update. |
| 1574 | |
Scott James Remnant | a060bb7 | 2006-08-18 20:16:55 +0100 | [diff] [blame] | 1575 | * init/job.c (job_handle_child): Rename to job_child_reaper. |
| 1576 | * init/job.h: Update. |
| 1577 | * init/tests/test_job.c: Update function names. |
| 1578 | |
Scott James Remnant | 829dc08 | 2006-08-18 20:10:02 +0100 | [diff] [blame] | 1579 | * init/control.c (control_cb): Rename to control_watcher |
| 1580 | * init/tests/test_control.c: Update function names. |
| 1581 | |
Scott James Remnant | ddc3e28 | 2006-08-18 18:49:50 +0100 | [diff] [blame] | 1582 | * TODO: Update. |
| 1583 | |
Scott James Remnant | c2cac3f | 2006-08-18 17:17:57 +0100 | [diff] [blame] | 1584 | * Makefile.am (SUBDIRS): Install the rc.d files. |
| 1585 | * configure.ac (AC_CONFIG_FILES): Generate the rc.d Makefile. |
| 1586 | * rc.d/Makefile.am (rcdir): Define rcdir to be /etc/rc.d |
| 1587 | (dist_rc_DATA): Install the logd file into that directory. |
| 1588 | * rc.d/logd: Write a simple service definition for the log daemon, |
| 1589 | this saves us hardcoding any information about it into init; it'll |
| 1590 | just need to know the name. |
| 1591 | |
Scott James Remnant | 1fe38a8 | 2006-08-18 17:06:25 +0100 | [diff] [blame] | 1592 | * Makefile.am (SUBDIRS): Build the logd daemon |
| 1593 | * configure.ac (AC_CONFIG_FILES): Generate the logd Makefile. |
| 1594 | * logd/Makefile.am (sbin_PROGRAMS): Install the logd binary into |
| 1595 | the sbin directory by default. |
| 1596 | (logd_SOURCES): Build and link main.c |
| 1597 | * logd/main.c (main): Add basic main function for testing purposes. |
| 1598 | |
Scott James Remnant | b981443 | 2006-08-16 02:11:51 +0100 | [diff] [blame] | 1599 | 2006-08-16 Scott James Remnant <scott@netsplit.com> |
| 1600 | |
Scott James Remnant | c5da6fd | 2006-08-16 18:06:49 +0100 | [diff] [blame] | 1601 | * init/job.c (job_start): Ignore self-dependencies; over-document |
| 1602 | why the dependency event prodding has a surprise in its tail. |
| 1603 | (job_change_state): Move the job_release_depends call to here. |
| 1604 | |
Scott James Remnant | 133a7a3 | 2006-08-16 17:45:51 +0100 | [diff] [blame] | 1605 | * init/event.c (event_queue_cb): Add event consumer/dispatcher. |
Scott James Remnant | 13e5dbf | 2006-08-16 17:48:01 +0100 | [diff] [blame] | 1606 | * init/event.h: Update. |
Scott James Remnant | 133a7a3 | 2006-08-16 17:45:51 +0100 | [diff] [blame] | 1607 | |
Scott James Remnant | 3772bc6 | 2006-08-16 17:41:34 +0100 | [diff] [blame] | 1608 | * init/control.c (control_send): Make the event code clearer. |
| 1609 | (control_handle): Handle the changed event semantics. |
| 1610 | (control_handle_event): Issue the new event type. |
| 1611 | * init/tests/test_control.c: Update tests. |
| 1612 | |
Scott James Remnant | caee5b5 | 2006-08-16 17:32:12 +0100 | [diff] [blame] | 1613 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Adjust |
| 1614 | marshal code to match. |
| 1615 | * upstart/control.h: Update all structures appropriately to the |
| 1616 | previous changes. |
| 1617 | * upstart/tests/test_control.c: Update. |
| 1618 | |
Scott James Remnant | 4d4389d | 2006-08-16 17:19:20 +0100 | [diff] [blame] | 1619 | * init/job.c (job_change_state): Change call to event_trigger_level |
| 1620 | to event_queue_level. |
| 1621 | |
Scott James Remnant | 51664d7 | 2006-08-16 17:17:58 +0100 | [diff] [blame] | 1622 | * init/event.c (event_trigger_edge, event_trigger_level): Place |
| 1623 | the event on the event_queue rather than directly triggering it. |
| 1624 | Rename to event_queue_edge and event_queue_level respectively. |
| 1625 | * init/event.h: Update. |
| 1626 | * init/tests/test_event.c: Update test cases. |
| 1627 | |
Scott James Remnant | 4ddc86e | 2006-08-16 16:17:48 +0100 | [diff] [blame] | 1628 | * init/job.c (job_handle_event): Add another sanity check, jobs |
| 1629 | should not be able to react to their own events; that's just silly. |
| 1630 | * init/tests/test_job.c (test_handle_event): Check that the new |
| 1631 | condition does the right thing. |
| 1632 | |
Scott James Remnant | 930f3e0 | 2006-08-16 16:13:03 +0100 | [diff] [blame] | 1633 | * init/job.c (job_change_state): Make it illegal for a job to exist |
| 1634 | without either a command or script or both. This is for sanity |
| 1635 | reasons, allowing no primary process makes no sense and can lead |
| 1636 | to event loops if someone is feeling nefarious. |
| 1637 | * init/tests/test_job.c (test_change_state): Drop test on behaviour |
| 1638 | we've just outlawed. |
| 1639 | |
Scott James Remnant | 7dd047e | 2006-08-16 13:43:50 +0100 | [diff] [blame] | 1640 | * init/job.c (job_start): Only announce the change if we're still |
| 1641 | in the waiting state, we could have moved on to running already. |
| 1642 | |
Scott James Remnant | f9261ba | 2006-08-16 13:40:05 +0100 | [diff] [blame] | 1643 | * init/job.c (job_start): If holding the job, at least announce |
| 1644 | the goal change to subscribed clients. |
| 1645 | |
Scott James Remnant | 853cc77 | 2006-08-16 13:34:51 +0100 | [diff] [blame] | 1646 | * TODO: Update. |
| 1647 | |
Scott James Remnant | fdb8259 | 2006-08-16 13:31:49 +0100 | [diff] [blame] | 1648 | * init/job.c (job_start): Check for dependencies before starting |
| 1649 | the process, if we have any that aren't running we stay in waiting |
| 1650 | until they are. Any that aren't even starting get poked with a |
| 1651 | dependency event to see whether that wakes them up. |
| 1652 | * init/tests/test_job.c (test_start): Test paths through new |
| 1653 | dependency code. |
| 1654 | |
Scott James Remnant | 278150a | 2006-08-16 12:56:34 +0100 | [diff] [blame] | 1655 | * init/job.c (job_run_process): Once we've got an active process |
| 1656 | in the running state, release our dependencies. |
| 1657 | |
Scott James Remnant | 6d4104d | 2006-08-16 12:50:39 +0100 | [diff] [blame] | 1658 | * init/job.c (job_release_depends): Function to release any waiting |
| 1659 | dependencies on the given job. |
| 1660 | * init/job.h: Update. |
| 1661 | * init/tests/test_job.c (test_release_depends): Test the behaviour |
| 1662 | of the function on its own. |
| 1663 | |
Scott James Remnant | 1da1dad | 2006-08-16 12:18:50 +0100 | [diff] [blame] | 1664 | * init/job.h (Job): Add depends list field |
| 1665 | (JobName): New structure to hold the name of a job. |
| 1666 | * init/job.c (job_new): Initialise the depends list. |
| 1667 | * init/tests/test_job.c (test_new): Make sure the depends list is |
| 1668 | initialised properly. |
| 1669 | |
Scott James Remnant | 37eee03 | 2006-08-16 12:10:49 +0100 | [diff] [blame] | 1670 | * init/job.c (job_next_state): Return JOB_STARTING if we're in |
| 1671 | JOB_WAITING and the goal is JOB_START. This is only called when |
| 1672 | there's some change, and I don't want to hard-code the goal there. |
| 1673 | (job_start): Don't hardcode JOB_STARTING, instead just use the next |
| 1674 | state. |
| 1675 | * init/tests/test_job.c (test_next_state): Adjust test case. |
| 1676 | |
Scott James Remnant | c3d3ead | 2006-08-16 09:00:50 +0100 | [diff] [blame] | 1677 | * init/control.c (control_subscribe): Allow the current |
| 1678 | subscription to be found by passing NOTIFY_NONE. |
| 1679 | (control_handle): Don't remove an existing subscription to jobs, |
| 1680 | a GUI will probably want a permanent one to keep the status up to |
| 1681 | date. |
| 1682 | |
Scott James Remnant | b9a568c | 2006-08-16 08:57:46 +0100 | [diff] [blame] | 1683 | * init/job.c (job_kill_process, job_kill_timer): Don't hardcode |
| 1684 | JOB_STOPPING here, instead move to the next logical state. |
| 1685 | (job_kill_process): Notify subscribed processes that we killed |
| 1686 | the job. |
| 1687 | (job_start, job_stop): Notify subscribed processes of a change of |
| 1688 | goal that doesn't result in an immediate state change. |
| 1689 | |
Scott James Remnant | 8dbc601 | 2006-08-16 08:57:38 +0100 | [diff] [blame] | 1690 | * init/event.c (event_trigger_edge, event_trigger_level): Swap |
| 1691 | order so that events are announced before processed. |
| 1692 | |
Scott James Remnant | 2816125 | 2006-08-16 08:41:48 +0100 | [diff] [blame] | 1693 | * init/control.c (control_handle): Handle requests to watch and |
| 1694 | unwatch jobs and events. |
| 1695 | * init/tests/test_control.c (test_cb_child, test_cb): Check that |
| 1696 | subscriptions work. |
| 1697 | |
Scott James Remnant | b6d55bf | 2006-08-16 08:24:16 +0100 | [diff] [blame] | 1698 | * init/tests/test_control.c (test_cb_child): Add a sleep to avoid |
| 1699 | a race that upsets gdb, have tried this with a STOP/CONT interlock |
| 1700 | but can't seem to find where the child should reach first. |
| 1701 | |
Scott James Remnant | 5612b23 | 2006-08-16 08:21:06 +0100 | [diff] [blame] | 1702 | * init/job.c (job_change_state): Notify the control handler. |
| 1703 | * init/event.c (event_trigger_edge, event_trigger_level): Pass |
| 1704 | event to the control handler. |
| 1705 | * init/tests/test_control.c (test_cb_child): Expect to receive |
| 1706 | job status events as well. |
| 1707 | * init/Makefile.am (test_event_LDADD, test_process_LDADD) |
| 1708 | (test_job_LDADD): Add control.o to the linkage. |
| 1709 | |
Scott James Remnant | 9e0626a | 2006-08-16 08:17:07 +0100 | [diff] [blame] | 1710 | * init/control.c (control_cb): Don't display an error for |
| 1711 | ECONNREFUSED, just remove any subscriptions. |
| 1712 | * init/tests/test_control.c (test_handle_job, test_handle_error): |
| 1713 | Clean up our subscriptions properly. |
| 1714 | |
Scott James Remnant | 3c465c8 | 2006-08-16 07:40:24 +0100 | [diff] [blame] | 1715 | * init/control.c (control_handle_job): Function to send out an |
| 1716 | UPSTART_JOB_STATUS message to subscribed processes whenever a |
| 1717 | job state changes. |
| 1718 | (control_handle_event): Function to send out an |
| 1719 | UPSTART_EVENT_TRIGGERED message to subscribed processes whenever |
| 1720 | an event is triggered. |
| 1721 | * init/control.h: Update. |
| 1722 | * init/tests/test_control.c (test_handle_job, test_handle_event): |
| 1723 | Check that the functions work properly. |
| 1724 | |
Scott James Remnant | 16dadc5 | 2006-08-16 07:27:40 +0100 | [diff] [blame] | 1725 | * init/control.c (control_handle): Handle messages that trigger |
| 1726 | edge and level events; subscribe the process to receive notification |
| 1727 | of job changes during the event. |
| 1728 | * init/tests/test_control.c (test_cb_child): Check that the messages |
| 1729 | are handled properly (without subscription check). |
| 1730 | |
Scott James Remnant | a7ba72a | 2006-08-16 07:11:30 +0100 | [diff] [blame] | 1731 | * init/control.c (control_cb): Unsubscribe a process if it stops |
| 1732 | listening. |
| 1733 | |
Scott James Remnant | 2c9669c | 2006-08-16 07:10:05 +0100 | [diff] [blame] | 1734 | * init/control.c (control_send): Copy the pointers in the new |
| 1735 | event messages. |
| 1736 | * init/tests/test_control.c (test_send): Check the pointers are |
| 1737 | copied across correctly. |
| 1738 | |
Scott James Remnant | 15d61c6 | 2006-08-16 06:55:58 +0100 | [diff] [blame] | 1739 | * init/control.c (control_subscribe): Add function to handle |
| 1740 | processes that want to subscribe to changes. |
| 1741 | (control_init): Initialise the subscriptions list. |
| 1742 | * init/control.h: Add structures and prototypes. |
| 1743 | * init/tests/test_control.c (test_subscribe): Test the function. |
| 1744 | |
Scott James Remnant | 8692f76 | 2006-08-16 06:21:13 +0100 | [diff] [blame] | 1745 | * upstart/control.h (UpstartMsgType): add messages for triggering |
| 1746 | edge and level events, receiving the trigger for an event and for |
| 1747 | watching jobs and events. |
| 1748 | (UpstartEventTriggerEdgeMsg, UpstartEventTriggerLevelMsg) |
| 1749 | (UpstartEventTriggeredMsg, UpstartWatchJobsMsg) |
| 1750 | (UpstartUnwatchJobsMsg, UpstartWatchEventsMsg): |
| 1751 | (UpstartUnwatchEventsMsg): Add structures for the new messages. |
| 1752 | (UpstartMsg): And add them to the union. |
| 1753 | * upstart/control.c (WireEventPayload): The event messages can all |
| 1754 | share a wire payload type; the watch messages don't need any special |
| 1755 | payload. |
| 1756 | (upstart_send_msg_to): Add the payloads onto the wire. |
| 1757 | (upstart_recv_msg): And take the payloads back off the wire. |
| 1758 | * upstart/tests/test_control.c (test_messages): Test the new |
| 1759 | message types. |
| 1760 | |
Scott James Remnant | 8ed97eb | 2006-08-16 05:46:44 +0100 | [diff] [blame] | 1761 | * upstart/control.h (UpstartJobStatusMsg): add a process id. |
| 1762 | * upstart/control.c (WireJobStatusPayload): and here too. |
| 1763 | (upstart_send_msg_to): copy the process id onto the wire. |
| 1764 | (upstart_recv_msg): copy the process id from the wire. |
| 1765 | * init/control.c (control_handle): Fill in the pid from the job. |
| 1766 | * upstart/tests/test_control.c (test_messages): Check the pid gets |
| 1767 | passed across the wire properly. |
| 1768 | |
Scott James Remnant | 7d91431 | 2006-08-16 05:37:50 +0100 | [diff] [blame] | 1769 | * init/control.c (control_cb): Disable the poll for write once the |
| 1770 | send queue becomes empty. |
| 1771 | |
Scott James Remnant | 59707c2 | 2006-08-16 05:32:20 +0100 | [diff] [blame] | 1772 | * upstart/Makefile.am (libupstart_la_SOURCES): Correct ordering. |
| 1773 | |
Scott James Remnant | a98c8b8 | 2006-08-16 05:32:02 +0100 | [diff] [blame] | 1774 | * init/control.c (control_handle): Add missing break. |
| 1775 | |
Scott James Remnant | b5c7a30 | 2006-08-16 05:24:55 +0100 | [diff] [blame] | 1776 | * upstart/job.c (job_goal_name, process_state_name): For completeness |
| 1777 | add these two functions as well. |
| 1778 | * upstart/job.h: Update. |
| 1779 | * upstart/tests/test_job.c (test_goal_name) |
| 1780 | (test_process_state_name): Test the new functions. |
| 1781 | |
Scott James Remnant | 20b15ad | 2006-08-16 05:20:02 +0100 | [diff] [blame] | 1782 | * init/job.c (job_state_name): Move this utility function from here |
| 1783 | * upstart/job.c (job_state_name): to here so all clients can use |
| 1784 | it. |
| 1785 | * init/job.h: Update. |
| 1786 | * upstart/job.h: Update. |
| 1787 | * init/tests/test_job.c (test_state_name): Move the test case from here |
| 1788 | * upstart/tests/test_job.c: to here as well. |
| 1789 | * upstart/Makefile.am (libupstart_la_SOURCES): Build and link job.c |
| 1790 | (TESTS): Run the job test cases |
| 1791 | (test_job_SOURCES, test_job_LDFLAGS, test_job_LDADD): Details for |
| 1792 | job test case binary. |
| 1793 | * init/Makefile.am (test_job_LDADD, test_process_LDADD) |
| 1794 | (test_event_LDADD): Link to libupstart.la |
| 1795 | |
Scott James Remnant | 7a5c667 | 2006-08-16 05:01:13 +0100 | [diff] [blame] | 1796 | * init/control.c: Code to handle the server end of the control |
| 1797 | socket, a bit more complex than a client as we want to avoid |
| 1798 | blocking on malcious clients. |
| 1799 | * init/control.h: Prototypes. |
| 1800 | * init/tests/test_control.c: Test the control code. |
| 1801 | * init/Makefile.am (init_SOURCES): Build and link control.c |
| 1802 | using the control.h header |
| 1803 | (init_LDADD): Link to libupstart as well |
| 1804 | (TESTS): Build and run the control test suite. |
| 1805 | (test_control_SOURCES, test_control_LDFLAGS, test_control_LDADD): |
| 1806 | Details for control test suite binary. |
| 1807 | |
Scott James Remnant | b7cbda5 | 2006-08-16 04:53:38 +0100 | [diff] [blame] | 1808 | * upstart/control.c: Add a way to disable the safety checks. |
| 1809 | * upstart/tests/test_control.c (test_free): Fix bad test case. |
| 1810 | |
Scott James Remnant | 71d4d84 | 2006-08-16 04:29:21 +0100 | [diff] [blame] | 1811 | * upstart/control.c (upstart_recv_msg): fixed bogus return type |
| 1812 | for recvmsg from size_t to ssize_t so we don't infiniloop on error. |
| 1813 | |
Scott James Remnant | 2bda383 | 2006-08-16 03:41:10 +0100 | [diff] [blame] | 1814 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Avoid |
| 1815 | job_start as the short-cut for assigning name, as that might become |
| 1816 | a more complex message eventually. Use job_query instead. |
| 1817 | |
Scott James Remnant | d154b95 | 2006-08-16 03:39:35 +0100 | [diff] [blame] | 1818 | * upstart/control.c (upstart_free): Add wrapper function around |
| 1819 | nih_free so we're a proper library and don't expose libnih too much |
| 1820 | (upstart_recv_msg): Stash the sender pid in an argument. |
| 1821 | * upstart/control.h: Update. |
| 1822 | * upstart/tests/test_control.c (test_recv_msg): Test pid is |
| 1823 | returned properly. |
| 1824 | (test_free): Test the nih_free wrapper. |
| 1825 | |
Scott James Remnant | dc0eb44 | 2006-08-16 02:40:29 +0100 | [diff] [blame] | 1826 | * init/job.c (job_run_script): Document future FIXME. |
| 1827 | |
Scott James Remnant | 2f55853 | 2006-08-16 02:24:55 +0100 | [diff] [blame] | 1828 | * init/exent.h, init/job.h, init/process.h: Fix up headers. |
| 1829 | |
Scott James Remnant | 45aab69 | 2006-08-16 02:23:27 +0100 | [diff] [blame] | 1830 | * upstart/control.c, upstart/control.h, upstart/errors.h, |
| 1831 | upstart/job.h, upstart/libupstart.h: Fix up headers. |
| 1832 | |
Scott James Remnant | 8c16cc8 | 2006-08-16 02:13:40 +0100 | [diff] [blame] | 1833 | * upstart/control.c: Write the code to handle the control socket |
| 1834 | and communication over it; turns out this was possible to write so |
| 1835 | that both ends are handled in the same code. |
| 1836 | * upstart/control.h: Structures and prototypes. |
| 1837 | * upstart/tests/test_control.c: Test the new code. |
| 1838 | |
Scott James Remnant | 729d922 | 2006-08-16 02:12:23 +0100 | [diff] [blame] | 1839 | * upstart/Makefile.am (libupstart_la_LIBADD): Link to libnih |
| 1840 | |
Scott James Remnant | b981443 | 2006-08-16 02:11:51 +0100 | [diff] [blame] | 1841 | * upstart/errors.h: Header file containing errors raised by |
| 1842 | libupstart. |
| 1843 | * upstart/libupstart.h: Include errors.h |
| 1844 | |
Scott James Remnant | 342451a | 2006-08-15 00:08:20 +0100 | [diff] [blame] | 1845 | 2006-08-15 Scott James Remnant <scott@netsplit.com> |
| 1846 | |
Scott James Remnant | 0a8e347 | 2006-08-15 23:54:14 +0100 | [diff] [blame] | 1847 | * init/event.h: Add missing attribute for event_new() |
| 1848 | |
Scott James Remnant | 6f12887 | 2006-08-15 23:54:05 +0100 | [diff] [blame] | 1849 | * init/job.h (JobGoal, JobState, ProcessState, ConsoleType): Move |
| 1850 | the enums from here |
| 1851 | * upstart/job.h: into here so that we can use them across the |
| 1852 | control socket. |
| 1853 | |
Scott James Remnant | e583179 | 2006-08-15 21:46:21 +0100 | [diff] [blame] | 1854 | * Makefile.am (SUBDIRS): Build the libupstart library |
| 1855 | * configure.ac (AC_CONFIG_FILES): Generate upstart/Makefile |
| 1856 | * upstart/Makefile.am: Makefile for sub-directory |
| 1857 | * upstart/libupstart.ver: Linker version script. |
| 1858 | * upstart/libupstart.h: "Include everything" header file. |
| 1859 | |
Scott James Remnant | 26a8eec | 2006-08-15 05:46:27 +0100 | [diff] [blame] | 1860 | * TODO: Update. |
| 1861 | |
Scott James Remnant | 1f8619c | 2006-08-15 05:45:38 +0100 | [diff] [blame] | 1862 | * init/job.c (job_handle_child): Warn when processes are killed |
| 1863 | or exit with an abnormal status. Warn when respawning. |
| 1864 | |
Scott James Remnant | eb5ad27 | 2006-08-15 05:43:05 +0100 | [diff] [blame] | 1865 | * init/job.c (job_handle_child): Respawn processes that were not |
| 1866 | supposed to have died. |
| 1867 | * init/tests/test_job.c (test_handle_child): Test the respawn code. |
| 1868 | |
Scott James Remnant | 77c926d | 2006-08-15 05:22:08 +0100 | [diff] [blame] | 1869 | * TODO: Update. |
| 1870 | |
Scott James Remnant | 429cd67 | 2006-08-15 05:09:51 +0100 | [diff] [blame] | 1871 | * init/event.c (event_trigger_edge, event_trigger_level): Call |
| 1872 | job_handle_event so that we actually do something useful. |
| 1873 | * init/Makefile.am (test_event_LDADD): Link to process.o and job.o |
| 1874 | now that event.c calls code from job. |
| 1875 | |
Scott James Remnant | 355e1b6 | 2006-08-15 05:07:24 +0100 | [diff] [blame] | 1876 | * init/job.c (job_start_event): Function to start a job if an event |
| 1877 | matches. |
| 1878 | (job_stop_event): Function to stop a job if an event matches. |
| 1879 | (job_handle_event): Iterate the job list and dispatch the given event, |
| 1880 | causing jobs to be stopped or started using the above two functions. |
| 1881 | * init/job.h: Update. |
| 1882 | * init/tests/test_job.c: Test the new functions. |
| 1883 | |
Scott James Remnant | 923400d | 2006-08-15 04:27:44 +0100 | [diff] [blame] | 1884 | * init/job.c (job_new): Initialise start_events and stop_events to |
| 1885 | an empty list. |
| 1886 | * init/job.h (Job): Add start_events and stop_events list heads. |
| 1887 | * init/tests/test_job.c (test_new): Check the lists are initialised |
| 1888 | correctly to the empty list. |
| 1889 | |
Scott James Remnant | 865534f | 2006-08-15 04:22:06 +0100 | [diff] [blame] | 1890 | * init/event.c (event_match): Function to check events for equality. |
| 1891 | * init/event.h: Update. |
| 1892 | * init/tests/test_event.c (test_match): Test function. |
| 1893 | |
Scott James Remnant | 97137a7 | 2006-08-15 04:07:08 +0100 | [diff] [blame] | 1894 | * init/job.c (job_change_state): Trigger the level event with the |
| 1895 | same name as the job, with the value taken from the state. |
| 1896 | * init/tests/test_job.c (test_change_state): Check the event |
| 1897 | gets set to the right values as we go. |
| 1898 | * init/Makefile.am (test_job_LDADD, test_process_LDADD): Link to |
| 1899 | event.o now that job.c uses code from there. |
| 1900 | |
Scott James Remnant | 3b35a52 | 2006-08-15 04:01:32 +0100 | [diff] [blame] | 1901 | * init/event.c (event_change_value): Rename event_set_value to this |
| 1902 | as we intended in the first place; makes it more consistent with job. |
| 1903 | Always change the value. |
| 1904 | (event_trigger_edge): Add a high-level function to trigger an edge |
| 1905 | event. |
| 1906 | (event_trigger_level): And another to trigger a level event with |
| 1907 | a given value, this inherits the "don't change it" functionality |
| 1908 | that was in event_set_value. |
| 1909 | * init/event.h: Update. |
| 1910 | * init/tests/test_event.c: Test new behaviours and functions. |
| 1911 | |
Scott James Remnant | 4fef073 | 2006-08-15 01:45:02 +0100 | [diff] [blame] | 1912 | * init/event.c: Add simple code to keep track of events, whether |
| 1913 | they have been recorded or not and their current value if any. |
| 1914 | * init/event.h: Structures and prototypes. |
| 1915 | * init/tests/test_event.c: Test cases for event code. |
| 1916 | * init/Makefile.am (init_SOURCES): Build and link event.c using event.h |
| 1917 | (TESTS): Run the event test suite. |
| 1918 | (test_event_SOURCES, test_event_LDFLAGS, test_event_LDADD): Details |
| 1919 | for event test suite binary. |
| 1920 | |
Scott James Remnant | 38fc8ff | 2006-08-15 00:43:26 +0100 | [diff] [blame] | 1921 | * init/job.c (job_run_process, job_kill_process, job_kill_timer): |
| 1922 | Downgrade error messages to warning as they're not fatal. |
| 1923 | (job_change_state): Change info message to be more regular. |
| 1924 | |
Scott James Remnant | f033fb0 | 2006-08-15 00:37:33 +0100 | [diff] [blame] | 1925 | * init/job.c (job_start): A very simple, but very necessary, function. |
| 1926 | Set the goal of the given job to JOB_START and kick it off. |
| 1927 | (job_stop): And its companion, cause a running job to be stopped. |
| 1928 | * init/job.h: Update. |
| 1929 | * init/tests/test_job.c: Test the functions. |
| 1930 | |
Scott James Remnant | 342451a | 2006-08-15 00:08:20 +0100 | [diff] [blame] | 1931 | * init/job.c (job_handle_child): Child handler to kick jobs into |
| 1932 | the next state when their process dies. |
| 1933 | * init/job.h: Update. |
| 1934 | * init/tests/test_job.c (test_handle_child): Test the handler |
| 1935 | directly by just invoking it with various job states. |
| 1936 | |
Scott James Remnant | 1c463b9 | 2006-08-14 14:46:17 +0100 | [diff] [blame] | 1937 | 2006-08-14 Scott James Remnant <scott@netsplit.com> |
| 1938 | |
Scott James Remnant | 51c827d | 2006-08-14 23:06:00 +0100 | [diff] [blame] | 1939 | * init/tests/test_process.c (test_kill): Use select rather than |
| 1940 | poll for consistency with other test cases. |
| 1941 | |
Scott James Remnant | e6e4a73 | 2006-08-14 23:04:53 +0100 | [diff] [blame] | 1942 | * init/job.c (job_kill_process): Add function to send the active |
| 1943 | process of a job the TERM signal, and then set a timer to follow |
| 1944 | up with the KILL signal if the job doesn't get cleaned up in time. |
| 1945 | (job_kill_timer): Timer callback to send the KILL signal; this |
| 1946 | does the same job as the child handler and puts the job into the |
| 1947 | next state as there's no point waiting around now. |
| 1948 | * init/job.h: Update. |
| 1949 | * init/tests/test_job.c (test_kill_process): Test both functions |
| 1950 | in one test case (as one is just the bottom half of the other). |
| 1951 | |
Scott James Remnant | 6868f65 | 2006-08-14 21:42:45 +0100 | [diff] [blame] | 1952 | * init/tests/test_process.c (test_spawn): Use the right thing in |
| 1953 | the test case filename and unlink it to make sure. |
| 1954 | |
Scott James Remnant | 85df942 | 2006-08-14 21:41:39 +0100 | [diff] [blame] | 1955 | * init/job.c (job_change_state): Write the principal state gate |
| 1956 | function, called once a state has been left to enter the given new |
| 1957 | state (which one should determine with job_next_state). Spawns |
| 1958 | the necessary processes or moves to the next appropriate state. |
| 1959 | * init/job.h: Update. |
| 1960 | * init/tests/test_job.c: Test the state changes. |
| 1961 | |
Scott James Remnant | ba44b8b | 2006-08-14 20:06:28 +0100 | [diff] [blame] | 1962 | * init/job.c (job_run_process): Internal function to call |
| 1963 | process_spawn and update the job structure. |
| 1964 | (job_run_command): Simple(ish) wrapper for the above to split |
| 1965 | a command by whitespace, or use a shell if it needs more complex |
| 1966 | argument processing. |
| 1967 | (job_run_script): More complex wrapper that uses a shell to execute |
| 1968 | verbatim script, either using -c or a /dev/fd/NN and feeding the |
| 1969 | shell down a pipe to it. |
| 1970 | * init/job.h: Update. |
| 1971 | * init/tests/test_job.c: Test the new functions. |
| 1972 | |
Scott James Remnant | 156f548 | 2006-08-14 19:09:55 +0100 | [diff] [blame] | 1973 | * init/Makefile.am (init_SOURCES, TESTS): Reorder so that process.c, |
| 1974 | which is arguably lower level, comes first. |
| 1975 | (test_job_LDADD): Link the process code. |
| 1976 | (test_process_LDADD): Swap the order. |
| 1977 | |
Scott James Remnant | 00bcc93 | 2006-08-14 19:07:28 +0100 | [diff] [blame] | 1978 | * TODO: Update. |
| 1979 | |
Scott James Remnant | 1c463b9 | 2006-08-14 14:46:17 +0100 | [diff] [blame] | 1980 | * init/process.c (process_spawn): Correct typo (progress -> process), |
| 1981 | thanks Johan. |
| 1982 | |
Scott James Remnant | 43534ca | 2006-08-12 14:52:01 +0100 | [diff] [blame] | 1983 | 2006-08-12 Scott James Remnant <scott@netsplit.com> |
| 1984 | |
Scott James Remnant | 3030cc2 | 2006-08-12 15:18:55 +0100 | [diff] [blame] | 1985 | * init/process.c (process_spawn): Correct formatting of function. |
| 1986 | * init/process.h (SHELL): Define the location of the shell, all in |
| 1987 | the spirit of not hard-coding stuff like this. |
| 1988 | |
Scott James Remnant | 43534ca | 2006-08-12 14:52:01 +0100 | [diff] [blame] | 1989 | * init/job.c (job_new): Initialise all structure members to zero |
| 1990 | as this doesn't happen automatically. |
| 1991 | |
Scott James Remnant | 60b03e3 | 2006-08-10 00:59:00 +0100 | [diff] [blame] | 1992 | 2006-08-10 Scott James Remnant <scott@netsplit.com> |
| 1993 | |
| 1994 | * init/job.h (job_state_name): Declare as a const function. |
| 1995 | |
Scott James Remnant | 143a857 | 2006-08-09 17:37:00 +0100 | [diff] [blame] | 1996 | 2006-08-09 Scott James Remnant <scott@netsplit.com> |
| 1997 | |
Scott James Remnant | d945d2e | 2006-08-09 23:47:44 +0100 | [diff] [blame] | 1998 | * init/job.c (job_next_state): State transition logic; this uses |
| 1999 | our departure from the specification (the goal) so that the state |
| 2000 | can always be currently accurate rather than suggestive. |
| 2001 | (job_state_name): Cute function to convert enum into a name. |
| 2002 | * init/job.h: Update. |
| 2003 | * init/tests/test_job.c (test_next_state): Test the transitions. |
| 2004 | (test_state_name): And the return values. |
| 2005 | |
Scott James Remnant | 5fa1567 | 2006-08-09 23:23:17 +0100 | [diff] [blame] | 2006 | * TODO: Add file to keep track of things. |
| 2007 | |
Scott James Remnant | dbc7861 | 2006-08-09 23:22:45 +0100 | [diff] [blame] | 2008 | * init/job.c: Include nih/macros.h and nih/list.h |
| 2009 | * init/process.c: Include order fixing, include nih/macros.h |
| 2010 | * init/tests/test_job.c: Include nih/macros.h and nih/list.h |
| 2011 | * init/tests/test_process.c: Include nih/list.h |
| 2012 | |
Scott James Remnant | 03853ed | 2006-08-09 23:11:59 +0100 | [diff] [blame] | 2013 | * init/job.c: Include order fixing. |
| 2014 | (job_find_by_name): Function to find a job by its (unique) name. |
| 2015 | (job_find_by_pid): Function to find a job by the pid of its process. |
| 2016 | * init/job.h: Update. |
| 2017 | * init/tests/test_job.c (test_find_by_name, test_find_by_pid): Test |
| 2018 | new functions. |
| 2019 | |
Scott James Remnant | 143a857 | 2006-08-09 17:37:00 +0100 | [diff] [blame] | 2020 | * init/process.c (process_spawn): Spawn a process using the job |
| 2021 | details to set up the environment, etc. |
| 2022 | (process_setup_console): Set up the console according to the job. |
| 2023 | (process_setup_limits): Set up the limits according to the job. |
| 2024 | (process_setup_environment): Set up the environment according to |
| 2025 | the job. |
| 2026 | (process_kill): Simple function to send a kill signal or raise an |
| 2027 | error; mostly just a wrapper without any particular logic. |
| 2028 | * init/process.h: Prototypes and macros. |
| 2029 | * init/tests/test_process.c: Test cases. |
| 2030 | * init/Makefile.am (init_SOURCES): Build and link process.c and |
| 2031 | its header file. |
| 2032 | (TESTS): Run the process test suite. |
| 2033 | (test_process_SOURCES, test_process_LDFLAGS, test_process_LDADD): |
| 2034 | Details for process test sutie binary. |
| 2035 | |
Scott James Remnant | 29abda0 | 2006-08-08 15:01:24 +0100 | [diff] [blame] | 2036 | 2006-08-08 Scott James Remnant <scott@netsplit.com> |
| 2037 | |
Scott James Remnant | 31ee263 | 2006-08-08 15:06:02 +0100 | [diff] [blame] | 2038 | * init/job.c (job_new): nih_list_free is necessary. |
| 2039 | * init/tests/test_job.c (test_new): Free job when done. |
| 2040 | |
Scott James Remnant | 29abda0 | 2006-08-08 15:01:24 +0100 | [diff] [blame] | 2041 | * init/job.h: Header file to contain the definition of the Job |
| 2042 | structure and associated typedefs, etc. |
| 2043 | (JobGoal): In a divergence from the specification, we introduced a |
| 2044 | "goal" for a job which tells us which way round the state machine |
| 2045 | we're going (towards start, or towards stop). |
| 2046 | (JobState): Which means this always holds the current state, even |
| 2047 | if we're trying to get out of this state (ie. if we've sent the TERM |
| 2048 | signal to the running process, we're still in the running state until |
| 2049 | it's actually been reaped). |
| 2050 | (ProcessState): And in another divergence, we keep the state of the |
| 2051 | process so we know whether we need to force a state transition or |
| 2052 | can just expect one because something transient is happening. |
| 2053 | * init/job.c (job_new): Function to allocate a Job structure, set |
| 2054 | the pointers to NULL and other important members to sensible |
| 2055 | defaults. |
| 2056 | (job_init): Initialise the list of jobs. |
| 2057 | * init/tests/test_job.c: Test suite. |
| 2058 | * init/Makefile.am (init_SOURCES): Compile and link job.c using |
| 2059 | its header file. |
| 2060 | (TESTS): Run the job test suite. |
| 2061 | (test_job_SOURCES, test_job_LDFLAGS, test_job_LDADD): Details for the |
| 2062 | job test suite binary. |
| 2063 | |
Scott James Remnant | b933bc9 | 2006-08-02 02:29:25 +0100 | [diff] [blame] | 2064 | 2006-08-02 Scott James Remnant <scott@netsplit.com> |
| 2065 | |
Scott James Remnant | 6c7667a | 2006-08-02 02:43:12 +0100 | [diff] [blame] | 2066 | * configure.ac: Check for C99 |
| 2067 | |
Scott James Remnant | b933bc9 | 2006-08-02 02:29:25 +0100 | [diff] [blame] | 2068 | * HACKING: Document dependency on libnih. |
| 2069 | |
Scott James Remnant | a780d6c | 2006-07-27 18:40:51 +0100 | [diff] [blame] | 2070 | 2006-07-27 Scott James Remnant <scott@netsplit.com> |
| 2071 | |
| 2072 | * init/Makefile.am (DEFS): Append to the default DEFS list, rather |
| 2073 | than overriding, otherwise we lose HAVE_CONFIG_H |
| 2074 | |
Scott James Remnant | b6270dd | 2006-07-13 02:16:38 +0100 | [diff] [blame] | 2075 | 2006-07-13 Scott James Remnant <scott@netsplit.com> |
| 2076 | |
Scott James Remnant | 1bb3514 | 2006-07-13 02:30:58 +0100 | [diff] [blame] | 2077 | * HACKING: Correct incorrect Bazaar URL. |
| 2078 | |
Scott James Remnant | b6270dd | 2006-07-13 02:16:38 +0100 | [diff] [blame] | 2079 | * AUTHORS: Change e-mail address to ubuntu.com. |
| 2080 | * HACKING: Update Bazaar and Release URLS. |
| 2081 | * configure.ac (AC_COPYRIGHT): Change copyright to Canonical Ltd. |
| 2082 | (AC_INIT): Change bug submission address to Launchpad. |
| 2083 | * init/main.c: Update header to use Canonical copyright and |
| 2084 | credit me as author. |
| 2085 | |
Scott James Remnant | 5074884 | 2006-05-16 21:02:31 +0100 | [diff] [blame] | 2086 | 2006-05-16 Scott James Remnant <scott@netsplit.com> |
| 2087 | |
| 2088 | * init/main.c: Add the simplest template main.c |
| 2089 | * init/Makefile.am: Add template Makefile.am that builds init from |
| 2090 | main.c and links to libnih statically |
| 2091 | * configure.ac (AC_CONFIG_FILES): Configure nih and init subdirs. |
| 2092 | * Makefile.am (SUBDIRS): Recurse into nih and init subdirs. |
| 2093 | |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 2094 | 2006-05-14 Scott James Remnant <scott@netsplit.com> |
| 2095 | |
| 2096 | * ChangeLog: Initial project infrastructure created. |