Scott James Remnant | 3d39c7d | 2007-03-02 10:50:14 +0000 | [diff] [blame^] | 1 | 2007-03-02 Scott James Remnant <scott@netsplit.com> |
| 2 | |
| 3 | * TODO: Update. |
| 4 | |
Scott James Remnant | bc1ebc0 | 2007-03-01 12:27:09 +0000 | [diff] [blame] | 5 | 2007-03-01 Scott James Remnant <scott@netsplit.com> |
| 6 | |
Scott James Remnant | 75914fd | 2007-03-01 19:05:45 +0000 | [diff] [blame] | 7 | * util/jobs.c (handle_job_status): Drop the process field from the |
| 8 | output for now. |
| 9 | * util/events.c (handle_event_job_status): Likewise |
| 10 | * util/tests/test_jobs.c (test_start_action, test_list_action) |
| 11 | (test_jobs_action): Drop pid from messages we simulate. |
| 12 | * util/tests/test_events.c (test_emit_action): Likewise. |
| 13 | |
Scott James Remnant | 0c68cc1 | 2007-03-01 18:53:23 +0000 | [diff] [blame] | 14 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 15 | Remove the pid field from the job status and event job status |
| 16 | messages. |
| 17 | * upstart/message.h: Update description of job status and event |
| 18 | job status message to remove the pid field. |
| 19 | * upstart/tests/test_message.c (test_new, my_handler) |
| 20 | (test_handle): Remove checks using the pid field. |
| 21 | |
Scott James Remnant | d134fe8 | 2007-03-01 18:46:53 +0000 | [diff] [blame] | 22 | * init/control.c (control_job_start, control_job_stop) |
| 23 | (control_job_query, control_job_list): Remove the pid field from |
| 24 | the messages, it'll come back later when we get better message |
| 25 | formats. |
| 26 | * init/tests/test_control.c (check_job_status, check_job_waiting) |
| 27 | (check_job_started, check_job_stopped): Remove checks on the process |
| 28 | id, since that field is gone from the message. |
| 29 | (test_job_stop): Use the pid field of the main process. |
| 30 | (test_job_start): Initialise the main action process. |
| 31 | |
Scott James Remnant | dd1a674 | 2007-03-01 18:42:42 +0000 | [diff] [blame] | 32 | * init/notify.c (notify_job, notify_job_event): Remove the pid field |
| 33 | from the message, it'll come back later when we get better message |
| 34 | formats. |
| 35 | * init/tests/test_notify.c (check_job_status) |
| 36 | (check_event_job_status): Remove checks on the pid, since that field |
| 37 | is no longer present. |
| 38 | |
Scott James Remnant | e2ce637 | 2007-03-01 18:37:53 +0000 | [diff] [blame] | 39 | * init/job.c (job_process_copy): Use job_process_new here, oops. |
| 40 | |
Scott James Remnant | 8ed70e4 | 2007-03-01 18:34:37 +0000 | [diff] [blame] | 41 | * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_script) |
| 42 | (cfg_stanza_pre_start, cfg_stanza_post_start) |
| 43 | (cfg_stanza_pre_stop, cfg_stanza_post_stop): Use job_process_new |
| 44 | to allocate process structures and store in the process array. |
| 45 | * init/tests/test_cfgfile.c (test_read_job, test_stanza_exec) |
| 46 | (test_stanza_script, test_stanza_pre_start) |
| 47 | (test_stanza_post_start, test_stanza_pre_stop) |
| 48 | (test_stanza_post_stop): Update test cases to use process array |
| 49 | member information. |
| 50 | |
Scott James Remnant | 42479f9 | 2007-03-01 18:12:34 +0000 | [diff] [blame] | 51 | * init/tests/test_event.c (test_poll): Update to use newer job process |
| 52 | array and find the pid under there. |
| 53 | |
Scott James Remnant | c8f15ac | 2007-03-01 18:03:22 +0000 | [diff] [blame] | 54 | * init/job.h (Job): Remove the pid and aux_pid fields; replace the |
| 55 | individual JobProcess pointers with an array of them of a fixed |
| 56 | minimum size; replace failed_state with failed_process. |
| 57 | (JobProcess): add a pid field here, so now we can obtain the pid on |
| 58 | an individual process/action basis rather than global. |
| 59 | * init/job.c (job_process_new): Function to create a JobProcess |
| 60 | structure, setting the initial values to FALSE/NULL/0. |
| 61 | (job_process_copy): Function to copy a JobProcess. |
| 62 | (job_new): Don't initialise the pid or aux_pid members, initialise |
| 63 | the process array to a fixed initial size and set the members to NULL, |
| 64 | initialise the failed_process member to -1. |
| 65 | (job_copy): Update to use job_process_copy and copy the process array. |
| 66 | (job_find_by_pid): Look through the process structures in the job's |
| 67 | process array to find the pid, and optionally return which action it |
| 68 | was. |
| 69 | (job_change_state): Call job_kill_process in the JOB_KILLED state if |
| 70 | we have a main process and that has a pid, pass in the main process. |
| 71 | (job_next_state): Check the process id of the main process when |
| 72 | deciding what the next state is for running. |
| 73 | (job_run_process): Store the process id in the process structure |
| 74 | (job_kill_process): Accept a process structure and use that to obtain |
| 75 | the process id we need to send TERM too. Remove the code that forced |
| 76 | a state change if kill() failed, since we will get a child signal |
| 77 | anyway and should do it there. |
| 78 | (job_kill_timer): Likewise, accept a process structure and don't |
| 79 | forcibly change the state anymore. |
| 80 | (job_child_reaper): Rewrite to switch based on the action that died, |
| 81 | rather than the state we were in; assert that the state is what we |
| 82 | expected. |
| 83 | (job_emit_event): The argument to the failed event is now the action |
| 84 | name, rather than the state name; an action of -1 indicates that |
| 85 | respawn failed. |
| 86 | * init/tests/test_job.c (test_process_new, test_process_copy): Make |
| 87 | sure the structure is created and copied properly. |
| 88 | (test_new, test_copy): Drop checks on the pid and aux_pid members, |
| 89 | add checks for the process array and pid members of processes. |
| 90 | (test_find_by_pid): Update test case to make sure we can find the pid |
| 91 | of any process, returning the action index rather than the process |
| 92 | pointer. |
| 93 | (test_run_process, test_kill_process, test_change_goal) |
| 94 | (test_change_state, test_next_state, test_child_reaper): Update test |
| 95 | cases to use pid fields inside process structures rather than the |
| 96 | pid or aux_pid members. |
| 97 | (test_handle_event, test_handle_event_finished) |
| 98 | (test_free_deleted): Update to avoid pid field checks. |
| 99 | |
Scott James Remnant | 4652e3b | 2007-03-01 16:25:56 +0000 | [diff] [blame] | 100 | * upstart/enum.h (JobAction): Enumeration of different actions. |
| 101 | * upstart/enum.c (job_action_name, job_action_from_name): Enumeration |
| 102 | to string conversion functions. |
| 103 | * upstart/tests/test_enum.c (test_action_name) |
| 104 | (test_action_from_name): Tests for the new functions. |
| 105 | |
Scott James Remnant | dc9d790 | 2007-03-01 12:57:37 +0000 | [diff] [blame] | 106 | * init/cfgfile.c (cfg_read_job): Instead of trying to copy over an |
| 107 | old job's state and instances into the new one, mark the old job |
| 108 | as deleted. This ensures we never end up applying a new post-stop |
| 109 | script to a job started with an old pre-start script, etc. It also |
| 110 | makes life so much simpler. |
| 111 | * init/tests/test_cfgfile.c (test_read_job): Update tests to make |
| 112 | sure the old job is marked for deletion, instead of freed. |
| 113 | * TODO: Update. |
| 114 | |
Scott James Remnant | 26a41cf | 2007-03-01 12:50:10 +0000 | [diff] [blame] | 115 | * init/notify.c (notify_job): Split out notification to processes |
| 116 | subscribed to the cause event into a new function |
| 117 | (notify_job_event): We can call this when we change cause. |
| 118 | * init/job.c (job_change_state): Notify anyone subscribed to the |
| 119 | job after we've changed the state, rather than before, otherwise |
| 120 | we won't know the new pids or anything. |
| 121 | (job_change_cause): Call notify_job_event before changing the cause |
| 122 | so that subscribers get a final status update. |
| 123 | * init/tests/test_notify.c (test_job_event): Check the new function. |
| 124 | * TODO: Update. |
| 125 | |
Scott James Remnant | bc1ebc0 | 2007-03-01 12:27:09 +0000 | [diff] [blame] | 126 | * init/cfgfile.c (cfg_stanza_respawn): Remove the shortcut that |
| 127 | lets you specify "respawn COMMAND". It was confusing as it hid |
| 128 | the common "[when] exec"/"[when] script" syntax, made it non-obvious |
| 129 | that "exec" and "respawn" were the same flag, etc. |
| 130 | * init/tests/test_cfgfile.c (test_stanza_respawn): Update tests. |
| 131 | (test_stanza_service): Fix test case to not use shortcut. |
| 132 | * logd/event.d/logd.in: Update to not use respawn shortcut. |
| 133 | |
Scott James Remnant | b1f3405 | 2007-02-25 09:12:53 +0000 | [diff] [blame] | 134 | 2007-02-25 Scott James Remnant <scott@netsplit.com> |
| 135 | |
Scott James Remnant | 43d8f09 | 2007-02-25 12:56:37 +0000 | [diff] [blame] | 136 | * init/job.c (job_child_reaper): Shift the signal value into the |
| 137 | higher byte to make it easier to detect, and not stamp over exit |
| 138 | statuses between 128 and 255. |
| 139 | (job_emit_event): Detect the signal stored in the new way. |
| 140 | * init/cfgfile.c (cfg_stanza_normal): Store signal in the higher bytes. |
| 141 | * init/tests/test_job.c (test_copy, test_change_state) |
| 142 | (test_child_reaper): Update test cases. |
| 143 | * init/tests/test_cfgfile.c (test_stanza_normal): Update test. |
| 144 | |
Scott James Remnant | 8a77b5d | 2007-02-25 11:45:47 +0000 | [diff] [blame] | 145 | * TODO: Update. |
| 146 | |
Scott James Remnant | 2c95069 | 2007-02-25 09:13:38 +0000 | [diff] [blame] | 147 | * init/event.h (PWRSTATUS_EVENT): Add new power-status-changed event. |
| 148 | * init/main.c (pwd_handler): Handle the SIGPWR signal by generating |
| 149 | the new event, leave it up to a job to parse the file and do |
| 150 | whatever it likes. |
| 151 | |
Scott James Remnant | b1f3405 | 2007-02-25 09:12:53 +0000 | [diff] [blame] | 152 | * TODO: Update. |
| 153 | |
Scott James Remnant | 7e3ad17 | 2007-02-13 15:53:39 +0000 | [diff] [blame] | 154 | 2007-02-13 Scott James Remnant <scott@netsplit.com> |
| 155 | |
| 156 | * upstart/tests/test_message.c (test_reader, test_handle_using) |
| 157 | (test_handle); Usual fix for gcc optimiser thinking that fixed |
| 158 | for loops might not be. |
| 159 | * init/tests/test_job.c (test_run_process, test_kill_process): |
| 160 | Likewise. |
| 161 | * init/tests/test_notify.c (test_subscription_find): I still don't |
| 162 | know what a type-punned pointer is, nor why dereferencing such a |
| 163 | thing would break strict-aliasing rules. |
| 164 | * init/tests/test_cfgfile.c (test_read_job): More type-punning. |
| 165 | * util/tests/test_jobs.c (test_start_action): More for-loop action. |
| 166 | * util/tests/test_events.c (test_emit_action): And again. |
| 167 | |
Scott James Remnant | 5c89c50 | 2007-02-11 14:08:19 +0000 | [diff] [blame] | 168 | 2007-02-11 Scott James Remnant <scott@netsplit.com> |
| 169 | |
Scott James Remnant | 17305e1 | 2007-02-11 18:20:19 +0000 | [diff] [blame] | 170 | * init/job.c (job_change_goal): We need to be able to stop a running |
| 171 | job without a process, because that's what a job-as-state is! The |
| 172 | check was added because job_child_reaper calls job_change_goal and |
| 173 | then job_change_state immediately after, we should fix that instead. |
| 174 | (job_child_reaper): If we call job_change_goal while in the running |
| 175 | state, it will call job_change_state for us; so check for that first |
| 176 | and don't change the state! |
| 177 | * init/tests/test_job.c (test_change_goal): Update the test to ensure |
| 178 | that we can stop a job with no running process. |
| 179 | |
Scott James Remnant | ddda5f9 | 2007-02-11 14:18:00 +0000 | [diff] [blame] | 180 | * init/cfgfile.c (cfg_stanza_normalexit): normalexit is inconsistent, |
| 181 | change to "normal exit" |
| 182 | * init/tests/test_cfgfile.c (test_stanza_normalexit): Update. |
| 183 | |
Scott James Remnant | 5c89c50 | 2007-02-11 14:08:19 +0000 | [diff] [blame] | 184 | * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop) |
| 185 | (cfg_stanza_pre_start, cfg_stanza_post_start) |
| 186 | (cfg_stanza_pre_stop, cfg_stanza_post_stop, cfg_stanza_respawn): |
| 187 | We're not going to allow stanza keywords to be quoted, since this |
| 188 | gives us an easy way to allow users to make something explicitly |
| 189 | not a keyword. |
| 190 | |
Scott James Remnant | 5dd50e3 | 2007-02-10 00:44:44 +0000 | [diff] [blame] | 191 | 2007-02-10 Scott James Remnant <scott@netsplit.com> |
| 192 | |
Scott James Remnant | 9675c07 | 2007-02-10 21:36:48 +0000 | [diff] [blame] | 193 | * configure.ac: Bump version to 0.3.6 |
| 194 | |
Scott James Remnant | 4e97717 | 2007-02-10 21:24:29 +0000 | [diff] [blame] | 195 | * configure.ac: Increase version to 0.3.5 |
| 196 | * NEWS: Update. |
| 197 | * TODO: Update. |
| 198 | |
Scott James Remnant | a2f0a54 | 2007-02-10 18:07:26 +0000 | [diff] [blame] | 199 | * TODO: More notes. |
| 200 | |
Scott James Remnant | 78456a5 | 2007-02-10 17:46:21 +0000 | [diff] [blame] | 201 | * TODO: Note an issue with using JobProcess->pid |
| 202 | |
Scott James Remnant | d11d0fd | 2007-02-10 17:45:17 +0000 | [diff] [blame] | 203 | * init/cfgfile.c (cfg_stanza_pre_start, cfg_stanza_post_start) |
| 204 | (cfg_stanza_pre_stop, cfg_stanza_post_stop): Add a needed check |
| 205 | for a token when parsing "exec". Correct line number we expect |
| 206 | to see the duplicated value on. Correct expected error for missing |
| 207 | argument from "Unexpected token" to "Expected token". |
| 208 | |
| 209 | * init/tests/test_cfgfile.c (main): Actually invoke the tests for |
| 210 | the scripts. |
| 211 | |
Scott James Remnant | 2ebe37b | 2007-02-10 17:35:33 +0000 | [diff] [blame] | 212 | * init/cfgfile.c (cfg_read_job): Correct type of lineno in error. |
| 213 | |
Scott James Remnant | 178f3a6 | 2007-02-10 17:34:02 +0000 | [diff] [blame] | 214 | * TOOD: Minor notify bug |
| 215 | |
Scott James Remnant | e72695c | 2007-02-10 17:11:26 +0000 | [diff] [blame] | 216 | * TODO: Big update. |
| 217 | |
Scott James Remnant | 743c1c1 | 2007-02-10 16:49:17 +0000 | [diff] [blame] | 218 | * init/tests/test_job.c (test_child_reaper): Make sure that we can |
| 219 | reap post-start and pre-stop processes, and have only the aux_pid |
| 220 | changed. Also make sure that if the running process dies while |
| 221 | in these states, with or without an aux process, that we don't |
| 222 | transition badly. |
| 223 | |
Scott James Remnant | a54bfd0 | 2007-02-10 14:33:32 +0000 | [diff] [blame] | 224 | * init/job.c (job_find_by_pid): Check aux_pid as well. |
| 225 | * init/tests/test_job.c (test_find_by_pid): Make sure we can find it. |
| 226 | |
Scott James Remnant | 153e3b5 | 2007-02-10 14:15:47 +0000 | [diff] [blame] | 227 | * init/job.h (Job): Add an auxiliary pid member. |
| 228 | * init/job.c (job_new): Initialise the aux_pid member. |
| 229 | (job_change_state): Run the post-start and pre-stop scripts when we |
| 230 | enter the state with the same name (assuming they exist). |
| 231 | (job_run_process): Store the pid in aux_pid when starting the |
| 232 | post-start or pre-stop processes. |
| 233 | * init/tests/test_job.c (test_change_state): Add tests for running |
| 234 | the new post-start and pre-stop scripts; which get their process ids |
| 235 | stored in aux_pid instead of pid. |
| 236 | (test_new): Make sure the aux_pid member is initialised properly. |
| 237 | (test_copy): Make sure the aux_pid member is not copied. |
| 238 | |
| 239 | * TODO: Update. |
| 240 | |
Scott James Remnant | f415d8d | 2007-02-10 13:55:04 +0000 | [diff] [blame] | 241 | * init/tests/test_job.c (test_change_state): Add a check for the |
| 242 | daemon stanza holding the job in spawned; we snuck this in a while |
| 243 | back and never tested it (there's no support to get it out of |
| 244 | spawned yet). |
| 245 | |
Scott James Remnant | e9332be | 2007-02-10 13:46:50 +0000 | [diff] [blame] | 246 | * init/job.h (Job): Add new post_start and pre_stop scripts. |
| 247 | * init/job.c (job_new): Initialise new scripts to NULL. |
| 248 | (job_copy): Copy the information from the new scripts over as well. |
| 249 | * init/tests/test_job.c (test_new): Check they're initialised. |
| 250 | (test_copy): Check that the information is copied properly. |
| 251 | * init/cfgfile.c (cfg_stanza_post_start, cfg_stanza_pre_stop): Add |
| 252 | new script stanza functions for the additional two scripts that |
| 253 | we want. |
| 254 | * init/tests/test_cfgfile.c (test_stanza_post_start) |
| 255 | (test_stanza_pre_stop): Add tests for the new stanzas. |
| 256 | |
Scott James Remnant | 5dd50e3 | 2007-02-10 00:44:44 +0000 | [diff] [blame] | 257 | * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_script): Rewrite to |
| 258 | allocate a JobProcess and parse the command or script into it. |
| 259 | (cfg_read_job): Fix the long broken assumption that pid_file and |
| 260 | pid_binary are required for respawn, when they're actually required |
| 261 | for daemon. |
| 262 | (cfg_stanza_start, cfg_stanza_stop): Remove script second-level. |
| 263 | (cfg_stanza_respawn): Parse into the job's process. |
| 264 | (cfg_stanza_pre_start, cfg_stanza_post_stop): New stanzas for the |
| 265 | processes alone. |
| 266 | * init/tests/test_cfgfile.c (test_read_job): Update a few test |
| 267 | cases to match reality. |
| 268 | (test_stanza_start, test_stanza_stop): Remove script-related checks. |
| 269 | |
Scott James Remnant | e885d55 | 2007-02-09 00:01:46 +0000 | [diff] [blame] | 270 | 2007-02-09 Scott James Remnant <scott@netsplit.com> |
| 271 | |
Scott James Remnant | 315a80a | 2007-02-09 22:50:00 +0000 | [diff] [blame] | 272 | * init/tests/test_job.c (test_kill_process): Poll the event queue |
| 273 | after each test to get rid of the allocated events and make valgrind |
| 274 | happy. |
| 275 | * init/tests/test_control.c (test_job_start, test_job_stop) |
| 276 | (test_event_emit): Poll the event queue after each test to get rid |
| 277 | of the allocated events, as they make valgrind complain. |
| 278 | (test_event_emit): Free args and env when done. |
| 279 | |
Scott James Remnant | 1ada0e2 | 2007-02-09 22:40:51 +0000 | [diff] [blame] | 280 | * init/job.h (JobName): Drop obsolete structure |
| 281 | (JobProcess): Add a new structure to represent a single process |
| 282 | within the job, instead of using two variables to pick either the |
| 283 | script or command. |
| 284 | (Job): Change command and script to a single JobProcess called process; |
| 285 | change start_script and stop_script to a JobProcess called pre_start |
| 286 | and post_stop respectively. |
| 287 | * init/job.c (job_new): Initialise new members to NULL. |
| 288 | (job_copy): Copy the process structures across, including contents. |
| 289 | (job_change_state): Call job_run_process passing in the structure; |
| 290 | rather than fiddling with if statements. |
| 291 | (job_run_script, job_run_command, job_run_process): Combine all of |
| 292 | these three functions into a single new job_run_process function. |
| 293 | * init/tests/test_job.c (test_new, test_copy, test_change_goal) |
| 294 | (test_change_state, test_child_reaper) |
| 295 | (test_handle_event_finished): Change to using JobProcess for when |
| 296 | we need to construct a command. |
| 297 | (test_run_script, test_run_command): Merge into single new |
| 298 | (test_run_process) function. |
| 299 | * init/tests/test_event.c (test_poll): Replace command with process. |
| 300 | * init/tests/test_control.c (test_job_start): Change to using |
| 301 | JobProcess to specify the command. |
| 302 | |
Scott James Remnant | c674047 | 2007-02-09 21:16:28 +0000 | [diff] [blame] | 303 | * init/main.c (main): Run job_free_deleted each time through the |
| 304 | main loop. |
| 305 | |
Scott James Remnant | cb46860 | 2007-02-09 21:13:16 +0000 | [diff] [blame] | 306 | * init/job.c (job_change_goal): Minor tweak to the logic; we may |
| 307 | have just made the job an instance, that should still let us stop |
| 308 | the one underneath. |
| 309 | |
Scott James Remnant | 3fbdda7 | 2007-02-09 21:12:10 +0000 | [diff] [blame] | 310 | * TODO: Update. |
| 311 | |
Scott James Remnant | dde96ff | 2007-02-09 21:10:45 +0000 | [diff] [blame] | 312 | * util/jobs.c (do_job): Always expect a list of replies. |
| 313 | |
Scott James Remnant | f940995 | 2007-02-09 21:02:18 +0000 | [diff] [blame] | 314 | * init/control.c (control_job_status, control_job_stop) |
| 315 | (control_job_query): Reply with information about all instances of |
| 316 | the job. |
| 317 | * init/tests/test_control.c (test_job_status, test_job_stop) |
| 318 | (test_job_query): Make sure we get the list end even for a single job; |
| 319 | and make sure we get details of all instances attached to the job. |
| 320 | |
Scott James Remnant | 6cfc8ab | 2007-02-09 20:34:37 +0000 | [diff] [blame] | 321 | * init/tests/test_job.c (test_change_goal): Check that starting |
| 322 | an instance job actually starts a new instance of it. |
| 323 | |
Scott James Remnant | 87c4647 | 2007-02-09 20:05:32 +0000 | [diff] [blame] | 324 | * init/cfgfile.c (cfg_stanza_limit): Support the word "unlimited" in |
| 325 | limit arguments for both the soft and hard values. |
| 326 | * init/tests/test_cfgfile.c (test_stanza_limit): Make sure that we |
| 327 | can make limits be unlimited. |
| 328 | |
Scott James Remnant | 22ac92f | 2007-02-09 19:39:42 +0000 | [diff] [blame] | 329 | * init/event.c (event_copy): Function to copy an event structure. |
| 330 | * init/event.h: Add prototype. |
| 331 | * init/tests/test_event.c (test_copy): Make sure we copy the event |
| 332 | correctly, with or without arguments and/or environment. |
| 333 | * init/job.c (job_copy): Function to copy a job structure, leaving |
| 334 | the state as it is. |
| 335 | * init/job.h: Add prototype. |
| 336 | * init/tests/test_job.c (test_copy): Make sure that we copy the |
| 337 | job details whether they are NULL or non-NULL, but don't copy the |
| 338 | state. |
| 339 | * init/init.supp: Update supression. |
Scott James Remnant | 099ece2 | 2007-02-09 18:13:51 +0000 | [diff] [blame] | 340 | * init/job.c (job_find_by_name): If we get a job that's an instance, |
| 341 | return what it's an instance of. |
| 342 | * init/tests/test_job.c (test_find_by_name): Restore accidentally |
| 343 | deleted test function; test that we get the real job, not an instance. |
| 344 | |
Scott James Remnant | 99e3ecc | 2007-02-09 18:08:45 +0000 | [diff] [blame] | 345 | * init/job.c (job_new): instance_of is initialised to NULL. |
| 346 | * init/job.h: Add a new instance_of pointer, pointing to the parent |
| 347 | that we're an instance of. |
| 348 | * init/tests/test_job.c (test_new): Check that. |
| 349 | * init/tests/test_cfgfile.c (test_read_job): Make sure instance_of |
| 350 | pointers are updated. |
| 351 | |
Scott James Remnant | 4513fae | 2007-02-09 17:52:32 +0000 | [diff] [blame] | 352 | * init/job.c (jobs): Store jobs in a hash table. |
| 353 | (job_new): Add to hash table, not to a list. |
| 354 | (job_handle_event, job_handle_event_finished, job_detect_stalled) |
| 355 | (job_free_deleted): Iterate across the hash table, rather than list. |
| 356 | (job_find_by_name): Use nih_hash_lookup, we keep this function because |
| 357 | we'll add "is instance or not" smarts soon! |
| 358 | (job_find_by_pid): Iterate across the entire hash table. |
| 359 | * init/tests/test_job.c (test_find_by_name): Drop test since this |
| 360 | function is now gone. |
| 361 | (test_free_deleted): Can't assume things are in a line now. |
| 362 | * init/control.c (control_job_list): Iterate the hash table. |
| 363 | |
Scott James Remnant | 3f9624c | 2007-02-09 17:16:07 +0000 | [diff] [blame] | 364 | * init/event.c: Don't hide the events list anymore |
| 365 | * init/event.h: Publish it and the init function. |
| 366 | * init/job.c: Don't hide the jobs list anymore. |
| 367 | (job_list): Since we don't hide it, we can drop this. |
| 368 | * init/job.h: Publish it and the init function. |
| 369 | * init/notify.c: Don't hide the subscriptions list anymore. |
| 370 | * init/notify.h: Publish it and the init function. |
| 371 | * init/control.c (control_job_list): Iterate the job list directly |
| 372 | * init/tests/test_control.c (test_event_emit): Use the events list |
| 373 | available to us. |
| 374 | * init/tests/test_event.c (test_poll): Call job_init directly and |
| 375 | just use the events list available to us. |
| 376 | * init/tests/test_job.c (test_new): Call job_init directly. |
| 377 | (test_change_state): Use the events list available to us. |
| 378 | * init/tests/test_notify.c (test_unsubscribe): Use the subscriptions |
| 379 | list available to us. |
| 380 | |
Scott James Remnant | 9709a8d | 2007-02-09 16:08:21 +0000 | [diff] [blame] | 381 | * doc/states.dot: Add updated state graph. |
| 382 | * doc/Makefile.am (EXTRA_DIST): Ship the states diagram. |
| 383 | (states.png): Include rules to build the png, we'll put it in bzr |
| 384 | anyway, but this is useful. |
| 385 | |
Scott James Remnant | 92b0160 | 2007-02-09 15:46:55 +0000 | [diff] [blame] | 386 | * init/cfgfile.c (cfg_delete_handler): Handle deleted jobs; mark |
| 387 | the job as deleted, and if it's dormant, invoke a state change. |
| 388 | |
Scott James Remnant | 9c0215a | 2007-02-09 15:42:20 +0000 | [diff] [blame] | 389 | * upstart/enum.h: Add a new JOB_DELETED state. |
| 390 | * upstart/enum.c (job_state_name, job_state_from_name): Add the new |
| 391 | state to the string functions. |
| 392 | * upstart/tests/test_enum.c (test_state_name) |
| 393 | (test_state_from_name): Check the enum works. |
| 394 | * init/job.c (job_change_goal): New decision; we can start a waiting |
| 395 | job if it's marked delete (it might be a new instance) -- we'll use |
| 396 | the new deleted state to decide that we shouldn't. |
| 397 | (job_change_state): Once we reach waiting, if the job is to be deleted, |
| 398 | move to the next state. |
| 399 | (job_next_state): The next state for a waiting job if the goal is stop |
| 400 | is deleted. We should never call job_next_state () for a deleted job. |
| 401 | (job_free_deleted): Very simple function, just detects |
| 402 | deleted jobs and frees them. |
| 403 | * init/job.h: Add prototype for new function. |
| 404 | * init/tests/test_job.c (test_change_goal): Update test to use new |
| 405 | deleted state; and don't even change the goal. |
| 406 | (test_change_state): Add a check to make sure we end up in deleted. |
| 407 | (test_next_state): Make sure waiting goes to deleted. |
| 408 | (test_free_deleted): Check the function. |
| 409 | |
Scott James Remnant | 07dd5db | 2007-02-09 15:20:25 +0000 | [diff] [blame] | 410 | * init/job.c (job_change_goal): Don't try and start a job if it's |
| 411 | marked to be deleted and is just waiting for cleanup. |
| 412 | * init/tests/test_job.c (test_change_state): Make sure that the cause |
| 413 | is released when we reach waiting. |
| 414 | |
Scott James Remnant | a1ade13 | 2007-02-09 15:07:30 +0000 | [diff] [blame] | 415 | * init/tests/test_cfgfile.c (test_read_job): Make sure that a deleted |
| 416 | job gets resurrected. |
| 417 | |
Scott James Remnant | 25873b5 | 2007-02-09 13:35:43 +0000 | [diff] [blame] | 418 | * init/cfgfile.c (cfg_visitor): Correct number of arguments and call |
| 419 | to cfg_job_name. |
| 420 | |
Scott James Remnant | 3b5daf6 | 2007-02-09 13:31:01 +0000 | [diff] [blame] | 421 | * TODO: Update. |
| 422 | |
Scott James Remnant | 845c6cb | 2007-02-09 13:29:27 +0000 | [diff] [blame] | 423 | * init/cfgfile.c (cfg_stanza_daemon): Don't allow arguments anymore. |
| 424 | * init/tests/test_cfgfile.c (test_stanza_daemon): Update tests. |
| 425 | |
Scott James Remnant | 1cdc163 | 2007-02-09 13:26:09 +0000 | [diff] [blame] | 426 | * init/job.c (job_handle_event_finished): Function to unblock all |
| 427 | jobs blocked on a given event emission. |
| 428 | (job_new, job_emit_event): Rename blocker to blocked; it's useful for |
| 429 | testing for truth. |
| 430 | * init/job.h: Add prototype, rename member. |
| 431 | * init/tests/test_job.c (test_handle_event_finished): Test it. |
| 432 | (test_new, test_change_state): Update name here too. |
| 433 | * init/event.c (event_finished): Call job_handle_event_finished |
| 434 | function to unblock jobs. |
| 435 | * init/tests/test_event.c (test_poll): Make sure the job gets |
| 436 | unblocked; a few other tests have to change since running event_poll |
| 437 | always unblocks the job if nothing listens to it. |
| 438 | |
Scott James Remnant | ba5ebb0 | 2007-02-09 04:46:39 +0000 | [diff] [blame] | 439 | * init/job.c (job_child_reaper): Set failed back to FALSE if |
| 440 | we're respawning, since we don't want to be failing. |
| 441 | * init/tests/test_job.c (test_child_reaper): cause will be NULL. |
| 442 | also free and poll events when done. |
| 443 | (test_handle_event): pid can never be -1 |
| 444 | (test_change_state): poll events when done |
| 445 | |
Scott James Remnant | fd0cc55 | 2007-02-09 04:39:36 +0000 | [diff] [blame] | 446 | * init/tests/test_job.c (test_child_reaper): Process will always |
| 447 | be zero on return from reaper. |
| 448 | |
Scott James Remnant | ef11ca4 | 2007-02-09 04:37:24 +0000 | [diff] [blame] | 449 | * init/tests/test_job.c (test_child_reaper): Killed doesn't go past |
| 450 | stopping; it goes to waiting, which will clear the cause. |
| 451 | |
Scott James Remnant | a503498 | 2007-02-09 04:36:12 +0000 | [diff] [blame] | 452 | * init/tests/test_job.c (test_child_reaper): Fill in values before |
| 453 | we test against them. |
| 454 | |
Scott James Remnant | da1ae31 | 2007-02-09 04:35:33 +0000 | [diff] [blame] | 455 | * init/tests/test_job.c (test_kill_process): Fix violated assertion |
| 456 | |
Scott James Remnant | 011e4ae | 2007-02-09 04:35:00 +0000 | [diff] [blame] | 457 | * init/tests/test_job.c (test_change_state): This should be failed |
| 458 | because nothing cleared it. |
| 459 | |
Scott James Remnant | 4f4ea83 | 2007-02-09 04:33:50 +0000 | [diff] [blame] | 460 | * init/tests/test_job.c (test_change_state): Fix a couple of array |
| 461 | index problems. |
| 462 | |
Scott James Remnant | af9b63f | 2007-02-09 04:32:50 +0000 | [diff] [blame] | 463 | * init/tests/test_job.c (test_change_state): Why set that which |
| 464 | does not change? |
| 465 | |
Scott James Remnant | fcc5190 | 2007-02-09 04:30:43 +0000 | [diff] [blame] | 466 | * init/tests/test_job.c (test_change_state): Add newline to test. |
| 467 | |
Scott James Remnant | 5f93619 | 2007-02-09 04:29:54 +0000 | [diff] [blame] | 468 | * init/job.c (job_emit_event): Add the job name as an argument; |
| 469 | oops. |
| 470 | |
Scott James Remnant | f89b161 | 2007-02-09 04:28:09 +0000 | [diff] [blame] | 471 | * init/tests/test_control.c (test_job_stop): Need to kill the process |
| 472 | ourselves, as we're blocked on an event. |
| 473 | (test_job_query): Fix wrong value in test. |
| 474 | (check_job_stopped, test_job_stop, test_unwatch_jobs): Change job |
| 475 | name to match the test. |
| 476 | |
Scott James Remnant | 7178e72 | 2007-02-09 04:22:04 +0000 | [diff] [blame] | 477 | * init/job.c (job_change_state): Must only not enter some states |
| 478 | with no process now; others like killed actually usually want one! |
| 479 | |
Scott James Remnant | 851a05c | 2007-02-09 04:18:20 +0000 | [diff] [blame] | 480 | * init/tests/test_cfgfile.c (test_read_job): Fix test case. |
| 481 | |
Scott James Remnant | 6c08878 | 2007-02-09 04:13:43 +0000 | [diff] [blame] | 482 | * init/tests/test_job.c (test_handle_event): Clean up tests. |
| 483 | (test_detect_stalled): Clean up. |
| 484 | |
Scott James Remnant | bfcb616 | 2007-02-09 04:08:53 +0000 | [diff] [blame] | 485 | * init/job.c (job_child_reaper): Update the reaping of the child |
| 486 | processes; there's a much larger state range for the main process |
| 487 | now, so that needs to be taken into account. |
| 488 | * init/tests/test_job.c (test_child_reaper): New test cases. |
| 489 | |
Scott James Remnant | d7ac93f | 2007-02-09 03:39:00 +0000 | [diff] [blame] | 490 | * init/job.c (job_next_state): Encapsulate the slightly odd three |
| 491 | exit states of running in this function, otherwise we'll end up |
| 492 | special-casing it in places I'd rather not think about. |
| 493 | (job_change_goal): Only change the state of a running job if it |
| 494 | has a process. |
| 495 | * init/tests/test_job.c (test_next_state): Add a test case for the |
| 496 | dead running job |
| 497 | (test_change_goal): Add test case for the dead running job |
| 498 | |
Scott James Remnant | d285b83 | 2007-02-09 02:49:06 +0000 | [diff] [blame] | 499 | * init/tests/test_job.c (test_change_state): Add test cases for |
| 500 | the forgotten stopping to killed transition. |
| 501 | |
Scott James Remnant | 999fc9a | 2007-02-09 02:44:25 +0000 | [diff] [blame] | 502 | * init/job.c (job_kill_process, job_kill_timer): Just check the pid |
| 503 | and state, and no longer any need to notify jobs since we're just |
| 504 | called from one state amongst many. |
| 505 | (job_change_state): Skip over the killed state if there's no process. |
| 506 | * init/tests/test_job.c (test_kill_process): Update test cases. |
| 507 | |
Scott James Remnant | ad01161 | 2007-02-09 02:34:03 +0000 | [diff] [blame] | 508 | * init/job.c (job_run_process): Simplify a little bit, no need to |
| 509 | do the state assertions here, just make sure there's no already |
| 510 | a process running. |
| 511 | * init/tests/test_job.c (test_run_command, test_run_script): Run |
| 512 | tests in the spawned state, since that's where we run the primary |
| 513 | command or script. Drop check for process state since that's no |
| 514 | longer set. |
| 515 | |
Scott James Remnant | 8bd1b04 | 2007-02-09 02:27:40 +0000 | [diff] [blame] | 516 | * init/job.c (job_change_state, job_next_state): Ok, here's the big |
| 517 | one ... rewrite this to use the new state transitions. This has |
| 518 | suddenly got a lot simpler and easier to read, this was definitely a |
| 519 | good idea. |
| 520 | (job_emit_event): Function to make emission of events easier. |
| 521 | (job_failed_event): replaces this one which wasn't so easy. |
| 522 | * init/tests/test_job.c (test_change_state): I can't say how much I |
| 523 | wasn't looking forwards to rewriting these test cases; anyway, it's |
| 524 | done now and I hope they're all right; |
| 525 | (test_next_state): Make sure the state transitions are correct too. |
| 526 | |
Scott James Remnant | 6aee378 | 2007-02-09 00:45:29 +0000 | [diff] [blame] | 527 | * init/job.h: Rename is_instance to delete and spawns_instance to |
| 528 | just instance. |
| 529 | * init/job.c (job_new): Update. |
| 530 | * init/tests/test_job.c (test_new): Update. |
| 531 | * init/cfgfile.c (cfg_stanza_instance): Update. |
| 532 | * init/tests/test_cfgfile.c (test_stanza_instance): Update. |
| 533 | |
Scott James Remnant | 535c690 | 2007-02-09 00:43:03 +0000 | [diff] [blame] | 534 | * init/event.h: Correct the event names. |
| 535 | |
Scott James Remnant | e2edac9 | 2007-02-09 00:39:24 +0000 | [diff] [blame] | 536 | * init/job.h: Add blocker event member. |
| 537 | * init/job.c (job_new): Initialise it to NULL. |
| 538 | * init/tests/test_job.c (test_new): Check it. |
| 539 | |
Scott James Remnant | e885d55 | 2007-02-09 00:01:46 +0000 | [diff] [blame] | 540 | * init/job.c (job_change_goal): Have a stab at this function with the |
| 541 | new state machine; it gets somewhat simpler (until we introduce the |
| 542 | second scripts), now we just induce things by a state change. |
| 543 | * init/tests/test_job.c (test_change_goal): Made easier (for now) |
| 544 | because we don't need to deal with processes and can just wait to |
| 545 | be blocked on an event. |
| 546 | |
Scott James Remnant | 9e13a24 | 2007-02-08 00:24:21 +0000 | [diff] [blame] | 547 | 2007-02-08 Scott James Remnant <scott@netsplit.com> |
| 548 | |
Scott James Remnant | 5e469e4 | 2007-02-08 23:49:01 +0000 | [diff] [blame] | 549 | * init/cfgfile.c (cfg_read_job): Drop check for useless respawn script |
| 550 | (cfg_stanza_respawn): Drop handling of "respawn script" |
| 551 | * init/tests/test_cfgfile.c (test_stanza_respawn): Drop the checks |
| 552 | for "respawn script" |
| 553 | |
Scott James Remnant | 4fdf755 | 2007-02-08 23:45:34 +0000 | [diff] [blame] | 554 | * init/job.h: Move things about a bit more; remove respawn_script |
| 555 | since that state is going away. |
| 556 | * init/job.c (job_new): Drop initialisation of process_state. |
| 557 | * init/tests/test_job.c (test_new): Improve the tests. |
| 558 | |
Scott James Remnant | 3856c63 | 2007-02-08 23:29:17 +0000 | [diff] [blame] | 559 | * init/main.c (STATE_FD): Remove this define, not used anymore. |
| 560 | |
Scott James Remnant | bc281c3 | 2007-02-08 23:25:33 +0000 | [diff] [blame] | 561 | * init/tests/test_event.c (test_poll): Update the event checking |
| 562 | to match what's likely to happen. |
| 563 | |
Scott James Remnant | 049b50f | 2007-02-08 23:23:29 +0000 | [diff] [blame] | 564 | * init/event.h: Remove commented out bit. |
| 565 | |
Scott James Remnant | 1abebfd | 2007-02-08 23:20:02 +0000 | [diff] [blame] | 566 | * init/tests/test_notify.c (check_job_status, test_job): Correct |
| 567 | state usage to match a possible state. |
| 568 | |
Scott James Remnant | 64bc2a8 | 2007-02-08 22:59:46 +0000 | [diff] [blame] | 569 | * init/control.c (control_job_start, control_job_stop) |
| 570 | (control_job_query, control_job_list): Drop process state and |
| 571 | description from the job status messages we send back. |
| 572 | * init/tests/test_control.c (test_error_handler) |
| 573 | (check_job_started, test_job_start, check_job_stopped) |
| 574 | (check_job_stopping, test_job_query, check_job_starting) |
| 575 | (test_job_list, test_watch_jobs, test_unwatch_jobs): Remove |
| 576 | process_state and description, and update usage of job states. |
| 577 | |
Scott James Remnant | cb178f8 | 2007-02-08 22:47:42 +0000 | [diff] [blame] | 578 | * init/notify.c (notify_job): Don't include process state or |
| 579 | description in the job status message anymore. |
| 580 | * init/tests/test_notify.c (check_job_status, test_job): Update tests |
| 581 | |
Scott James Remnant | 79cd4bf | 2007-02-08 22:44:46 +0000 | [diff] [blame] | 582 | * init/cfgfile.c (cfg_read_job): Drop the copying of the process_state |
| 583 | member, since it doesn't exist anymore. |
| 584 | * init/tests/test_cfgfile.c (test_read_job): Drop the check too. |
| 585 | |
Scott James Remnant | 6f0ff59 | 2007-02-08 22:43:04 +0000 | [diff] [blame] | 586 | * init/job.h (Job): Drop the process_state member. |
| 587 | |
Scott James Remnant | 56a1fa8 | 2007-02-08 22:40:01 +0000 | [diff] [blame] | 588 | * util/jobs.c (handle_job_status): Drop the process_state and |
| 589 | description arguments; output a process id only if it's greater |
| 590 | than zero. |
| 591 | * util/tests/test_jobs.c (test_start_action, test_list_action) |
| 592 | (test_jobs_action): Update tests to use newer states and arguments. |
| 593 | * util/events.c (handle_event_job_status): Simplify in the same way |
| 594 | |
Scott James Remnant | ac0c88b | 2007-02-08 22:31:00 +0000 | [diff] [blame] | 595 | * upstart/message.h: Remove process_state and description from the |
| 596 | job status event (we already had the foresight to not put them in |
| 597 | the event job status event). |
| 598 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 599 | Update handling of the messages to reduce the arguments. |
| 600 | * upstart/tests/test_message.c (test_new, my_handler) |
| 601 | (test_handle): Update the tests for the new job status message. |
| 602 | |
Scott James Remnant | e76986a | 2007-02-08 22:21:22 +0000 | [diff] [blame] | 603 | * upstart/enum.h (JobState): Change the job states to the new set |
| 604 | of states that we've planned. |
| 605 | (ProcessState): Drop process state entirely; this information is now |
| 606 | contained in the single JobState field. |
| 607 | * upstart/enum.c (job_state_name, job_state_from_name): Update |
| 608 | strings to match the new state names. |
| 609 | (process_state_name, process_state_from_name): Drop these functions. |
| 610 | * upstart/tests/test_enum.c (test_state_name) |
| 611 | (test_state_from_name): Update test cases to match new names. |
| 612 | (test_process_state_name, test_process_state_from_name): Drop. |
| 613 | |
Scott James Remnant | 08100e0 | 2007-02-08 17:57:21 +0000 | [diff] [blame] | 614 | * init/main.c (main): Remove the logd hack for now. |
| 615 | * init/job.c (job_new): Change the default console to none for now. |
| 616 | * init/tests/test_job.c (test_new): Update test. |
| 617 | * init/cfgfile.c (cfg_stanza_console): Can't guard against duplicates |
| 618 | for a while. |
| 619 | * init/tests/test_cfgfile.c (test_stanza_console): Comment out dup test |
| 620 | |
Scott James Remnant | f247adf | 2007-02-08 15:23:43 +0000 | [diff] [blame] | 621 | * init/cfgfile.c (cfg_read_job): Remove the restriction that there |
| 622 | must be either an 'exec' or 'script' for a job; jobs without either |
| 623 | define states others can use. |
| 624 | * init/tests/test_cfgfile.c (test_read_job): Convert the test to |
| 625 | a "must work". |
| 626 | * init/job.c (job_change_state): Remove restriction that we must |
| 627 | have either a script or a command; having neither should just wedge |
| 628 | the job at the running rest state. Note that there's no way to get |
| 629 | it out yet, because we don't force that particular state change. |
| 630 | * init/tests/test_job.c (test_change_state): Make sure that works. |
| 631 | |
Scott James Remnant | 920d65b | 2007-02-08 13:49:53 +0000 | [diff] [blame] | 632 | * init/job.c (job_change_cause): Put the knowledge about how to |
| 633 | change the cause into a separate function, since it's slightly |
| 634 | tricky. |
| 635 | (job_change_goal, job_change_state): Set the cause using the above |
| 636 | function. |
| 637 | |
Scott James Remnant | a3bcac1 | 2007-02-08 13:40:53 +0000 | [diff] [blame] | 638 | * init/job.h (Job): Rename goal_event to cause, also shuffle things |
| 639 | around so that the state is mostly together. |
| 640 | * init/job.c, init/process.c, init/notify.c, init/cfgfile.c: Update |
| 641 | references (and comments) to match the new name. |
| 642 | * init/tests/test_job.c, init/tests/test_event.c, |
| 643 | init/tests/test_process.c, init/tests/test_cfgfile.c, |
| 644 | init/tests/test_notify.c: Likewise. |
| 645 | |
Scott James Remnant | ef11983 | 2007-02-08 13:24:16 +0000 | [diff] [blame] | 646 | * init/job.c (job_child_reaper): Don't change the goal event; the |
| 647 | state changes will handle this. |
| 648 | (job_change_goal): Only dereference/reference the goal event if we're |
| 649 | actually changing it. |
| 650 | * init/tests/test_job.c (test_change_state, test_child_reaper): |
| 651 | Update tests to not assume that the goal event gets changed. |
| 652 | (test_kill_process): Eliminate race condition. |
| 653 | |
Scott James Remnant | 93376ef | 2007-02-08 12:53:53 +0000 | [diff] [blame] | 654 | * init/job.c (job_child_reaper): Correct some problems with job and |
| 655 | event failure; we now don't overwrite an existing failure record, |
| 656 | and don't record failure if the main process failed and the goal was |
| 657 | stop; since we likely caused it. |
| 658 | * init/tests/test_job.c (test_child_reaper): More test cases. |
| 659 | |
Scott James Remnant | c3db81c | 2007-02-08 12:38:19 +0000 | [diff] [blame] | 660 | * logd/event.d/logd.in: Stop on the new runlevel events, not the |
| 661 | shutdown event. |
| 662 | |
Scott James Remnant | e8d263c | 2007-02-08 03:20:30 +0000 | [diff] [blame] | 663 | * compat/sysv/shutdown.c (shutdown_now): Emit an ordinary runlevel |
| 664 | change event now; including the INIT_HALT environment variable |
| 665 | * compat/sysv/man/shutdown.8: Update the manual |
| 666 | |
Scott James Remnant | 52360ea | 2007-02-08 03:06:40 +0000 | [diff] [blame] | 667 | * compat/sysv/telinit.c: Now just sends out a runlevel event with |
| 668 | an argument giving the new runlevel. |
| 669 | * compat/sysv/man/telinit.8: Update description of the command. |
| 670 | |
Scott James Remnant | 8662bd0 | 2007-02-08 02:57:56 +0000 | [diff] [blame] | 671 | * upstart/message.h: Remove the UPSTART_SHUTDOWN message. |
| 672 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 673 | Remove handling for the shutdown message. |
| 674 | * upstart/tests/test_message.c (test_new, test_handle): Remove |
| 675 | tests against the shutdown message. |
| 676 | * init/control.c (control_shutdown): Remove the shutdown command |
| 677 | from the server. |
| 678 | * init/tests/test_control.c (test_shutdown): Remove tests for it. |
| 679 | * init/event.h: Remove the shutdown event. |
| 680 | * util/initctl.c: Remove the shutdown command reference. |
| 681 | * util/events.c (shutdown_action): Remove the command. |
| 682 | * util/events.h: Update. |
| 683 | * util/tests/test_events.c (test_shutdown_action): Remove tests. |
| 684 | |
Scott James Remnant | 6590660 | 2007-02-08 02:51:39 +0000 | [diff] [blame] | 685 | * init/job.c (job_detect_idle): Rename to job_detect_stalled |
| 686 | (job_detect_stalled): Remove the idle state detection |
| 687 | (job_set_idle_event): Idle event has been removed. |
| 688 | * init/job.h: Update. |
| 689 | * init/tests/test_job.c (test_detect_idle): Rename to |
| 690 | (test_detect_stalled): and remove idle detection tests. |
| 691 | * init/main.c (main): Replace job_detect_idle with job_detect_stalled |
| 692 | * init/control.c (control_shutdown): Don't set the idle event. |
| 693 | * init/tests/test_control.c (test_shutdown): Don't detect the idle |
| 694 | event (and thus the second event) |
| 695 | |
Scott James Remnant | b0d99d5 | 2007-02-08 02:40:43 +0000 | [diff] [blame] | 696 | * init/cfgfile.c (cfg_stanza_service): Parser for service stanza. |
| 697 | * init/tests/test_cfgfile.c (test_stanza_service): Test the service |
| 698 | stanza. |
| 699 | (test_stanza_respawn): Check that respawn implies service. |
| 700 | * TODO: Update. |
| 701 | |
| 702 | * init/job.h (Job): Add a new service member. |
| 703 | * init/job.c (job_new): Service starts off as false. |
| 704 | (job_change_state): Check service instead of respawn. |
| 705 | * init/tests/test_job.c (test_change_state): Check with service |
| 706 | instead of respawn, since that's what we really mean. |
| 707 | |
Scott James Remnant | e4ab75c | 2007-02-08 02:28:19 +0000 | [diff] [blame] | 708 | * init/cfgfile.c (cfg_read_job): Copy a whole bunch more state |
| 709 | into the newly parsed job. |
| 710 | * init/job.c (job_run_process): Only output the first error. |
| 711 | * init/tests/test_cfgfile.c (test_read_job): Make sure important |
| 712 | things are copied. |
| 713 | * TODO: Update. |
| 714 | |
Scott James Remnant | db31c15 | 2007-02-08 02:05:38 +0000 | [diff] [blame] | 715 | * init/main.c: Restore a much simplified version of the term |
| 716 | handler that doesn't try and copy across any state. |
| 717 | |
Scott James Remnant | 517f555 | 2007-02-08 02:02:52 +0000 | [diff] [blame] | 718 | * compat/sysv/telinit.c: Update call to event_emit; we'll revisit |
| 719 | this shortly when we get rid of the shutdown event. |
| 720 | |
Scott James Remnant | 1dc0de5 | 2007-02-08 01:57:34 +0000 | [diff] [blame] | 721 | * util/events.c (handle_event): Add new id field (but ignore it) |
| 722 | Functio |
| 723 | (handle_event_job_status): New function to handle the new event. |
| 724 | (handle_event_finished): Function to handle the end of the event. |
| 725 | (emit_action): Send the newer event, and loop over replies until |
| 726 | we get a finished one. |
| 727 | * util/tests/test_events.c (test_emit_action): Update tests cases. |
| 728 | |
Scott James Remnant | d952017 | 2007-02-08 01:18:24 +0000 | [diff] [blame] | 729 | * init/control.c (control_event_emit): New function to handle the |
| 730 | new-style emit message. |
| 731 | * init/tests/test_control.c (test_event_emit): Make sure the new |
| 732 | message function behaves. |
| 733 | |
Scott James Remnant | b3e539e | 2007-02-08 01:10:12 +0000 | [diff] [blame] | 734 | * init/event.c, init/job.c, init/main.c, init/tests/test_event.c, |
| 735 | init/tests/test_job.c: Completely drop the serialisation code, it's |
| 736 | getting out of date and in the way. |
| 737 | |
Scott James Remnant | 71b91fc | 2007-02-08 01:07:56 +0000 | [diff] [blame] | 738 | * init/event.h: Remove compatibility macros. |
| 739 | (EventEmission): Drop the callback function; it was too error prone |
| 740 | to try and do it this way, and we only ever wanted to release a job |
| 741 | anyway as control requests are better handled through the notify |
| 742 | interface. |
| 743 | (EventEmissionCb): Drop unused typedef. |
| 744 | * init/event.c (event_emit): Drop callback argument. |
| 745 | (event_finished): Don't call the callback |
| 746 | * init/tests/test_event.c: Update to avoid callbacks. |
| 747 | * init/job.c (job_change_state): Convert to using event_emit and |
| 748 | EventEmission. |
| 749 | (job_detect_idle): Drop extra arguments to event_emit. |
| 750 | * init/main.c (main, cad_handler, kbd_handler): Drop extra arguments |
| 751 | to event_emit. |
| 752 | * init/control.c (control_shutdown): Use event_emit instead of |
| 753 | event_queue. |
| 754 | * init/tests/test_control.c (test_shutdown): Convert to using |
| 755 | EventEmission. |
| 756 | (test_watch_events, test_unwatch_events): Drop extra arguments to |
| 757 | event_emit. |
| 758 | * init/tests/test_notify.c (test_subscribe_event, test_job) |
| 759 | (test_event, test_event_finished): Drop extra arguments to event_emit |
| 760 | * init/tests/test_job.c (test_change_goal, test_change_state) |
| 761 | (test_run_script, test_child_reaper, test_detect_idle): Drop |
| 762 | extra arguments to event_emit. |
| 763 | * init/tests/test_process.c (test_spawn): Drop extra arguments to |
| 764 | event_emit. |
| 765 | |
Scott James Remnant | f082fc4 | 2007-02-08 00:50:11 +0000 | [diff] [blame] | 766 | * TODO: Update. |
| 767 | |
Scott James Remnant | 716f75c | 2007-02-08 00:49:40 +0000 | [diff] [blame] | 768 | Rewrite the notification subsystem quite significantly; now we |
| 769 | have individual functions to subscribe to different types of |
| 770 | notification, and can even subscribe to individual jobs or events. |
| 771 | |
| 772 | * init/notify.c (notify_subscribe_job, notify_subscribe_event) |
| 773 | (notify_unsubscribe): New subscription and unsubscription functions |
| 774 | that assume one record per subscription, not process. |
| 775 | (notify_subscription_find): Function to find a subscription. |
| 776 | (notify_job): Send a message to anything subscribed to the goal event |
| 777 | as well. |
| 778 | (notify_event): Use EventEmission and include the id in the event. |
| 779 | (notify_event_finished): New function, sends a finished message and |
| 780 | includes both the id and whether the event failed. |
| 781 | * init/notify.h (NotifySubscribe): New notify structure that is |
| 782 | once per subscription, rather than per-process; and allows |
| 783 | subscription to individual jobs or events. |
| 784 | * init/tests/test_notify.c (test_subscribe_job) |
| 785 | (test_subscribe_event, test_unsubscribe): Test the new subscription |
| 786 | functions, replacing the old |
| 787 | (test_subscribe): tests. |
| 788 | (test_subscription_find): Check finding works |
| 789 | (check_event, test_event): Update to use emissions, and check that the |
| 790 | id is correct. |
| 791 | (test_event_finished): Check this one works too |
| 792 | (check_event_job_status, test_job): Make sure processes subscribed |
| 793 | via the goal event are notified too. |
| 794 | * init/event.c (event_pending): Pass the emission directly. |
| 795 | (event_finished): Notify subscribers that the event has finished. |
| 796 | * init/control.c (control_error_handler): Call notify_unsubscribe |
| 797 | (control_watch_jobs, control_unwatch_jobs, control_watch_events) |
| 798 | (control_unwatch_events): Update to the new subscription API. |
| 799 | * init/tests/test_control.c (test_error_handler): Use new API |
| 800 | (test_watch_jobs, test_unwatch_jobs, test_watch_events) |
| 801 | (test_unwatch_events): Also update these to the new API; use a |
| 802 | destructor to make sure the subscription is freed. |
| 803 | |
Scott James Remnant | 9e13a24 | 2007-02-08 00:24:21 +0000 | [diff] [blame] | 804 | * init/tests/test_process.c: Don't use printf, use TEST_FUNCTION |
| 805 | |
Scott James Remnant | e627ad4 | 2007-02-07 00:23:57 +0000 | [diff] [blame] | 806 | 2007-02-07 Scott James Remnant <scott@netsplit.com> |
| 807 | |
Scott James Remnant | 459aee3 | 2007-02-07 22:44:08 +0000 | [diff] [blame] | 808 | * upstart/message.h: Allocate new grouped event messages. |
| 809 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 810 | Add support for the new grouped event messages. |
| 811 | * upstart/tests/test_message.c (test_new, test_handle) |
| 812 | (my_handler): Make sure the new messages are passed correctly. |
| 813 | |
Scott James Remnant | 1d79215 | 2007-02-07 20:56:01 +0000 | [diff] [blame] | 814 | * init/job.c (job_change_state): Clear the goal event whenever we |
| 815 | reach the final rest state of a job (waiting for all jobs, running |
| 816 | for services). |
| 817 | * init/tests/test_job.c (test_change_state): Check that the goal |
| 818 | event goes away at the right times. |
| 819 | * TODO: Update. |
| 820 | |
Scott James Remnant | ab17ab9 | 2007-02-07 20:38:01 +0000 | [diff] [blame] | 821 | * init/tests/test_job.c (test_child_reaper): Make sure that the |
| 822 | event is marked failed properly |
| 823 | |
Scott James Remnant | 6d007b8 | 2007-02-07 20:21:54 +0000 | [diff] [blame] | 824 | * init/job.c (job_start_event, job_stop_event): There's no reason |
| 825 | for these to exist as seperate functions anymore, especially since |
| 826 | we want to eventually have some kind of match table. |
| 827 | (job_handle_event): Perform the iterations and match calls here |
| 828 | instead, since we just call job_change_goal now. |
| 829 | * init/job.h: Remove prototypes. |
| 830 | * init/tests/test_job.c (test_start_event, test_stop_event): Fold into |
| 831 | (test_handle_event): which now handles all the cases. |
| 832 | |
Scott James Remnant | 269b7b9 | 2007-02-07 20:04:42 +0000 | [diff] [blame] | 833 | * init/job.c (job_detect_idle): Call event_emit |
| 834 | * init/main.c (main, cad_handler, kbd_handler): Call event_emit |
| 835 | instead of event_queue. |
| 836 | * init/tests/test_event.c (test_new): Call event_poll |
| 837 | * init/tests/test_job.c (test_change_state, test_child_reaper) |
| 838 | (test_detect_idle, test_change_state): Update to use newer event API. |
| 839 | * TODO: Update. |
| 840 | |
Scott James Remnant | 80eabbc | 2007-02-07 19:54:27 +0000 | [diff] [blame] | 841 | * init/job.c (job_start, job_stop): Drop these functions; call |
| 842 | job_change_goal instead (which is now public). |
| 843 | (job_change_state, job_child_reaper): Call job_change_goal instead. |
| 844 | * init/job.h: Update. |
| 845 | * init/tests/test_job.c (test_start, test_stop): Merge into new |
| 846 | (test_change_goal): function. |
| 847 | * init/main.c (main): Call job_change_goal instead of job_start. |
| 848 | * init/control.c (control_job_start, control_job_stop): Call |
| 849 | job_change_goal instead. |
| 850 | |
Scott James Remnant | 4522f4d | 2007-02-07 19:38:19 +0000 | [diff] [blame] | 851 | * init/tests/test_job.c (test_new, test_change_state) |
Scott James Remnant | 80eabbc | 2007-02-07 19:54:27 +0000 | [diff] [blame] | 852 | (test_run_script, test_start, test_stop, test_start_event): |
Scott James Remnant | 4522f4d | 2007-02-07 19:38:19 +0000 | [diff] [blame] | 853 | |
| 854 | * init/job.h (Job): goal_event is now an EventEmission, and is |
| 855 | a direct pointer to the one in the events queue, rather than a copy. |
| 856 | * init/process.c (process_setup_environment): Reference the event |
| 857 | name and environment through the goal event, not directly. |
| 858 | * init/job.c (job_run_script): Reference the event name and |
| 859 | environment through the goal event, not directly. |
| 860 | (job_change_state, job_child_reaper): Replace direct setting of the |
| 861 | job goal with a call to job_stop; the process state is always |
| 862 | PROCESS_NONE in all three cases, so this is completely safe. |
| 863 | (_job_start, _job_stop): Merge these two functions together into |
| 864 | (job_change_goal): which behaves a lot more like job_change_state, |
| 865 | except that it doesn't loop. This handles the changing of the |
| 866 | emission. |
| 867 | (job_start, job_start_event, job_stop, job_stop_event): Simplify |
| 868 | these functions, now they just call job_change_goal passing in |
| 869 | the emission pointer (or NULL). |
| 870 | |
Scott James Remnant | b1db7a3 | 2007-02-07 16:33:27 +0000 | [diff] [blame] | 871 | * init/main.c, init/job.c, init/job.h, init/event.c, init/event.h, |
| 872 | init/tests/test_job.c, init/tests/test_event.c: Remove state |
| 873 | serialisation code for the time being; maintaining it is getting |
| 874 | increasingly harder, and it introduces some major bugs. It will |
| 875 | get rewritten shortly. |
| 876 | |
Scott James Remnant | 4216cc8 | 2007-02-07 16:22:47 +0000 | [diff] [blame] | 877 | * init/event.c (event_pending): Pass the emission directly to |
| 878 | job_handle_event now. |
| 879 | * init/job.c (job_handle_event, job_start_event, job_stop_event): |
| 880 | Deal with event emissions rather than just plain events, the change |
| 881 | so far doesn't do anything else other than take the structure change. |
| 882 | * init/job.h: Change prototypes. |
| 883 | * init/tests/test_job.c (test_start_event, test_stop_event) |
| 884 | (test_handle_event): Update tests to use emissions. |
| 885 | |
Scott James Remnant | b2d06d4 | 2007-02-07 15:55:33 +0000 | [diff] [blame] | 886 | * init/tests/test_event.c (test_read_state, test_write_state): Check |
| 887 | the passing of the progress information. |
| 888 | * init/event.c (event_read_state, event_write_state): Add progress |
| 889 | field to the serialisation (oops). |
| 890 | |
Scott James Remnant | ab132da | 2007-02-07 15:48:02 +0000 | [diff] [blame] | 891 | * init/event.h: Add missing attribute for event_read_state. |
| 892 | * init/cfgfile.h: Add missing attributes. |
| 893 | * init/main.c (read_state): Don't discard return value. |
| 894 | * TODO: Update. |
| 895 | |
Scott James Remnant | fcc9a0d | 2007-02-07 15:41:57 +0000 | [diff] [blame] | 896 | * init/main.c (read_state): Handle the Emission keyword; also handle |
| 897 | Event really being an EventEmission. |
| 898 | * init/event.c (event_emit): Make the next emission id a static global |
| 899 | (event_read_state, event_write_state): Serialise event emission |
| 900 | structures, not plain events; also send over the last id we used so |
| 901 | it appears seamless. This doesn't yet handle the callback/data bit |
| 902 | of the serialisation, which turns out to be a little tricky ... oops |
| 903 | * init/event.h: Update. |
| 904 | * init/tests/test_event.c (test_read_state, test_write_state): Check |
| 905 | that serialisation is done with EventEmissions instead, and all the |
| 906 | fields are passed (except callback and data which are ... tricky). |
| 907 | |
Scott James Remnant | a39da0f | 2007-02-07 13:52:42 +0000 | [diff] [blame] | 908 | * init/main.c (main): Call event_poll instead of event_queue_run. |
| 909 | |
Scott James Remnant | e47588c | 2007-02-07 13:50:01 +0000 | [diff] [blame] | 910 | * init/event.c (event_poll): Add the new function that replaces |
| 911 | event_queue_run(); handles the new-style event emission structures |
| 912 | in the list and only returns when there are no non-handling events. |
| 913 | (event_pending, event_finished): Handling of particular event states |
| 914 | during poll; split out for readability. |
| 915 | (event_queue, event_queue_run): Drop these obsolete functions. |
| 916 | (event_read_state): Force type from event_queue. |
| 917 | * init/event.h: Add event_poll prototype; remove prototypes of old |
| 918 | functions, replacing with #defines for now so things still compile. |
| 919 | * init/tests/test_event.c (test_queue): Drop tests. |
| 920 | (test_read_state, test_write_state): Force type from event_queue |
| 921 | Change type we check size of. |
| 922 | (test_poll): Pretty thoroughly test the new poll function. |
| 923 | * init/job.c (job_change_state): Force type from event_queue |
| 924 | * init/control.c (control_event_queue): Force type from event queue |
| 925 | * init/tests/test_job.c (test_detect_idle): Force type from event_queue |
| 926 | * init/tests/test_control.c (test_event_queue, test_shutdown): |
| 927 | Force type from event_queue |
| 928 | |
Scott James Remnant | 162c2b2 | 2007-02-07 11:32:04 +0000 | [diff] [blame] | 929 | * init/event.c: Revert to a single list of events with an enum |
| 930 | (event_emit): Set the progress to pending initially. |
| 931 | (event_emit_find_by_id): Simplify now it just checks one list |
| 932 | (event_emit_finished): Function for jobs to call once they've done |
| 933 | with an event; just sets the progress to finished for the event |
| 934 | queue to pick up. |
| 935 | * init/tests/test_event.c (test_emit_finished): Check it. |
| 936 | |
| 937 | * init/event.h: Add prototype. |
| 938 | (EventProgress): Add new enum |
| 939 | (EventEmission): And add progress member to this structure |
| 940 | * init/tests/test_event.c (test_emit): Make sure the event is pending |
| 941 | |
Scott James Remnant | d379a60 | 2007-02-07 10:58:06 +0000 | [diff] [blame] | 942 | * init/event.c (event_emit_find_by_id): Locate an event emission |
| 943 | by its id in either the pending or handling queue. |
| 944 | * init/event.h: Add prototype |
| 945 | * init/tests/test_event.c (test_emit): Make sure that the emission |
| 946 | id is unique each time. |
| 947 | (test_emit_find_by_id): Test the function. |
| 948 | |
Scott James Remnant | 7282c9a | 2007-02-07 03:14:08 +0000 | [diff] [blame] | 949 | * init/event.c (event_emit): New function to replace event_queue(); |
| 950 | returns an EventEmission structure with the details filled in as |
| 951 | given. |
| 952 | * init/event.h: Add prototype. |
| 953 | |
Scott James Remnant | 81cc794 | 2007-02-07 02:54:25 +0000 | [diff] [blame] | 954 | * init/event.c (event_init): Rename the single events queue to |
| 955 | pending and add a new handling list. |
| 956 | |
| 957 | * init/event.h (EventEmission, EventEmissionCb): Add a new emission |
| 958 | structure that wraps an event, for use in the queue. |
| 959 | |
Scott James Remnant | d82109e | 2007-02-07 02:15:39 +0000 | [diff] [blame] | 960 | * util/tests/test_events.c (test_events_action): Update test now |
| 961 | that nih_message is more sensible. |
| 962 | * util/tests/test_jobs.c (test_start_action, test_list_action) |
| 963 | (test_jobs_action): Update test |
| 964 | |
Scott James Remnant | e5d3f01 | 2007-02-07 01:59:57 +0000 | [diff] [blame] | 965 | * util/events.c (emit_action): Actually pass the emit_env array |
| 966 | * util/tests/test_events.c (test_emit_action): Make sure it does. |
| 967 | |
| 968 | * util/initctl.c (main): Catch nih_command_parser() returning a |
| 969 | negative value to indicate an internal error, and always exit 1. |
| 970 | |
Scott James Remnant | 2cb9305 | 2007-02-07 01:49:43 +0000 | [diff] [blame] | 971 | * util/events.c (handle_event): Build up multiple lines to describe |
| 972 | the event, including its arguments and environment. |
| 973 | * util/tests/test_events.c (test_events_action): Check the new output |
| 974 | format is right. |
| 975 | |
Scott James Remnant | 685644e | 2007-02-07 01:29:28 +0000 | [diff] [blame] | 976 | * init/main.c (main): Take out inadvertantly leaked debugging code; |
| 977 | sorry about that. |
| 978 | |
Scott James Remnant | 5130e6d | 2007-02-07 01:18:38 +0000 | [diff] [blame] | 979 | * init/job.c (job_child_reaper): Rewrite this to make the logic a |
| 980 | little easier to follow, and support signals in normalexit. This |
| 981 | also now applies to deciding whether the job failed, if it did, we |
| 982 | store that information in the job so the stop and stopped events |
| 983 | can get it. |
| 984 | * init/tests/test_job.c (test_child_reaper): Add new test cases for |
| 985 | the setting of the failed flags. |
| 986 | |
Scott James Remnant | 18935fe | 2007-02-07 00:38:13 +0000 | [diff] [blame] | 987 | * init/cfgfile.c (cfg_stanza_normalexit): Allow signal names in the |
| 988 | arguments, which are added to the normalexit array or'd with 0x80 |
| 989 | * init/tests/test_cfgfile.c (test_stanza_normalexit): Check that we |
| 990 | can now parse signal names correctly. |
| 991 | |
Scott James Remnant | 326c231 | 2007-02-07 00:31:18 +0000 | [diff] [blame] | 992 | * init/job.c (job_failed_event): Change add to addp to fix leak. |
| 993 | |
Scott James Remnant | e627ad4 | 2007-02-07 00:23:57 +0000 | [diff] [blame] | 994 | * init/job.c (job_failed_event): Function to turn an event into one |
| 995 | that includes all the necessary arguments and environment. |
| 996 | (job_change_state): Call job_failed_event for the stop and stopped |
| 997 | events (bit hacky at the moment, will improve later). |
| 998 | * init/tests/test_job.c (test_change_state): Check that the failed |
| 999 | events are generated properly. |
| 1000 | |
Scott James Remnant | 2b2b7d1 | 2007-02-06 00:07:28 +0000 | [diff] [blame] | 1001 | 2007-02-06 Scott James Remnant <scott@netsplit.com> |
| 1002 | |
Scott James Remnant | 038ef4d | 2007-02-06 23:46:53 +0000 | [diff] [blame] | 1003 | * init/job.c (job_change_state): Reset the failed member when |
| 1004 | we enter the starting state. |
| 1005 | * init/tests/test_job.c (test_change_state): Make sure that the |
| 1006 | failed member is reset when we enter the starting state. |
| 1007 | |
Scott James Remnant | bd7ad1a | 2007-02-06 23:43:59 +0000 | [diff] [blame] | 1008 | * init/job.h (Job): Add failed, failed_state and exit_status members. |
| 1009 | * init/job.c (job_new): Initialise new members. |
| 1010 | |
Scott James Remnant | ddbf116 | 2007-02-06 23:40:30 +0000 | [diff] [blame] | 1011 | * init/job.c (job_child_reaper): Convert signals to names when |
| 1012 | outputting status messages. |
| 1013 | * init/tests/test_job.c (test_child_reaper): Check that the signal |
| 1014 | name gets converted over. |
| 1015 | |
Scott James Remnant | f11b7dc | 2007-02-06 23:03:48 +0000 | [diff] [blame] | 1016 | * init/event.h (CTRLALTDEL_EVENT): Now we've broken the shared |
| 1017 | namespace of events and jobs, rename the control-alt-delete event |
| 1018 | back to control-alt-delete. |
| 1019 | |
Scott James Remnant | 0ef0d39 | 2007-02-06 23:00:28 +0000 | [diff] [blame] | 1020 | * init/job.c (job_change_state): Replace the events generated as |
| 1021 | part of the job state, named for the job and state, with new state |
| 1022 | events that have the job name as an argument. |
| 1023 | * init/event.h: Define new job event names. |
| 1024 | * init/tests/test_job.c (test_change_state): Make sure the new |
| 1025 | events are correct, with the job name as an argument. |
| 1026 | |
Scott James Remnant | 1416d05 | 2007-02-06 22:42:55 +0000 | [diff] [blame] | 1027 | * init/job.c (job_change_state): Remove the job event; this has |
| 1028 | been repeatedly proved to be confusing. |
| 1029 | * init/tests/test_job.c (test_change_state): Remove checks for the |
| 1030 | job event. |
| 1031 | |
Scott James Remnant | 08146b9 | 2007-02-06 20:45:38 +0000 | [diff] [blame] | 1032 | * util/events.c (emit_action): Pass in extra arguments. |
| 1033 | (env_option): Function to parse an option given an environment |
| 1034 | variable. |
| 1035 | * util/events.h: Add prototype. |
| 1036 | * util/tests/test_events.c (test_emit_action): Make sure that the |
| 1037 | emit action works with no arguments and with arguments. |
| 1038 | (test_events_action): Send back events with the right number of args. |
| 1039 | (test_env_option): Check the env option parser works. |
| 1040 | * util/initctl.c: Give shutdown its own command and options, give |
| 1041 | emit a new -e option. |
Scott James Remnant | e8f3ef9 | 2007-02-06 20:20:33 +0000 | [diff] [blame] | 1042 | |
Scott James Remnant | 7f69c62 | 2007-02-06 20:16:50 +0000 | [diff] [blame] | 1043 | * util/events.c (shutdown_action): Split out from emit, seeing as |
| 1044 | these are going to be different from now on. |
| 1045 | * util/events.h: Add prototype. |
| 1046 | * util/tests/test_events.c (test_shutdown_action): Copy test cases. |
| 1047 | |
Scott James Remnant | ca2df74 | 2007-02-06 20:13:32 +0000 | [diff] [blame] | 1048 | * init/control.c (control_event_queue): Take the arguments and |
| 1049 | environment from the event queue request; and reparent into the |
| 1050 | event. |
| 1051 | * init/tests/test_control.c (test_event_queue): Check that arguments |
| 1052 | and environment are copied across properly. |
| 1053 | |
Scott James Remnant | a30a25f | 2007-02-06 20:08:22 +0000 | [diff] [blame] | 1054 | * init/notify.c (notify_event): Pass in the arguments and environment |
| 1055 | for the event. |
| 1056 | * init/tests/test_notify.c (check_event): Check for event arguments |
| 1057 | and environment from the notify process. |
| 1058 | (test_event): Add arguments and environment to the event we test with |
| 1059 | |
Scott James Remnant | ce51bfb | 2007-02-06 20:04:05 +0000 | [diff] [blame] | 1060 | * upstart/tests/test_message.c (test_new, test_handle): Send |
| 1061 | arguments and environment with the UPSTART_EVENT_QUEUE and |
| 1062 | UPSTART_EVENT messages. |
| 1063 | * upstart/wire.c (upstart_pop_int, upstart_pop_unsigned): Shrink |
| 1064 | only once. |
| 1065 | (upstart_pop_string): Check the length is at least one first, as |
| 1066 | we may just have an 'S'. |
| 1067 | |
| 1068 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 1069 | The UPSTART_EVENT and UPSTART_EVENT_QUEUE messages gain new array |
| 1070 | arguments containing the arguments and environment for the event. |
| 1071 | * upstart/message.h: Document the new arguments. |
| 1072 | |
Scott James Remnant | d1a6534 | 2007-02-06 19:25:38 +0000 | [diff] [blame] | 1073 | * util/tests/test_events.c, util/tests/test_jobs.c: Update the |
| 1074 | message format checks here too. |
| 1075 | |
Scott James Remnant | fb45e43 | 2007-02-06 19:07:24 +0000 | [diff] [blame] | 1076 | * upstart/tests/test_wire.c (test_pop_pack): Free the array. |
| 1077 | |
Scott James Remnant | a888203 | 2007-02-06 19:06:44 +0000 | [diff] [blame] | 1078 | * upstart/tests/test_message.c (test_new, test_handle) |
| 1079 | (test_handle_using, test_reader): Update tests to include and |
| 1080 | expect new type markers between each field. |
| 1081 | |
Scott James Remnant | f9663f0 | 2007-02-06 18:58:37 +0000 | [diff] [blame] | 1082 | * upstart/wire.c (upstart_push_int, upstart_push_unsigned): |
| 1083 | Take out silly asserts; it must have room! |
| 1084 | |
Scott James Remnant | c874a94 | 2007-02-06 18:57:34 +0000 | [diff] [blame] | 1085 | * upstart/wire.c (upstart_push_string, upstart_pop_string): Rewrite |
| 1086 | to use a type like the rest of the functions; this removes the strange |
| 1087 | length restriction and allows us to make the pop function |
| 1088 | non-destructive. |
| 1089 | * upstart/tests/test_wire.c (test_push_string): Update. |
| 1090 | (test_pop_string): Update, adding in non-destructive, wrong type |
| 1091 | and insufficient space for type test cases. |
| 1092 | (test_push_array, test_pop_array): These needed updated too, |
| 1093 | changing the string format changed the array format. |
| 1094 | (test_push_pack, test_pop_pack): And obviously the pack format changed. |
| 1095 | |
Scott James Remnant | 9ed5209 | 2007-02-06 18:36:51 +0000 | [diff] [blame] | 1096 | * upstart/wire.c (upstart_pop_header): Make the function |
| 1097 | non-destructive in the face of errors. |
| 1098 | * upstart/tests/test_wire.c (test_pop_header): Make sure that |
| 1099 | invalid headers are non-destructive on error. |
| 1100 | |
Scott James Remnant | dc4436f | 2007-02-06 18:33:27 +0000 | [diff] [blame] | 1101 | * upstart/tests/test_wire.c (test_pop_int, test_pop_unsigned): |
| 1102 | Make sure that insufficient space is non-destructive. |
| 1103 | |
Scott James Remnant | afc5b8c | 2007-02-06 18:32:08 +0000 | [diff] [blame] | 1104 | * upstart/wire.c (upstart_push_int, upstart_pop_int) |
| 1105 | (upstart_push_unsigned, upstart_pop_unsigned): Convert to array-style |
| 1106 | type first format. |
| 1107 | (upstart_push_string, upstart_push_header): Write the length and |
| 1108 | type fields out by hand so they don't get an 'i' prefix. |
| 1109 | (upstart_pop_string, upstart_pop_header): Read the length and type |
| 1110 | fields by hand so they don't get an 'i' prefix. |
| 1111 | * upstart/tests/test_wire.c (test_push_int, test_pop_int) |
| 1112 | (test_push_unsigned, test_pop_unsigned): Update test cases to match. |
| 1113 | (test_push_pack, test_pop_pack): Pack format was changed too. |
| 1114 | |
Scott James Remnant | a63d486 | 2007-02-06 18:10:58 +0000 | [diff] [blame] | 1115 | * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Add calls |
| 1116 | to push and pop array. |
| 1117 | * upstart/tests/test_wire.c (test_push_pack, test_pop_pack): Test |
| 1118 | support for arrays. |
| 1119 | |
Scott James Remnant | 5b6a202 | 2007-02-06 18:00:49 +0000 | [diff] [blame] | 1120 | * upstart/wire.c (upstart_push_array, upstart_pop_array): Implement |
| 1121 | new array functions; note that these use a newer format that allows |
| 1122 | us to transmit NULL without needing to limit the size of the array. |
| 1123 | * upstart/wire.h: Add prototypes. |
| 1124 | * upstart/tests/test_wire.c (test_push_array, test_pop_array): |
| 1125 | Test the new array functions. |
| 1126 | |
Scott James Remnant | f1d5111 | 2007-02-06 16:22:48 +0000 | [diff] [blame] | 1127 | * init/job.c (job_run_script): Build up the argument list, appending |
| 1128 | those from the goal event if one is set. |
| 1129 | (job_run_command): Use nih_str_array_add to build up the arguments, |
| 1130 | but don't append those from the goal event (use script). |
| 1131 | * init/tests/test_job.c (test_run_script): Make sure the arguments get |
| 1132 | passed to the running shell scripts. |
| 1133 | |
Scott James Remnant | 2efe556 | 2007-02-06 15:51:19 +0000 | [diff] [blame] | 1134 | * init/job.c (job_run_script): Only use the /dev/fd trick if we can |
| 1135 | actually stat /dev/fd; also don't hardcode that path ... |
| 1136 | * init/paths.h (DEV_FD): Add here. |
| 1137 | |
Scott James Remnant | efa8c7e | 2007-02-06 15:02:23 +0000 | [diff] [blame] | 1138 | * init/process.c (process_setup_environment): Copy environment |
| 1139 | variables from the goal event into the job's process. |
| 1140 | * init/tests/test_process.c (test_spawn): Make sure the environment |
| 1141 | reaches the job, but doesn't override that in the job already. |
| 1142 | |
| 1143 | * init/tests/test_job.c (test_start_event): |
| 1144 | |
Scott James Remnant | 0071dd3 | 2007-02-06 14:57:37 +0000 | [diff] [blame] | 1145 | * init/job.c (job_start_event, job_stop_event): Copy the arguments |
| 1146 | and environment from the event into the goal event. |
| 1147 | |
Scott James Remnant | b3d4dee | 2007-02-06 14:39:35 +0000 | [diff] [blame] | 1148 | * init/job.c (job_read_state, job_write_state): Read and write |
| 1149 | arguments and environment for goal event. |
| 1150 | * init/tests/test_job.c (test_read_state, test_write_state): Test |
| 1151 | with arguments and environment to the goal event. |
| 1152 | |
Scott James Remnant | 4bba970 | 2007-02-06 14:28:10 +0000 | [diff] [blame] | 1153 | * init/event.c (event_read_state, event_write_state): Read and write |
| 1154 | the arguments and environment of the event. |
| 1155 | * init/tests/test_event.c (test_read_state, test_write_state): Make |
| 1156 | sure arguments and environment are correctly serialised. |
| 1157 | |
Scott James Remnant | 462e717 | 2007-02-06 13:30:24 +0000 | [diff] [blame] | 1158 | * init/cfgfile.c (cfg_stanza_console): Fix a leak of the console |
| 1159 | argument in the case of duplicated options. |
| 1160 | (cfg_stanza_env): Drop the counting now nih_str_array_addp does it; |
| 1161 | and be sure to use that function. |
| 1162 | (cfg_stanza_umask): Fix leak of umask argument |
| 1163 | (cfg_stanza_nice): Fix leak of nice argument |
| 1164 | * init/tests/test_event.c (test_new): Call event_queue_run so init |
| 1165 | is called outside of a TEST_ALLOC_FAIL block. |
| 1166 | |
Scott James Remnant | fd19634 | 2007-02-06 13:19:03 +0000 | [diff] [blame] | 1167 | * init/event.c (event_new): Start off with NULL args and env, to |
| 1168 | match job (saves a few bytes). |
| 1169 | (event_match): Watch for NULL arguments! |
| 1170 | * init/tests/test_event.c (test_new): Check for NULL not alloc'd |
| 1171 | |
Scott James Remnant | fc9a76e | 2007-02-06 13:14:46 +0000 | [diff] [blame] | 1172 | * init/cfgfile.c (cfg_stanza_on, cfg_stanza_start) |
| 1173 | (cfg_stanza_stop): Parse arguments to the on stanza and store them |
| 1174 | directly in the event. |
| 1175 | * init/tests/test_cfgfile.c (test_stanza_on, test_stanza_start) |
| 1176 | (test_stanza_stop): Make sure arguments are parsed into the event. |
| 1177 | |
Scott James Remnant | 5dd1bc9 | 2007-02-06 12:57:50 +0000 | [diff] [blame] | 1178 | * init/event.c (event_new): Use nih_str_array_new. |
| 1179 | * init/cfgfile.c (cfg_stanza_env): Rewrite to use nih_str_array. |
| 1180 | |
Scott James Remnant | 4d0fc0f | 2007-02-06 11:34:41 +0000 | [diff] [blame] | 1181 | * init/job.c (job_run_script): Check the error returned from |
| 1182 | nih_io_reopen; don't just loop. We only ever expect ENOMEM (the |
| 1183 | other error, EBADF, is impossible). |
| 1184 | |
Scott James Remnant | eb8cb14 | 2007-02-06 11:31:27 +0000 | [diff] [blame] | 1185 | * init/job.c (job_change_state): Reset the goal_event to NULL when |
| 1186 | we catch a run-away job (as it's not stopping for the same event |
| 1187 | it started with). |
| 1188 | (job_child_reaper): Reset the goal_event to NULL after setting the |
| 1189 | goal to STOP. |
| 1190 | * init/tests/test_job.c (test_change_state, test_child_reaper): |
| 1191 | Check that the goal event gets reset whenever the goal gets changed. |
| 1192 | |
Scott James Remnant | 62e22f4 | 2007-02-06 02:08:19 +0000 | [diff] [blame] | 1193 | * init/tests/test_event.c: Use TEST_ALLOC_FAIL |
| 1194 | |
Scott James Remnant | 93cd4d2 | 2007-02-06 02:07:45 +0000 | [diff] [blame] | 1195 | * init/event.c (event_match): Match arguments using fnmatch() and |
| 1196 | allow more arguments in event1 than event2 (but not the other way |
| 1197 | around). |
| 1198 | * init/tests/test_event.c (test_match): Check the new permitted |
| 1199 | combinations. |
| 1200 | |
Scott James Remnant | 34b7c71 | 2007-02-06 01:57:45 +0000 | [diff] [blame] | 1201 | * init/event.h (Event): Add args and env members to Event. |
| 1202 | * init/event.c (event_new): Initialise args and env members to |
| 1203 | zero-length arrays. |
| 1204 | * init/tests/test_event.c (test_new): Use TEST_ALLOC_FAIL and |
| 1205 | make sure args and env are both initialised to a list containing |
| 1206 | just NULL. |
| 1207 | |
Scott James Remnant | b36c196 | 2007-02-06 01:48:09 +0000 | [diff] [blame] | 1208 | * util/jobs.c (start_action): Get the UPSTART_JOB environment variable |
| 1209 | and use that if we don't have any arguments passed to us. |
| 1210 | (do_job): Code split from the above function that handles a named job |
| 1211 | * util/tests/test_jobs.c (test_start_action): Make sure UPSTART_JOB |
| 1212 | is picked up. |
| 1213 | |
Scott James Remnant | 2a0b085 | 2007-02-06 01:35:56 +0000 | [diff] [blame] | 1214 | * init/process.h: Add necessary attributes. |
| 1215 | |
Scott James Remnant | 0b10d50 | 2007-02-06 01:28:01 +0000 | [diff] [blame] | 1216 | * init/process.c (process_setup_environment): Set the UPSTART_JOB |
| 1217 | environment variable from the job, and the UPSTART_EVENT environment |
| 1218 | variable from the job's goal_event member (if set). |
| 1219 | * init/tests/test_process.c (test_spawn): Make sure we get the |
| 1220 | environment in the job. |
| 1221 | |
Scott James Remnant | afce528 | 2007-02-06 01:22:54 +0000 | [diff] [blame] | 1222 | * init/job.h: Add attributes to job_new and job_read_state. |
| 1223 | * init/tests/test_job.c: Use CHECK_ALLOC_FAIL on the functions we |
| 1224 | didn't get around to touching while we were in here. |
| 1225 | |
Scott James Remnant | 1b9914d | 2007-02-06 01:01:11 +0000 | [diff] [blame] | 1226 | * init/job.c (job_start_event, job_stop_event): Set the goal_event |
| 1227 | member to a copy of the event we found. |
| 1228 | (job_read_state): Use event_new instead of trying to do it by hand. |
| 1229 | * init/tests/test_job.c (test_start_event, test_stop_event): Use |
| 1230 | CHECK_ALLOC_FAIL; and make sure the goal_event is set properly. |
| 1231 | (test_start, test_stop, test_write_new): Use event_new here too |
| 1232 | |
Scott James Remnant | 9e7d25c | 2007-02-06 00:42:41 +0000 | [diff] [blame] | 1233 | * init/job.c (job_write_state): Output a goal_event field containing |
| 1234 | the event name or nothing for NULL. |
| 1235 | (job_read_state): Parse the goal_event field |
| 1236 | * init/tests/test_job.c (test_write_state): Make sure the state is |
| 1237 | written out properly. |
| 1238 | (test_read_state): Make sure that the state is parsed correctly too. |
| 1239 | |
Scott James Remnant | 7aa22b6 | 2007-02-06 00:32:30 +0000 | [diff] [blame] | 1240 | * init/job.c (job_start, job_stop): Split all of the code except |
| 1241 | the goal_event setting into two new static functions that this calls |
| 1242 | (_job_start, _job_stop): New static functions |
| 1243 | (job_start_event, job_stop_event): Call _job_start and _job_stop |
| 1244 | instead of job_start and job_stop |
| 1245 | |
Scott James Remnant | e4111be | 2007-02-06 00:17:27 +0000 | [diff] [blame] | 1246 | * init/job.c (job_catch_runaway): Move this function up a bit. |
| 1247 | |
Scott James Remnant | 5761ef0 | 2007-02-06 00:15:51 +0000 | [diff] [blame] | 1248 | * init/job.c (job_start, job_stop): Clear the goal_event member, |
| 1249 | these functions are called for a manual start. |
| 1250 | * init/tests/test_job.c (test_start, test_stop): Make sure the |
| 1251 | goal_event member is freed and set to NULL. |
| 1252 | |
Scott James Remnant | 2b2b7d1 | 2007-02-06 00:07:28 +0000 | [diff] [blame] | 1253 | * init/job.h (Job): Add a new goal_event member |
| 1254 | * init/job.c (job_new): Initialise the goal_event member to NULL. |
| 1255 | * init/tests/test_job.c (test_new): Check with TEST_ALLOC_FAIL; |
| 1256 | also make sure goal_event is initialised to NULL. |
| 1257 | |
Scott James Remnant | 506ad09 | 2007-02-05 21:09:30 +0000 | [diff] [blame] | 1258 | 2007-02-05 Scott James Remnant <scott@netsplit.com> |
| 1259 | |
Scott James Remnant | ee7e555 | 2007-02-05 23:14:10 +0000 | [diff] [blame] | 1260 | * configure.ac: Bump version to 0.3.3 |
| 1261 | |
Scott James Remnant | cf64c48 | 2007-02-05 23:14:00 +0000 | [diff] [blame] | 1262 | * NEWS: Update. |
| 1263 | |
Scott James Remnant | 506ad09 | 2007-02-05 21:09:30 +0000 | [diff] [blame] | 1264 | * init/process.c (process_spawn): Exit with 255 so we don't clash |
| 1265 | with anything that uses 1 as a normal exit code. Note why we only |
| 1266 | close 0..2 (everything else is FD_CLOEXEC). |
| 1267 | * init/cfgfile.c (cfg_watch_dir): Mark the inotify watch descriptor |
| 1268 | as FD_CLOEXEC. |
| 1269 | * init/control.c (control_open): nih_io_set_cloexec can only ever |
| 1270 | return EINVAL, so no point checking it. |
| 1271 | |
Scott James Remnant | 0b74ff6 | 2007-02-04 00:43:20 +0000 | [diff] [blame] | 1272 | 2007-02-04 Scott James Remnant <scott@netsplit.com> |
| 1273 | |
| 1274 | * init/tests/test_control.c: Remove strange old code. |
| 1275 | |
Scott James Remnant | 9c44a42 | 2007-02-03 12:17:14 +0000 | [diff] [blame] | 1276 | 2007-02-03 Scott James Remnant <scott@netsplit.com> |
| 1277 | |
Scott James Remnant | 7b61886 | 2007-02-03 23:41:33 +0000 | [diff] [blame] | 1278 | * init/control.c (control_open_sock, control_reopen) |
| 1279 | (control_close_handler): Drop these functions; unconnected datagram |
| 1280 | sockets don't close -- so why try dealing with it? |
| 1281 | (control_error_handler): Don't reopen the socket on error, just log |
| 1282 | it -- the socket should be fine, there's no remote end to be lost, |
| 1283 | after all. |
| 1284 | * init/tests/test_control.c (test_close_handler): Drop. |
| 1285 | (test_error_handler): Drop the reopen tests. |
| 1286 | |
Scott James Remnant | 88c1aac | 2007-02-03 23:26:36 +0000 | [diff] [blame] | 1287 | * init/tests/test_job.c (test_run_script): Control socket doesn't |
| 1288 | get unexpectedly opened anymore; so no need to close it. |
| 1289 | |
| 1290 | * init/control.c (control_open): Remove the strange behaviour that |
| 1291 | this can be called to get the socket. Instead make control_io |
| 1292 | global; we're all adults after all. |
| 1293 | * init/tests/test_control.c (test_open): Remove the test for the |
| 1294 | silly behaviour. |
| 1295 | * init/notify.c (notify_job, notify_event): Use the control_io |
| 1296 | pointer directly, and just do nothing if we lost it somehow. |
| 1297 | |
Scott James Remnant | 2e204b7 | 2007-02-03 23:15:28 +0000 | [diff] [blame] | 1298 | * init/main.c (main): Being unable tp open the control socket, or |
| 1299 | parse the configuration, should be a fatal error; stop being so |
| 1300 | damned liberal! <g> Don't reset the signal state if we're |
| 1301 | being restarted, as this loses any pending signals -- be happy |
| 1302 | that our parent left them in a good state. Set SIGCHLD to the |
| 1303 | standard handler, otherwise we might lose this before we start |
| 1304 | the main loop (which does the same anyway). |
| 1305 | (term_handler): Rework so we don't need to close and open the |
| 1306 | control socket; instead we just close it in the child that's |
| 1307 | going to send the state, and notify the parent that it's safe to |
| 1308 | exec (which will cause it to be closed so the new init can open it). |
| 1309 | |
Scott James Remnant | 3af8546 | 2007-02-03 18:31:54 +0000 | [diff] [blame] | 1310 | * init/tests/test_control.c (test_open): Fix valgrind error |
| 1311 | * init/tests/test_notify.c (test_subscribe): Fix valgrind error |
| 1312 | |
Scott James Remnant | e443b9c | 2007-02-03 18:24:18 +0000 | [diff] [blame] | 1313 | * init/notify.c (notify_subscribe): Make safe against ENOMEM. |
| 1314 | * init/tests/test_notify.c (test_subscribe): Use TEST_ALLOC_FAIL |
| 1315 | |
Scott James Remnant | 4b601d1 | 2007-02-03 18:20:00 +0000 | [diff] [blame] | 1316 | * init/control.c: Add needed attributes; tidy up formatting. |
| 1317 | (control_open): Don't let ENOMEM fail opening the control socket. |
| 1318 | * init/control.h: Add needed attributes. |
| 1319 | * init/tests/test_control.c (test_open): Test for failed allocation. |
| 1320 | * init/main.c (term_handler): Make sure we catch failure to open |
| 1321 | the control socket again. |
| 1322 | |
Scott James Remnant | d308b43 | 2007-02-03 17:36:41 +0000 | [diff] [blame] | 1323 | * TODO: Update |
| 1324 | |
Scott James Remnant | 272938f | 2007-02-03 17:35:11 +0000 | [diff] [blame] | 1325 | * init/cfgfile.c (cfg_watch_dir): Clean this up a bit; now we only |
| 1326 | output a warning if inotify failed for any reason other than not |
| 1327 | being supported AND walking worked. |
| 1328 | |
Scott James Remnant | d78d00e | 2007-02-03 17:27:32 +0000 | [diff] [blame] | 1329 | * init/cfgfile.c (cfg_watch_dir): Update to even newer watch API; |
| 1330 | our create_handler is now always called if inotify is successful, |
| 1331 | so we just need to fall back to walking the directory when it |
| 1332 | isn't -- if inotify isn't supported, don't even bother complaining. |
| 1333 | (cfg_create_modify_handler): Check the stat of the file visited to |
| 1334 | make sure it's a regular file. |
| 1335 | (cfg_visitor): Check the stat of the file visited to make sure it's |
| 1336 | a regular file. |
| 1337 | |
Scott James Remnant | bcbb112 | 2007-02-03 17:11:21 +0000 | [diff] [blame] | 1338 | * init/cfgfile.c: Update include to upstart/enum.h |
| 1339 | * init/job.c: Update include to upstart/enum.h |
| 1340 | * init/job.h: Update include to upstart/enum.h |
| 1341 | |
Scott James Remnant | 801f9e1 | 2007-02-03 17:10:06 +0000 | [diff] [blame] | 1342 | * logd/main.c: Add attribute to open_logging |
| 1343 | |
Scott James Remnant | cbd0cf8 | 2007-02-03 17:05:39 +0000 | [diff] [blame] | 1344 | * util/initctl.c: Split out the command functions into new files; |
| 1345 | * util/jobs.c: This gets the job-related commands |
| 1346 | * util/events.h: This gets the event-related commands |
| 1347 | * util/initctl.h, util/jobs.h, util/events.h: Headers |
| 1348 | * util/tests/test_jobs.c: Test suite for job-related commands. |
| 1349 | * util/tests/test_events.c: Test suite for event-related commands. |
| 1350 | * util/Makefile.am (initctl_SOURCES): Add new files. |
| 1351 | (TESTS): Build new test suites. |
| 1352 | (test_jobs_SOURCES, test_jobs_LDFLAGS, test_jobs_LDADD): |
| 1353 | Details for job-related commands test suite binary. |
| 1354 | (test_events_SOURCES, test_events_LDFLAGS, test_events_LDADD): |
| 1355 | Details for event-related commands test suite binary. |
| 1356 | * TODO: Remove item about splitting initctl now we've done it. |
| 1357 | |
Scott James Remnant | adfcc3f | 2007-02-03 12:24:07 +0000 | [diff] [blame] | 1358 | * TODO: Big update; strip anything we have a spec for. |
| 1359 | |
Scott James Remnant | 1157bbf | 2007-02-03 12:17:55 +0000 | [diff] [blame] | 1360 | * upstart/message.c (upstart_message_handle): Make sure that if we |
| 1361 | fail to parse a message, we don't leave strings around in memory. |
| 1362 | * upstart/tests/test_message.c (test_open): Check that we get a |
| 1363 | raised EADDRINUSE if we try an open a socket twice. |
| 1364 | (test_handle): Add lots of checks for things like NULL names and |
| 1365 | incomplete messages; as well as the obvious unknown message. |
| 1366 | (test_reader): Make sure that errors while handling messages are |
| 1367 | dealt with by logging it. |
| 1368 | |
Scott James Remnant | 9c44a42 | 2007-02-03 12:17:14 +0000 | [diff] [blame] | 1369 | * upstart/job.c, upstart/job.h, upstart/tests/test_job.c: Rename to |
| 1370 | enum.c, enum.h and tests/test_enum.c; since this just includes enums |
| 1371 | and convert functions really. |
| 1372 | * upstart/Makefile.am: Update. |
| 1373 | * upstart/libupstart.h: Update include. |
| 1374 | * upstart/tests/test_message.c: Update include. |
| 1375 | |
Scott James Remnant | 1e57ab2 | 2007-02-01 16:51:28 +0000 | [diff] [blame] | 1376 | 2007-02-01 Scott James Remnant <scott@netsplit.com> |
| 1377 | |
Scott James Remnant | 0f1d9b6 | 2007-02-01 18:20:00 +0000 | [diff] [blame] | 1378 | * logd/main.c (main): Ensure we error if daemonise fails. |
| 1379 | |
Scott James Remnant | 3691157 | 2007-02-01 18:18:27 +0000 | [diff] [blame] | 1380 | * compat/sysv/shutdown.c (main): Ensure that signals and timers |
| 1381 | are added, even if we run out of memory. |
| 1382 | |
Scott James Remnant | 9b705ee | 2007-02-01 17:34:39 +0000 | [diff] [blame] | 1383 | * upstart/tests/test_message.c: Change from assert to assert0 |
| 1384 | * upstart/tests/test_wire.c: Change from assert to assert0 |
| 1385 | * init/tests/test_notify.c: Change from assert to assert0 |
| 1386 | * init/tests/test_control.c: nih_io_message_send should always return |
| 1387 | a value greater than zero. |
| 1388 | |
Scott James Remnant | 91c6eb7 | 2007-02-01 17:19:32 +0000 | [diff] [blame] | 1389 | * upstart/tests/test_wire.c: Change to use assert instead of NIH_ZERO; |
| 1390 | the rationale here is that in test cases we just want to fail, not |
| 1391 | try again repeatedly. |
| 1392 | * upstart/tests/test_message.c: Likewise. |
| 1393 | |
Scott James Remnant | 9caf282 | 2007-02-01 17:04:34 +0000 | [diff] [blame] | 1394 | * init/tests/test_control.c: Use assert to ensure we get the expected |
| 1395 | return values of functions that raise errors. |
| 1396 | * init/tests/test_notify.c: Use assert to ensure we get the expected |
| 1397 | return values of functions that raise errors. |
| 1398 | |
Scott James Remnant | 1e57ab2 | 2007-02-01 16:51:28 +0000 | [diff] [blame] | 1399 | * init/cfgfile.c (cfg_watch_dir): Port to the new NihWatch API and |
| 1400 | use nih_dir_walk(). This also fixes the long-standing bug where we |
| 1401 | wouldn't watch the configuration directory if inotify was disabled. |
| 1402 | Drop both the parent and prefix members for now, until we clean this |
| 1403 | up later. |
| 1404 | (cfg_create_modify_handler): Wrap cfg_read_job after figuring out |
| 1405 | the job name. |
| 1406 | (cfg_job_name): Function to figure out the job name from a path. |
| 1407 | (cfg_visitor): Visitor function to handle initial parsing, figuring |
| 1408 | out the job name; otherwise identical to the standard handler. |
| 1409 | * init/cfgfile.h: Update prototype for cfg_watch_dir. |
| 1410 | * init/main.c (main): Update call to cfg_watch_dir. |
| 1411 | |
Scott James Remnant | bfd712d | 2007-01-31 12:13:25 +0000 | [diff] [blame] | 1412 | 2007-01-31 Scott James Remnant <scott@netsplit.com> |
| 1413 | |
| 1414 | * upstart/tests/test_message.c: Use TEST_ALLOC_FAIL to make sure |
| 1415 | allocations are handled properly. |
| 1416 | |
Scott James Remnant | 4482847 | 2007-01-30 11:53:33 +0000 | [diff] [blame] | 1417 | 2007-01-30 Scott James Remnant <scott@netsplit.com> |
| 1418 | |
Scott James Remnant | 2cc3654 | 2007-01-30 17:12:34 +0000 | [diff] [blame] | 1419 | * upstart/wire.c: Note that if any of the push functions fail, the |
| 1420 | entire buffer should be discarded. |
| 1421 | * upstart/tests/test_wire.c (test_push_int, test_push_unsigned) |
| 1422 | (test_push_string, test_push_header, test_push_pack): Us |
| 1423 | TEST_ALLOC_FAIL to ensure that failing to allocate memory is caught. |
| 1424 | |
Scott James Remnant | 1084c68 | 2007-01-30 15:17:41 +0000 | [diff] [blame] | 1425 | * upstart/tests/test_message.c (my_handler): Free the name and |
| 1426 | description after checking; they aren't otherwise. |
| 1427 | |
Scott James Remnant | dc8b329 | 2007-01-30 15:01:30 +0000 | [diff] [blame] | 1428 | * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Consume |
| 1429 | a copy of the va_list, so these can be called multiple times on the |
| 1430 | same list without ill effect. |
| 1431 | |
Scott James Remnant | 92d8744 | 2007-01-30 15:01:21 +0000 | [diff] [blame] | 1432 | * upstart/message.h: Add warn_unused_result attributes to |
| 1433 | upstart_message_handle and upstart_message_handle_using as they raise |
| 1434 | errors. |
| 1435 | |
Scott James Remnant | 2de2501 | 2007-01-30 14:57:27 +0000 | [diff] [blame] | 1436 | * upstart/wire.c: push functions return negative values to indicate |
| 1437 | insufficient memory. |
| 1438 | * upstart/wire.h: Add warn_unused_result attributes to push functions |
| 1439 | |
Scott James Remnant | 4ccebcf | 2007-01-30 14:51:17 +0000 | [diff] [blame] | 1440 | * upstart/tests/test_message.c: Guard calls to nih_io_buffer_push and |
| 1441 | nih_io_message_add_control with NIH_ZERO to ensure they succeed. |
| 1442 | * upstart/tests/test_wire.c: Guard calls to nih_io_buffer_push |
| 1443 | |
Scott James Remnant | 4482847 | 2007-01-30 11:53:33 +0000 | [diff] [blame] | 1444 | * HACKING: Update from libnih with new Documentation, |
| 1445 | Function Attributes and Test Cases sections. |
| 1446 | |
Scott James Remnant | 16a286f | 2007-01-10 15:38:33 +0000 | [diff] [blame] | 1447 | 2007-01-10 Scott James Remnant <scott@netsplit.com> |
| 1448 | |
Scott James Remnant | de44301 | 2007-01-10 18:45:40 +0000 | [diff] [blame] | 1449 | * init/main.c (crash_handler): s/SEGV/SIGSEGV/ |
| 1450 | |
Scott James Remnant | 505f928 | 2007-01-10 18:44:38 +0000 | [diff] [blame] | 1451 | * init/main.c (main): Rename variable |
| 1452 | |
Scott James Remnant | 56a4d06 | 2007-01-10 17:33:39 +0000 | [diff] [blame] | 1453 | * TODO: Update. |
| 1454 | |
Scott James Remnant | 78626fb | 2007-01-10 16:48:10 +0000 | [diff] [blame] | 1455 | * init/main.c (main): Change the way we clear the arguments; by |
| 1456 | deleting just the final NULL terminator, we fool the kernel into |
| 1457 | only returning one argument in cmdline. |
| 1458 | |
Scott James Remnant | 16a286f | 2007-01-10 15:38:33 +0000 | [diff] [blame] | 1459 | * init/main.c (segv_handler): Rename to crash_handler and handle |
| 1460 | SIGABRT as well, so we can catch assertion errors. Of course, in |
| 1461 | theory, with our high test converage this should never happen in |
| 1462 | practice <chortle> |
| 1463 | |
Scott James Remnant | 39ec35b | 2007-01-09 08:16:01 +0000 | [diff] [blame] | 1464 | 2007-01-09 Scott James Remnant <scott@netsplit.com> |
| 1465 | |
Scott James Remnant | 7f4db42 | 2007-01-09 20:51:08 +0000 | [diff] [blame] | 1466 | * init/main.c (main): Clear arguments so that upstart only ever |
| 1467 | appears as /sbin/init in ps, top, etc. |
| 1468 | |
Scott James Remnant | 8fd06de | 2007-01-09 20:38:27 +0000 | [diff] [blame] | 1469 | * TODO: Update. |
| 1470 | |
Scott James Remnant | 4d0481d | 2007-01-09 20:38:07 +0000 | [diff] [blame] | 1471 | * util/initctl.c: Add data pointer to functions and handle calls. |
| 1472 | |
Scott James Remnant | bcf9e97 | 2007-01-09 20:34:47 +0000 | [diff] [blame] | 1473 | * init/control.c: Add data pointer to all functions. |
| 1474 | * init/tests/test_control.c: Pass data pointer to |
| 1475 | upstart_message_handle_using() |
| 1476 | * init/tests/test_notify.c: Pass data pointer to |
| 1477 | upstart_message_handle_using() |
| 1478 | |
Scott James Remnant | 6aa008c | 2007-01-09 20:26:44 +0000 | [diff] [blame] | 1479 | * upstart/message.c (upstart_message_handle) |
| 1480 | (upstart_message_handle_using): Add a data pointer argument to these |
| 1481 | functions and pass it to the handler. |
| 1482 | (upstart_message_reader): Pass the io structure's data pointer. |
| 1483 | * upstart/message.h (UpstartMessageHandler): Add a data pointer to |
| 1484 | the message handler. |
| 1485 | * upstart/tests/test_message.c (test_handle, test_handle_using): |
| 1486 | Pass a data pointer to the function call and check it's passed |
| 1487 | to the handler correctly. |
| 1488 | (test_reader): Check that the io data pointer gets passed. |
| 1489 | |
Scott James Remnant | c7017d3 | 2007-01-09 18:44:58 +0000 | [diff] [blame] | 1490 | * init/tests/test_cfgfile.c (test_stanza_console, test_stanza_env) |
| 1491 | (test_stanza_umask, test_stanza_nice, test_stanza_limit): Finish off |
| 1492 | the newer style test cases. |
| 1493 | |
Scott James Remnant | e63ef80 | 2007-01-09 17:54:56 +0000 | [diff] [blame] | 1494 | * init/cfgfile.c (cfg_stanza_console, cfg_stanza_umask) |
| 1495 | (cfg_stanza_nice, cfg_stanza_limit, cfg_stanza_chroot) |
| 1496 | (cfg_stanza_chdir): Guard against duplicate uses of the stanzas. |
| 1497 | * init/tests/test_cfgfile.c (test_stanza_daemon) |
| 1498 | (test_stanza_respawn): Check that neither daemon or respawn override |
| 1499 | exec if they have no arguments. |
| 1500 | (test_stanza_script): Add missing function |
| 1501 | (test_stanza_chroot, test_stanza_chdir): Add tests for these simple |
| 1502 | stanzas. |
| 1503 | |
Scott James Remnant | 0cd393d | 2007-01-09 17:36:34 +0000 | [diff] [blame] | 1504 | * init/cfgfile.c: Change remaining uses of nih_error_raise and |
| 1505 | return to just nih_return_error. |
| 1506 | |
Scott James Remnant | c352b63 | 2007-01-09 17:31:41 +0000 | [diff] [blame] | 1507 | * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_daemon) |
| 1508 | (cfg_stanza_respawn, cfg_stanza_script): Disallow duplicates, |
| 1509 | both of command strings, scripts, limits and of just the flags. |
| 1510 | * init/tests/test_cfgfile.c (test_stanza_exec) |
| 1511 | (test_stanza_daemon, test_stanza_respawn, test_stanza_instance): |
| 1512 | Check the behaviour of these stanzas. |
| 1513 | |
Scott James Remnant | 94188d4 | 2007-01-09 16:43:58 +0000 | [diff] [blame] | 1514 | * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop): Disallow |
| 1515 | duplicate values for the script. |
| 1516 | * init/tests/test_cfgfile.c (test_stanza_start, test_stanza_stop): |
| 1517 | Test cases for those two functions. |
| 1518 | |
Scott James Remnant | 474a6ff | 2007-01-09 16:17:49 +0000 | [diff] [blame] | 1519 | * init/cfgfile.c (cfg_stanza_description, cfg_stanza_author) |
| 1520 | (cfg_stanza_version): Don't allow stanza to be duplicated anymore. |
| 1521 | * init/tests/test_cfgfile.c (test_stanza_description) |
| 1522 | (test_stanza_author, test_stanza_version): Test cases for these |
| 1523 | simple stanza; making sure duplication is not permitted. |
| 1524 | (test_stanza_on): Add a test case for this stanza too. |
| 1525 | |
Scott James Remnant | 49e8bb8 | 2007-01-09 15:57:59 +0000 | [diff] [blame] | 1526 | * init/cfgfile.c (cfg_stanza_kill): Guard against duplicate uses |
| 1527 | of the kill timeout stanza. |
| 1528 | * init/tests/test_cfgfile.c (test_stanza_kill): Test the complex |
| 1529 | kill stanza. |
| 1530 | (test_stanza_pid): Check duplicate usage results in an error. |
| 1531 | |
Scott James Remnant | 443ef2e | 2007-01-09 15:47:24 +0000 | [diff] [blame] | 1532 | * init/job.h (Job): Rename pidfile to pid_file and binary to pid_binary |
| 1533 | * init/job.c (job_new): Update names here too. |
| 1534 | * init/errors.h: Add a new "duplicate value" error. |
| 1535 | * init/cfgfile.c (cfg_read_job): Change name of variables, and catch |
| 1536 | the duplicate value error to add the line number. |
| 1537 | (cfg_stanza_pid): Change variable names, and clean this function up |
| 1538 | a little. Make it an error to use a stanza more than once. |
| 1539 | * init/tests/test_cfgfile.c (test_stanza_pid): Write a newer test |
| 1540 | case function for the pid stanza. |
| 1541 | |
Scott James Remnant | 34ff87d | 2007-01-09 09:00:30 +0000 | [diff] [blame] | 1542 | * init/cfgfile.c (cfg_stanza_normalexit): Use do/while instead of |
| 1543 | while, that we don't have to test has_token first as next_arg does |
| 1544 | that for us. |
| 1545 | |
Scott James Remnant | a735469 | 2007-01-09 08:56:02 +0000 | [diff] [blame] | 1546 | * init/cfgfile.c (cfg_stanza_normalexit): Change to peek at the next |
| 1547 | token to see whether it's missing or not, and then just fetch each |
| 1548 | next argument at a time. This is more efficient than parsing them |
| 1549 | all in one go, and also means we can report the error in the right |
| 1550 | place! |
| 1551 | * init/tests/test_cfgfile.c (test_stanza_normalexit): Since we've |
| 1552 | changed the function that parses the stanza, add a proper test case |
| 1553 | function for it, covering all the behaviours. |
| 1554 | |
Scott James Remnant | 92e7fda | 2007-01-09 08:40:13 +0000 | [diff] [blame] | 1555 | * init/job.c (job_new): Initialise the emits member to an empty list. |
| 1556 | * init/job.h (Job): Add the emits member as a list. |
| 1557 | * init/tests/test_job.c (test_new): Check the emits list starts off |
| 1558 | empty. |
| 1559 | * init/tests/test_cfgfile.c (test_stanza_emits): Test the new emits |
| 1560 | stanza; this function will also serve as a prototype for cleaning up |
| 1561 | the config tests. |
| 1562 | |
| 1563 | * init/cfgfile.c (cfg_stanza_emits): Add function to parse the new |
| 1564 | emits stanza. |
| 1565 | |
Scott James Remnant | 39ec35b | 2007-01-09 08:16:01 +0000 | [diff] [blame] | 1566 | * init/cfgfile.c (cfg_stanza_depends): Remove the depends stanza |
| 1567 | from the configuration file. Dependency support has never been used, |
| 1568 | and is to be replaced by a more flexible event/state configuration |
| 1569 | and blocking on the starting/stopping events. |
| 1570 | * init/tests/test_cfgfile.c: Remove references and tests for the |
| 1571 | depends stanza. |
| 1572 | * init/job.h: Remove the depends list from the job structure. |
| 1573 | * init/job.c (job_new): No depends list to initialise. |
| 1574 | (job_change_state): No dependencies to release |
| 1575 | (job_start): No dependencies to iterate; this removes a particularly |
| 1576 | hairy and complex interaction between state changes. Remove the |
| 1577 | dependency event. |
| 1578 | (job_release_depends): Drop this function. |
| 1579 | * init/tests/test_job.c (test_start, test_stop): Massively simplify |
| 1580 | these tests cases now we don't have dependencies to worry about. |
| 1581 | (test_release_depends): Drop tests |
| 1582 | |
Scott James Remnant | d4f5fb8 | 2007-01-08 23:25:23 +0000 | [diff] [blame] | 1583 | 2007-01-08 Scott James Remnant <scott@netsplit.com> |
| 1584 | |
| 1585 | * init/cfgfile.c: Rewrite using the nih_config API, rather than one |
| 1586 | huge function we now just have seperate handler functions for each |
| 1587 | stanza. We can also use more fine-grained parsing than slurping |
| 1588 | all args in and counting them. |
| 1589 | (cfg_read_job): Catch exceptions from the configuration parser and |
| 1590 | add the line number where the problem occurred to an output message. |
| 1591 | Parser errors are now fatal, and not ignored. |
| 1592 | * init/errors.h: Add a file containing errors raised within the init |
| 1593 | daemon codebase. |
| 1594 | * init/Makefile.am (init_SOURCES): Build with errors.h |
| 1595 | * init/tests/test_cfgfile.c: Update test cases now we don't expect |
| 1596 | a job to be returned if there's a parser error. |
| 1597 | |
| 1598 | * TODO: Update |
| 1599 | |
Scott James Remnant | 6638420 | 2007-01-06 14:23:18 +0000 | [diff] [blame] | 1600 | 2007-01-06 Scott James Remnant <scott@netsplit.com> |
| 1601 | |
Scott James Remnant | 4f96819 | 2007-01-06 20:31:13 +0000 | [diff] [blame] | 1602 | * logd/main.c (logging_reader): Fix inadvertent shadowing of the |
| 1603 | len parameter. |
| 1604 | |
Scott James Remnant | da10027 | 2007-01-06 20:24:18 +0000 | [diff] [blame] | 1605 | * compat/sysv/telinit.c: Oops, nearly forgot to port this to send |
| 1606 | the messages in the new way. |
| 1607 | * compat/sysv/shutdown.c (shutdown_now): Likewise, port this too. |
| 1608 | |
Scott James Remnant | 83a8652 | 2007-01-06 19:55:38 +0000 | [diff] [blame] | 1609 | * TODO: Update. |
| 1610 | |
Scott James Remnant | 6e94188 | 2007-01-06 14:38:57 +0000 | [diff] [blame] | 1611 | * util/initctl.c (handle_job_status): Output the process argument, |
| 1612 | not the pid argument which contains the origin of the message. |
| 1613 | |
Scott James Remnant | 17d6dca | 2007-01-06 14:33:30 +0000 | [diff] [blame] | 1614 | * upstart/message.c (upstart_message_handle): Raise a new unknown |
| 1615 | message error if we don't have a handler and a new illegal message |
| 1616 | error if the source is illegal. |
| 1617 | * upstart/tests/test_message.c (test_handle): Adjust tests to check |
| 1618 | for the new errors that we raise. |
| 1619 | * upstart/errors.h: Define strings for new errors. |
| 1620 | |
Scott James Remnant | 6638420 | 2007-01-06 14:23:18 +0000 | [diff] [blame] | 1621 | * util/initctl.c: Yet another makeover for this little program, |
| 1622 | port it to the new message/control framework using handler functions |
| 1623 | and NihIoMessage. This starts to make each action function look |
| 1624 | very similar, so there's method to this madness. |
| 1625 | |
Scott James Remnant | b4725d9 | 2007-01-05 13:10:21 +0000 | [diff] [blame] | 1626 | 2007-01-05 Scott James Remnant <scott@netsplit.com> |
| 1627 | |
Scott James Remnant | 3d6bb79 | 2007-01-05 22:33:43 +0000 | [diff] [blame] | 1628 | * logd/main.c (main): Make sure that we add the SIGTERM handler. |
| 1629 | |
Scott James Remnant | efbaafb | 2007-01-05 18:12:15 +0000 | [diff] [blame] | 1630 | * init/tests/test_job.c (test_run_script): This test case relies |
| 1631 | on there only being one file descriptor watch, which won't be true |
| 1632 | if the control socket has been opened because there's a message to |
| 1633 | go out. Make sure it's closed first. |
| 1634 | |
Scott James Remnant | be1941f | 2007-01-05 17:57:59 +0000 | [diff] [blame] | 1635 | * init/init.supp: Update supressions file now that control_init |
| 1636 | has been renamed to notify_init |
| 1637 | |
Scott James Remnant | 71cc4d8 | 2007-01-05 17:53:32 +0000 | [diff] [blame] | 1638 | * init/Makefile.am: Include notify.o from all tests. |
| 1639 | * init/job.c (job_change_state, job_kill_process, job_start) |
| 1640 | (job_stop): Use the new notify_job function name. |
| 1641 | * init/event.c (event_queue_run): Use the new notify_event function |
| 1642 | name. |
| 1643 | |
Scott James Remnant | fea6cb6 | 2007-01-05 17:49:13 +0000 | [diff] [blame] | 1644 | * init/control.c (control_error_handler): Handle ECONNREFUSED now |
| 1645 | that the process id is available to us. |
| 1646 | * init/tests/test_control.c (test_error_handler): Make sure children |
| 1647 | going away is handled properly. |
| 1648 | |
Scott James Remnant | 3dfb213 | 2007-01-05 17:44:48 +0000 | [diff] [blame] | 1649 | * upstart/message.c (upstart_message_new): Store the process id in |
| 1650 | the int_data message field. |
| 1651 | * upstart/tests/test_message.c (test_new): Check the int_data field |
| 1652 | is filled in. |
| 1653 | |
Scott James Remnant | 5d70295 | 2007-01-05 17:21:34 +0000 | [diff] [blame] | 1654 | * init/main.c (main): Guard against various things returning an error |
| 1655 | that we weren't catching. |
| 1656 | |
Scott James Remnant | 601a0e3 | 2007-01-05 17:06:31 +0000 | [diff] [blame] | 1657 | * init/tests/test_notify.c: Whitespace fix. |
| 1658 | |
Scott James Remnant | 15cd086 | 2007-01-05 17:06:20 +0000 | [diff] [blame] | 1659 | * init/control.c (control_watch_jobs, control_unwatch_jobs) |
| 1660 | (control_watch_events, control_unwatch_events): Restore functionality |
| 1661 | to subscribe and unsubscribe from job and event notifications. |
| 1662 | * init/tests/test_control.c (test_watch_jobs, test_unwatch_jobs) |
| 1663 | (test_watch_events, test_unwatch_events): Check that the subscription |
| 1664 | and unsubscription messages work. |
| 1665 | * init/Makefile.am (test_control_LDADD): Link to notify.o |
| 1666 | |
| 1667 | * init/control.c: Drop unused include of upstart/errors.h |
| 1668 | |
Scott James Remnant | 58cef57 | 2007-01-05 16:18:42 +0000 | [diff] [blame] | 1669 | * init/notify.c: Move functions that handle subscription and |
| 1670 | notification from control.c. Other than changing the names, we're |
| 1671 | keeping the API the same for now; expect it to change later when we |
| 1672 | add the ability to subscribe to individual jobs or events. |
| 1673 | (notify_init): initialise the subscriptions list; we don't have a |
| 1674 | separate send queue now that the control I/O is always asynchronous. |
| 1675 | * init/notify.h: Moved notification enum, structure and prototypes |
| 1676 | from control.h, changing the names so they match notify_* in the |
| 1677 | process. |
| 1678 | * init/Makefile.am (init_SOURCES): Build and link notify.c using |
| 1679 | notify.h |
| 1680 | (TESTS): Build the notify test suite binary. |
| 1681 | (test_notify_SOURCES, test_notify_LDFLAGS, test_notify_LDADD): Details |
| 1682 | for notify test suite binary. |
| 1683 | * init/tests/test_notify.c: Rewrite test cases in the manner of |
| 1684 | test_control.c so that we have one function for notify_job and |
| 1685 | one for notify_event, each of which contains the child process that |
| 1686 | receives the notification, |
| 1687 | |
Scott James Remnant | b1679c6 | 2007-01-05 15:49:54 +0000 | [diff] [blame] | 1688 | * init/control.c (control_open): Allow this to be called to obtain |
| 1689 | the control socket, which means we can make it static. |
| 1690 | * init/tests/test_control.c (test_open): Check that it works. |
| 1691 | |
Scott James Remnant | f7c6b06 | 2007-01-05 15:33:33 +0000 | [diff] [blame] | 1692 | * init/control.c, init/control.h, init/tests/test_control.c: Move |
| 1693 | functions that handle subscription and notification to new notify.c |
| 1694 | (control_init): Drop completely, no need to maintain a send queue now |
| 1695 | (control_open): Change to return an NihIo that uses the default |
| 1696 | control watcher, and our error handler. Split socket opening into |
| 1697 | (control_open_sock): which can be called from other functions. |
| 1698 | (control_close): Use nih_io_close() to close the socket and free the |
| 1699 | structure in one go. |
| 1700 | (control_reopen): Close the open control socket and open it again |
| 1701 | without destroying the NihIo structure, its queues or state. |
| 1702 | (control_close_handler): Handle the control socket going away |
| 1703 | (control_error_handler): Handle errors on the control socket, |
| 1704 | including the connection refused error that indicates a client went |
| 1705 | away. |
| 1706 | (control_handle): Split this into a miriad of small functions with |
| 1707 | a table to link them to the message type; this will make expanding |
| 1708 | each message handler much easier in future. |
| 1709 | * init/control.h: Update. |
| 1710 | * init/tests/test_control.c: Rewrite test cases to check the new |
| 1711 | handler functions; as a side-effect, this gets rid of the evil giant |
| 1712 | child/parent functions in favour of one test function per handler |
| 1713 | function. |
| 1714 | |
Scott James Remnant | b4725d9 | 2007-01-05 13:10:21 +0000 | [diff] [blame] | 1715 | * upstart/message.c (upstart_message_handle_using): Wrapper function |
| 1716 | around upstart_message_handle that ensures all messages as passed to |
| 1717 | a single function. |
| 1718 | * upstart/message.h: Update. |
| 1719 | * upstart/tests/test_message.c (test_handle_using): Make sure it |
| 1720 | calls the single function. |
| 1721 | |
Scott James Remnant | de3666f | 2007-01-04 23:00:07 +0000 | [diff] [blame] | 1722 | 2007-01-04 Scott James Remnant <scott@netsplit.com> |
| 1723 | |
| 1724 | * upstart/message.c (upstart_message_reader): Handle any errors |
| 1725 | that occurred while handling the message. |
| 1726 | |
Scott James Remnant | 92feed9 | 2007-01-02 15:27:47 +0000 | [diff] [blame] | 1727 | 2007-01-02 Scott James Remnant <scott@netsplit.com> |
| 1728 | |
Scott James Remnant | 7833bbf | 2007-01-02 20:57:23 +0000 | [diff] [blame] | 1729 | * upstart/message.c (upstart_message_handle): Check that the name |
| 1730 | argument is never NULL. |
| 1731 | (upstart_message_reader): Simple message reader function that can |
| 1732 | be associated with an I/O watch and handles each message received. |
| 1733 | * upstart/message.h: Add prototype. |
| 1734 | * upstart/tests/test_message.c (test_reader): Test the reader function. |
| 1735 | |
Scott James Remnant | 0e3b5fe | 2007-01-02 18:39:03 +0000 | [diff] [blame] | 1736 | * upstart/control.c: Rename to upstart/message.c |
| 1737 | * upstart/control.h: Rename to upstart/message.h |
| 1738 | * upstart/tests/test_control.c: Rename to upstart/tests/test_message.c |
| 1739 | * upstart/libupstart.h: Update includes. |
| 1740 | * upstart/wire.c: Include message.h |
| 1741 | * upstart/wire.h: Update includes. |
| 1742 | * upstart/tests/test_wire.c: Update includes. |
| 1743 | * upstart/errors.h: Rename UPSTART_INVALID_MESSAGE to |
| 1744 | UPSTART_MESSAGE_INVALID so that it's prefixed. |
| 1745 | * upstart/Makefile.am (libupstart_la_SOURCES) |
| 1746 | (upstartinclude_HEADERS, TESTS): Update filenames. |
| 1747 | |
Scott James Remnant | 2ad9a04 | 2007-01-02 18:29:49 +0000 | [diff] [blame] | 1748 | * upstart/control.c (upstart_message_new): New function that |
| 1749 | creates an NihIoMessage directly from its arguments, which are a type |
| 1750 | followed by a variable number of args depending on that type. |
| 1751 | (upstart_message_handler): Function to find a handler function for |
| 1752 | a particular message type and origin process. |
| 1753 | (upstart_message_handle): New function that takes an NihIoMessage |
| 1754 | and invokes a handler function with a variable number of args |
| 1755 | depending on the message type. |
| 1756 | (upstart_send_msg, upstart_send_msg_to, upstart_recv_msg): Drop these |
| 1757 | functions, leave it up to the caller to decide whether to send and |
| 1758 | receive the messages synchronously or asynchronously; now that the |
| 1759 | capability is in nih_io_*. |
| 1760 | * upstart/control.h (UpstartMsgType): Rename to UpstartMessageType. |
| 1761 | (UpstartMessageHandler): Function with variable number of arguments |
| 1762 | that handles a message received. |
| 1763 | (UpstartMsg): Drop this structure entirely, we'll encode or decode |
| 1764 | the wire format directly from or into a function call, rather than |
| 1765 | use an intermediate structure to marshal it. |
| 1766 | (UpstartMessage): New structure to make a table that can be passed |
| 1767 | to upstart_message_handle to determine which handler should be called. |
| 1768 | * upstart/tests/test_control.c: Test new behaviour. |
| 1769 | * upstart/wire.c (upstart_push_header, upstart_pop_header): Change |
| 1770 | structure name for type parameter. |
| 1771 | * upstart/wire.h: Update. |
| 1772 | * upstart/tests/test_wire.c: Update. |
| 1773 | |
Scott James Remnant | 92feed9 | 2007-01-02 15:27:47 +0000 | [diff] [blame] | 1774 | * configure.ac (AC_COPYRIGHT): Update copyright to 2007. |
| 1775 | |
Scott James Remnant | 67546d1 | 2006-12-29 13:08:32 +0000 | [diff] [blame] | 1776 | 2006-12-29 Scott James Remnant <scott@netsplit.com> |
| 1777 | |
| 1778 | * upstart/wire.c (upstart_write_int, upstart_write_unsigned) |
| 1779 | (upstart_write_string, upstart_write_header, upstart_write_packv) |
| 1780 | (upstart_write_pack): Rename to *_push_* |
| 1781 | (upstart_read_int, upstart_read_unsigned, upstart_read_string) |
| 1782 | (upstart_read_header, upstart_read_packv, upstart_read_pack): Rename |
| 1783 | to *_pop_*. |
| 1784 | All of the above modified to modify an NihIoMessage structure, |
| 1785 | instead of trying to carry around buffers ourself. |
| 1786 | * upstart/wire.h: Update to match above. |
| 1787 | * upstart/tests/test_wire.c: Update all tests to match the above |
| 1788 | changes. |
| 1789 | |
Scott James Remnant | d76e8e3 | 2006-12-21 18:34:31 +0000 | [diff] [blame] | 1790 | 2006-12-21 Scott James Remnant <scott@netsplit.com> |
| 1791 | |
Scott James Remnant | f922a98 | 2006-12-21 18:45:30 +0000 | [diff] [blame] | 1792 | * upstart/wire.c (upstart_read_packv, upstart_write_packv): Change |
| 1793 | nih_assert_notreached to nih_assert_not_reached. |
| 1794 | |
Scott James Remnant | d76e8e3 | 2006-12-21 18:34:31 +0000 | [diff] [blame] | 1795 | * init/job.c (job_run_script): Open the NihIo structure in stream mode. |
| 1796 | * logd/main.c (logging_watcher): Open the NihIo structure in |
| 1797 | stream mode. |
| 1798 | (logging_reader): Need to pass the length of the size_t as a pointer |
| 1799 | so that it can be modified if less is read. |
| 1800 | |
Scott James Remnant | a038523 | 2006-12-17 15:21:39 +0000 | [diff] [blame] | 1801 | 2006-12-17 Scott James Remnant <scott@netsplit.com> |
| 1802 | |
Scott James Remnant | 00cc688 | 2006-12-17 19:54:36 +0000 | [diff] [blame] | 1803 | * upstart/wire.c (upstart_write_packv, upstart_write_pack) |
| 1804 | (upstart_read_packv, upstart_read_pack): Functions to write a pack |
| 1805 | of different variables to the stream, or read them from it |
| 1806 | * upstart/wire.h: Add prototypes. |
| 1807 | * upstart/tests/test_wire.c (test_write_pack, test_read_pack): |
| 1808 | Check we can read and write a pack of variables at once. |
| 1809 | |
Scott James Remnant | 518e1c1 | 2006-12-17 18:12:14 +0000 | [diff] [blame] | 1810 | * upstart/wire.c (upstart_write_header, upstart_read_header): Drop |
| 1811 | the version from the header, we'll just keep the protocol always |
| 1812 | backwards compatible. |
| 1813 | * upstart/wire.h: Update. |
| 1814 | * upstart/tests/test_wire.c (test_write_header, test_read_header): |
| 1815 | Check that everything works. |
| 1816 | |
Scott James Remnant | 64e378f | 2006-12-17 17:24:44 +0000 | [diff] [blame] | 1817 | * upstart/wire.c (upstart_write_string, upstart_read_string): |
| 1818 | Transmit the length as an unsigned, and use 0xffffffff to mean NULL |
| 1819 | instead of zero so we can still transmit the empty string. |
| 1820 | * upstart/wire.h: Update. |
| 1821 | * upstart/tests/test_wire.c (test_write_string, test_read_string): |
| 1822 | Tests for the functions to make sure the wire is at it should be. |
| 1823 | |
Scott James Remnant | d6dde95 | 2006-12-17 17:00:56 +0000 | [diff] [blame] | 1824 | * upstart/wire.c (upstart_read_str, upstart_write_str): Rename to |
| 1825 | upstart_read_string and upstart_write_string. |
| 1826 | * upstart/wire.h: Update. |
| 1827 | |
Scott James Remnant | c71ab3b | 2006-12-17 16:58:28 +0000 | [diff] [blame] | 1828 | * upstart/wire.c (upstart_write_unsigned, upstart_read_unsigned): |
| 1829 | Functions to send unsigned values over the wire, which we'll use |
| 1830 | to get a bit extra for the string lengths. |
| 1831 | * upstart/wire.h: Update. |
| 1832 | * upstart/tests/test_wire.c (test_write_unsigned) |
| 1833 | (test_read_unsigned): Test the new functions. |
| 1834 | |
Scott James Remnant | 0218e3a | 2006-12-17 16:39:33 +0000 | [diff] [blame] | 1835 | * upstart/wire.c (upstart_write_ints, upstart_read_ints): Drop |
| 1836 | these functions, we'll go with something far more generic and |
| 1837 | useful. |
| 1838 | * upstart/wire.h: Remove prototypes. |
| 1839 | |
Scott James Remnant | 9ee4430 | 2006-12-17 16:37:59 +0000 | [diff] [blame] | 1840 | * upstart/wire.c (upstart_write_int, upstart_read_int): Transmit |
| 1841 | integers as signed 32-bit values in network byte order. |
| 1842 | * upstart/tests/test_wire.c (test_write_int, test_read_int): Test |
| 1843 | the functions to make sure the wire is at it should be, |
| 1844 | |
Scott James Remnant | 5cef53e | 2006-12-17 15:41:13 +0000 | [diff] [blame] | 1845 | * upstart/control.c (upstart_read_int, upstart_write_int) |
| 1846 | (upstart_read_ints, upstart_write_ints, upstart_read_str) |
| 1847 | (upstart_write_str, upstart_read_header, upstart_write_header): Move |
| 1848 | functions to new wire.c file. |
| 1849 | * upstart/wire.c: Source file to hold wire protocol functions. |
| 1850 | * upstart/wire.h: Prototypes. |
| 1851 | * upstart/tests/test_wire.c: (empty) test suite. |
| 1852 | * upstart/libupstart.h: Include wire.h |
| 1853 | * upstart/Makefile.am (libupstart_la_SOURCES): Build and link wire.c |
| 1854 | (upstartinclude_HEADERS): Install wire.h |
| 1855 | (TESTS): Build and run wire test suite. |
| 1856 | (test_wire_SOURCES, test_wire_LDFLAGS, test_wire_LDADD): Details for |
| 1857 | wire test suite binary. |
| 1858 | |
Scott James Remnant | a038523 | 2006-12-17 15:21:39 +0000 | [diff] [blame] | 1859 | * upstart/control.c (MAGIC): Change to "upstart\n", the final |
| 1860 | character was originally \0 and then was a " " for the 0.2 series. |
| 1861 | * upstart/tests/test_control.c (test_recv_msg): Change to match. |
| 1862 | |
Scott James Remnant | fb9412a | 2006-12-15 18:03:22 +0000 | [diff] [blame] | 1863 | 2006-12-15 Scott James Remnant <scott@netsplit.com> |
| 1864 | |
Scott James Remnant | 2e5fe2b | 2006-12-15 18:27:58 +0000 | [diff] [blame] | 1865 | * util/initctl.c, compat/sysv/telinit.c, compat/sysv/shutdown.c: |
| 1866 | Update all uses of the UpstartMsg structure to avoid the |
| 1867 | intermediate union that no longer exists. |
| 1868 | |
Scott James Remnant | fb52146 | 2006-12-15 18:24:57 +0000 | [diff] [blame] | 1869 | * init/control.c, init/tests/test_control.c: Update all uses of |
| 1870 | the UpstartMsg structure to avoid the intermediate union that no |
| 1871 | longer exists. |
| 1872 | |
Scott James Remnant | 99b9766 | 2006-12-15 18:15:22 +0000 | [diff] [blame] | 1873 | * upstart/control.h: Combine all the previous message structures |
| 1874 | into just one that has all of the fields anyway. |
| 1875 | * upstart/control.c, upstart/tests/test_control.c: Update all uses of |
| 1876 | the UpstartMsg structure to avoid the intermediate union that no |
| 1877 | longer exists. |
| 1878 | |
Scott James Remnant | d452ab1 | 2006-12-15 18:05:23 +0000 | [diff] [blame] | 1879 | * upstart/control.h (UPSTART_API_VERSION): Define API version macro |
| 1880 | to be public. |
| 1881 | * upstart/control.c (MSG_VERSION, upstart_send_msg_to): Replacing the |
| 1882 | previous MSG_VERSION macro here. |
| 1883 | |
Scott James Remnant | fb9412a | 2006-12-15 18:03:22 +0000 | [diff] [blame] | 1884 | * upstart/control.c (upstart_read_int, upstart_write_int) |
| 1885 | (upstart_read_ints, upstart_write_ints, upstart_read_str) |
| 1886 | (upstart_write_str, upstart_read_header, upstart_write_header): |
| 1887 | New functions to replace the old "write a struct" protocol with |
| 1888 | something a little more regimented and supportable. |
| 1889 | (IOVEC_ADD, IOVEC_READ, WireHdr, WireJobPayload, WireJobStatusPayload) |
| 1890 | (WireEventPayload): Remove these structures, use the functions |
| 1891 | instead. |
| 1892 | (upstart_send_msg_to): Call write functions intead of using macros, |
| 1893 | this makes the code somewhat neater. |
| 1894 | (upstart_recv_msg): Call read functions instead of using macros, |
| 1895 | again making the code somewhat neater. |
| 1896 | * upstart/tests/test_control.c (test_recv_msg): Change wire |
| 1897 | tests to match new protocol, and thus actually work properly, |
| 1898 | previously these were endian sensitive. |
| 1899 | |
Scott James Remnant | 27ebd79 | 2006-12-14 11:37:14 +0000 | [diff] [blame] | 1900 | 2006-12-14 Scott James Remnant <scott@netsplit.com> |
| 1901 | |
Scott James Remnant | 136dc6f | 2006-12-14 12:36:43 +0000 | [diff] [blame] | 1902 | * compat/sysv/shutdown.c (wall): Construct the wall message so that |
| 1903 | we don't put \r into a po file; for some reason, gettext hates that |
| 1904 | and bitches about it. Someone's confusing internationalisation with |
| 1905 | operating system portability, I expect. |
| 1906 | |
Scott James Remnant | f334f84 | 2006-12-14 11:46:14 +0000 | [diff] [blame] | 1907 | * util/man/initctl.8: Drop reference to start(8), as that's just |
| 1908 | a symlink to initctl now. |
| 1909 | |
Scott James Remnant | 8884743 | 2006-12-14 11:44:36 +0000 | [diff] [blame] | 1910 | * init/man/init.8: Link to initctl. |
| 1911 | |
Scott James Remnant | f6b237a | 2006-12-14 11:40:49 +0000 | [diff] [blame] | 1912 | * compat/sysv/reboot.c (main): Clear up help text a little. |
| 1913 | |
Scott James Remnant | 3b4b227 | 2006-12-14 11:39:05 +0000 | [diff] [blame] | 1914 | * HACKING: Correct some typos. |
| 1915 | |
Scott James Remnant | 27ebd79 | 2006-12-14 11:37:14 +0000 | [diff] [blame] | 1916 | * configure.ac (AC_INIT): Correct bug reporting address. |
| 1917 | |
Scott James Remnant | 1d8763a | 2006-12-13 17:49:38 +0000 | [diff] [blame] | 1918 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 1919 | |
Scott James Remnant | ecec0fe | 2006-12-13 21:55:28 +0000 | [diff] [blame] | 1920 | * configure.ac: Bump version to 0.3.2 |
| 1921 | |
Scott James Remnant | f642ffa | 2006-12-13 18:24:22 +0000 | [diff] [blame] | 1922 | * NEWS: Update. |
| 1923 | |
Scott James Remnant | 1d8763a | 2006-12-13 17:49:38 +0000 | [diff] [blame] | 1924 | * util/initctl.c (print_job_status): Drop the newline from the |
| 1925 | output. |
| 1926 | |
Scott James Remnant | 567cbdc | 2006-12-13 17:07:58 +0000 | [diff] [blame] | 1927 | 2006-12-13 Alex Smith <alex@alex-smith.me.uk> |
| 1928 | |
| 1929 | * util/initctl.c (print_job_status): Clean up initctl job status |
| 1930 | output, which was badly converted from printf to nih_message. |
| 1931 | |
Scott James Remnant | e2cf639 | 2006-12-13 17:02:20 +0000 | [diff] [blame] | 1932 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 1933 | |
| 1934 | * compat/sysv/man/shutdown.8: Add missing documentation on the |
| 1935 | format of TIME by copying it from --help output. |
| 1936 | |
Scott James Remnant | fec9056 | 2006-12-13 17:00:40 +0000 | [diff] [blame] | 1937 | 2006-12-13 Alex Smith <alex@alex-smith.me.uk> |
| 1938 | |
| 1939 | * init/process.c (process_setup_console): Actually send output to |
| 1940 | /dev/null instead of /dev/console, when CONSOLE_NONE. |
| 1941 | |
Scott James Remnant | f233c9d | 2006-12-13 16:45:35 +0000 | [diff] [blame] | 1942 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 1943 | |
Scott James Remnant | fbf7a5c | 2006-12-13 16:54:42 +0000 | [diff] [blame] | 1944 | * Makefile.am (EXTRA_DIST): Distribute the nih ChangeLog as well. |
| 1945 | |
Scott James Remnant | f233c9d | 2006-12-13 16:45:35 +0000 | [diff] [blame] | 1946 | * init/tests/test_job.c: Port to the new test framework. |
| 1947 | * init/job.c (job_set_idle_event): Fix a slight memory leak, |
| 1948 | repeated setting of the idle event never freed the previous one set. |
| 1949 | |
Scott James Remnant | 1abced4 | 2006-12-12 11:28:49 +0000 | [diff] [blame] | 1950 | 2006-12-12 Scott James Remnant <scott@netsplit.com> |
| 1951 | |
Scott James Remnant | fbad50c | 2006-12-12 18:47:43 +0000 | [diff] [blame] | 1952 | * init/tests/test_cfgfile.c: Port to the new test framework. |
| 1953 | |
Scott James Remnant | ef37223 | 2006-12-12 17:23:05 +0000 | [diff] [blame] | 1954 | * init/tests/test_control.c: Port to the new test framework. |
| 1955 | * init/init.supp: Suppress the list head allocated within control_init. |
| 1956 | |
Scott James Remnant | 2c2e01a | 2006-12-12 17:22:40 +0000 | [diff] [blame] | 1957 | * init/control.c (control_watcher): Need to save the pid when we |
| 1958 | get ECONNREFUSED, otherwise we lose it when we free the message. |
| 1959 | |
Scott James Remnant | 40f7d91 | 2006-12-12 15:31:35 +0000 | [diff] [blame] | 1960 | * init/tests/test_process.c: Port to the new test framework. |
| 1961 | * init/init.supp: Suppress the list head allocated within job_init. |
| 1962 | |
Scott James Remnant | fc45659 | 2006-12-12 14:09:45 +0000 | [diff] [blame] | 1963 | * init/init.supp: Include a valgrind suppressions file. |
| 1964 | * init/Makefile.am (EXTRA_DIST): Distribute the suppressions file. |
| 1965 | |
Scott James Remnant | 96c9b07 | 2006-12-12 14:07:30 +0000 | [diff] [blame] | 1966 | * init/tests/test_event.c: Port to the new test framework. |
| 1967 | |
Scott James Remnant | 237c7f6 | 2006-12-12 13:49:19 +0000 | [diff] [blame] | 1968 | * logd/Makefile.am, util/Makefile.am, compat/sys/Makefile.am |
| 1969 | (AM_CPPFLAGS): Add -I$(srcdir), necessary for testing "programs" |
| 1970 | that don't have usual library path semantics. |
| 1971 | |
Scott James Remnant | 2a35ab9 | 2006-12-12 13:23:10 +0000 | [diff] [blame] | 1972 | * upstart/tests/test_control.c: Port to the new test framework. |
| 1973 | * upstart/control.c (upstart_free): Drop this function, while not |
| 1974 | exposing libnih is a valiant effort, it already slips out because |
| 1975 | of the error handling. |
| 1976 | |
Scott James Remnant | 905dd27 | 2006-12-12 12:38:34 +0000 | [diff] [blame] | 1977 | * upstart/tests/test_job.c: Add missing include. |
| 1978 | |
Scott James Remnant | e77567f | 2006-12-12 12:25:46 +0000 | [diff] [blame] | 1979 | * upstart/tests/test_job.c: Port to the new test framework. |
| 1980 | (test_process_state_name): Check that this returns NULL. |
| 1981 | |
Scott James Remnant | b798306 | 2006-12-12 11:34:49 +0000 | [diff] [blame] | 1982 | * HACKING: Update location of download directory. Document |
| 1983 | requirement that all code have test cases. |
| 1984 | |
Scott James Remnant | 0c577ce | 2006-12-12 11:31:13 +0000 | [diff] [blame] | 1985 | * logd/main.c (open_logging): Likewise. |
| 1986 | |
Scott James Remnant | c654baf | 2006-12-12 11:30:44 +0000 | [diff] [blame] | 1987 | * init/control.c (control_open): No need to set ENOMEM, errno is |
| 1988 | always set anyway. |
| 1989 | |
Scott James Remnant | 1abced4 | 2006-12-12 11:28:49 +0000 | [diff] [blame] | 1990 | * configure.ac (AM_INIT_AUTOMAKE): Include nostdinc so we don't get |
| 1991 | Automake's broken default includes. |
| 1992 | * upstart/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 1993 | we don't need it. |
| 1994 | (DEFS, INCLUDES): Replace these variables with the combined |
| 1995 | (AM_CPPFLAGS): variable that declares everything. |
| 1996 | * init/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 1997 | we don't need it. |
| 1998 | (DEFS, INCLUDES): Replace these variables with the combined |
| 1999 | (AM_CPPFLAGS): variable that declares everything. |
| 2000 | * util/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 2001 | we don't need it. |
| 2002 | (DEFS, INCLUDES): Replace these variables with the combined |
| 2003 | (AM_CPPFLAGS): variable that declares everything. |
| 2004 | * compat/sysv/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 2005 | we don't need it. |
| 2006 | (DEFS, INCLUDES): Replace these variables with the combined |
| 2007 | (AM_CPPFLAGS): variable that declares everything. |
| 2008 | * logd/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 2009 | we don't need it. |
| 2010 | (DEFS, INCLUDES): Replace these variables with the combined |
| 2011 | (AM_CPPFLAGS): variable that declares everything. |
| 2012 | |
Scott James Remnant | acec3b2 | 2006-11-02 16:36:53 +0000 | [diff] [blame] | 2013 | 2006-11-02 Scott James Remnant <scott@netsplit.com> |
| 2014 | |
| 2015 | * util/initctl.c (start_action): Remove break calls which shouldn't |
| 2016 | be there. |
| 2017 | |
Scott James Remnant | ea806b7 | 2006-10-18 15:01:00 +0100 | [diff] [blame] | 2018 | 2006-10-18 Sean E. Russell <ser@ser1.net> |
| 2019 | |
| 2020 | * init/main.c: Include sys/time.h |
| 2021 | * init/cfgfile.c: Include sys/time.h and sys/resource.h |
| 2022 | * init/job.c: Include sys/time.h and sys/resource.h |
| 2023 | |
Scott James Remnant | 6702ac1 | 2006-10-17 18:55:24 +0100 | [diff] [blame] | 2024 | 2006-10-17 Scott James Remnant <scott@netsplit.com> |
| 2025 | |
Scott James Remnant | d5758f4 | 2006-10-17 19:21:25 +0100 | [diff] [blame] | 2026 | * configure.ac: Bump version to 0.3.1 |
| 2027 | |
Scott James Remnant | fd029da | 2006-10-17 19:21:07 +0100 | [diff] [blame] | 2028 | * NEWS: Update. |
| 2029 | * TODO: Update. |
| 2030 | |
Scott James Remnant | 9f67cb8 | 2006-10-17 19:12:28 +0100 | [diff] [blame] | 2031 | * configure.ac (AM_GNU_GETTEXT_VERSION): Quote version number. |
| 2032 | |
Scott James Remnant | 4ebe87f | 2006-10-17 19:04:40 +0100 | [diff] [blame] | 2033 | * logd/Makefile.am (event.d/logd): Make the event.d sub-directory |
| 2034 | in case we're building outside of the source tree. |
| 2035 | |
Scott James Remnant | 6702ac1 | 2006-10-17 18:55:24 +0100 | [diff] [blame] | 2036 | * compat/sysv/runlevel.c (store): Don't break strict-aliasing rules |
| 2037 | by avoiding dereferencing type-punned pointer. Answers on a |
| 2038 | postcard, please. |
| 2039 | |
Scott James Remnant | 7f13301 | 2006-10-13 12:00:34 +0100 | [diff] [blame] | 2040 | 2006-10-13 Scott James Remnant <scott@netsplit.com> |
| 2041 | |
Scott James Remnant | ecbb2b5 | 2006-10-13 15:18:24 +0100 | [diff] [blame] | 2042 | * util/initctl.c (start_action, emit_action): Add missing \n |
| 2043 | |
Scott James Remnant | 4862298 | 2006-10-13 15:15:50 +0100 | [diff] [blame] | 2044 | * util/initctl.c: Rewrite using nih_command_parser. |
| 2045 | * util/man/initctl.8: Improve. |
| 2046 | |
| 2047 | * util/start.c: Remove, replaced by initctl. |
| 2048 | * util/man/start.8: Remove, replaced by initctl. |
| 2049 | * util/Makefile.am (sbin_PROGRAMS): Drop start, now just a symlink |
| 2050 | to initctl. |
| 2051 | (dist_man_MANS): Drop start.8, now a symlink to initctl.8 |
| 2052 | (install-exec-hook): Make symlinks to initctl, add start |
| 2053 | (install-data-hook): Make symlinks to initctl.8, add start.8 |
| 2054 | |
Scott James Remnant | b1d8a7d | 2006-10-13 13:57:31 +0100 | [diff] [blame] | 2055 | * initctl: Rename to util again, I don't want a separate directory |
| 2056 | for every single little tool; and we'll be shipping more than just |
| 2057 | initctl (e.g. a non-compat reboot). |
| 2058 | * configure.ac (AC_CONFIG_FILES): Make util/Makefile instead of |
| 2059 | initctl/Makefile. |
| 2060 | * Makefile.am (SUBDIRS): Descend into util, not initctl. |
| 2061 | |
Scott James Remnant | a48b4fe | 2006-10-13 13:49:46 +0100 | [diff] [blame] | 2062 | * compat/sysv/reboot.c: Remove long options where they didn't exist |
| 2063 | before. Write help text. |
| 2064 | * compat/sysv/man/reboot.8: Update. |
| 2065 | |
Scott James Remnant | 462734c | 2006-10-13 13:36:00 +0100 | [diff] [blame] | 2066 | * init/main.c (main): Formatting. |
| 2067 | * logd/main.c (main): Formatting. |
| 2068 | * logd/man/logd.8: Formatting. |
| 2069 | * compat/sysv/runlevel.c (main): Formatting. |
| 2070 | * compat/sysv/telinit.c (main): Formatting. |
| 2071 | * compat/sysv/man/shutdown.8: Remove long options. |
| 2072 | |
Scott James Remnant | eff01f1 | 2006-10-13 13:32:12 +0100 | [diff] [blame] | 2073 | * compat/sysv/shutdown.c: Remove -e/--event, it has no place in a |
| 2074 | compatibility tool. Get rid of long options that never existed |
| 2075 | before. Specify help text to describe the options. |
| 2076 | * compat/sysv/man/shutdown.8: Spruce up a bit. |
| 2077 | |
Scott James Remnant | 4a5cd21 | 2006-10-13 12:59:15 +0100 | [diff] [blame] | 2078 | * compat/sysv/telinit.c (main): Set help text to list the valid |
| 2079 | runlevels. |
| 2080 | * compat/sysv/man/telinit.8: Refine the notes to mention runlevel(8). |
| 2081 | |
Scott James Remnant | f781962 | 2006-10-13 12:54:43 +0100 | [diff] [blame] | 2082 | * compat/sysv/runlevel.c (main): Make the help text describe the |
| 2083 | options, rather than the behaviour. |
Scott James Remnant | 4a5cd21 | 2006-10-13 12:59:15 +0100 | [diff] [blame] | 2084 | * compat/sysv/man/runlevel.8: Flesh out a little more. |
Scott James Remnant | f781962 | 2006-10-13 12:54:43 +0100 | [diff] [blame] | 2085 | |
Scott James Remnant | 930e25a | 2006-10-13 12:28:05 +0100 | [diff] [blame] | 2086 | * configure.ac (AC_INIT): Change bug reporting address to the |
| 2087 | mailing list, since Launchpad doesn't accept random bugs without |
| 2088 | accounts and complicated control messages. |
| 2089 | * init/main.c, logd/main.c: Add a period to the synopsis. |
| 2090 | |
Scott James Remnant | a6ed7eb | 2006-10-13 12:14:45 +0100 | [diff] [blame] | 2091 | * init/main.c (main): Set the synopsis, and direct people to look |
| 2092 | at telinit in the --help output. |
| 2093 | * init/man/init.8: Flesh this out a little more, still a lot of |
| 2094 | explaining to do about jobs and events, but we'll wait until we've |
| 2095 | changed that code before documentating the behaviour. |
| 2096 | |
Scott James Remnant | 7f13301 | 2006-10-13 12:00:34 +0100 | [diff] [blame] | 2097 | * logd/main.c (main): Correct help text to describe the options, |
| 2098 | rather than what the program does. As per standard style. |
| 2099 | Don't become a daemon until the logging socket is open, and make |
| 2100 | that exclusive with waiting for SIGCONT. |
| 2101 | * logd/man/logd.8: Write some more extensive documentation, |
| 2102 | including describing the startup interlock and the socket protocol. |
| 2103 | * TODO: Plan to get rid of the signal interlock from logd. |
| 2104 | |
Scott James Remnant | 8985dd3 | 2006-10-12 15:26:29 +0100 | [diff] [blame] | 2105 | 2006-10-12 Scott James Remnant <scott@netsplit.com> |
| 2106 | |
| 2107 | * configure.ac: Expand AC_GNU_SOURCE so we get _GNU_SOURCE and so |
| 2108 | that gettext doesn't complain. |
| 2109 | (AM_GNU_GETTEXT_VERSION): Increase to 0.15 |
| 2110 | (AC_PREREQ): Increase to 2.60 |
| 2111 | * HACKING: Update autoconf and gettext requirements. |
| 2112 | |
Scott James Remnant | c16a9b4 | 2006-10-11 17:08:58 +0100 | [diff] [blame] | 2113 | 2006-10-11 Scott James Remnant <scott@netsplit.com> |
| 2114 | |
Scott James Remnant | 74a1144 | 2006-10-11 17:58:56 +0100 | [diff] [blame] | 2115 | * init/control.c (control_init): Pass NULL to nih_list_new. |
| 2116 | Clarify list item types. |
| 2117 | * init/event.c (event_init): Pass NULL to nih_list_new. |
| 2118 | * init/job.c (job_init): Pass NULL to nih_list_new. |
| 2119 | |
Scott James Remnant | c34c4be | 2006-10-11 17:56:34 +0100 | [diff] [blame] | 2120 | * init/main.c: Change nih_signal_add_callback to nih_signal_add_handler |
| 2121 | and NihSignalCb to NihSignalHandler. |
| 2122 | |
Scott James Remnant | 8b22740 | 2006-10-11 17:55:27 +0100 | [diff] [blame] | 2123 | * init/cfgfile.c, init/cfgfile.h, init/control.c, init/control.h, |
| 2124 | init/event.c, init/event.h, init/job.c, init/job.h, init/main.c, |
| 2125 | init/process.c: Clean up documentation strings and parent pointer |
| 2126 | types. |
| 2127 | |
Scott James Remnant | d033c86 | 2006-10-11 17:41:22 +0100 | [diff] [blame] | 2128 | * compat/sysv/shutdown.c: Change nih_signal_add_callback to |
| 2129 | nih_signal_add_handler. |
| 2130 | |
Scott James Remnant | 1ee0f48 | 2006-10-11 17:40:41 +0100 | [diff] [blame] | 2131 | * compat/sysv/reboot.c: Set synopsis text depending on command |
| 2132 | used (probably should use nih_command_parser?) |
| 2133 | * compat/sysv/runlevel.c: Set synopsis and help text, and correct |
| 2134 | usage. |
| 2135 | * compat/sysv/shutdown.c: Set synopsis text. |
| 2136 | * compat/sysv/telinit.c: Set synopsis text. |
| 2137 | |
Scott James Remnant | 3b73464 | 2006-10-11 17:22:33 +0100 | [diff] [blame] | 2138 | * compat/sysv/runlevel.c, compat/sysv/shutdown.c: Clean up |
| 2139 | documentation strings. |
| 2140 | |
Scott James Remnant | c6e4f00 | 2006-10-11 17:22:03 +0100 | [diff] [blame] | 2141 | * logd/main.c: Set synopsis and help text. |
| 2142 | |
Scott James Remnant | 5e31d74 | 2006-10-11 17:16:55 +0100 | [diff] [blame] | 2143 | * logd/main.c: Clean up documentation strings. |
| 2144 | Change nih_signal_add_callback to nih_signal_add_handler. |
| 2145 | |
Scott James Remnant | 4835938 | 2006-10-11 17:13:48 +0100 | [diff] [blame] | 2146 | * upstart/control.c, upstart/control.h, upstart/job.c: Clean up |
| 2147 | documentation strings and correct parent pointer type. |
| 2148 | |
Scott James Remnant | c16a9b4 | 2006-10-11 17:08:58 +0100 | [diff] [blame] | 2149 | * HACKING: Detail function documentation requirement and format. |
| 2150 | |
Scott James Remnant | 59093a8 | 2006-10-10 13:09:58 +0100 | [diff] [blame] | 2151 | 2006-10-10 Scott James Remnant <scott@netsplit.com> |
| 2152 | |
Scott James Remnant | 335947d | 2006-10-11 17:08:34 +0100 | [diff] [blame] | 2153 | * event.d/logd.in: Move to logd/event.d |
| 2154 | * event.d/Makefile.am: Remove |
| 2155 | * logd/Makefile.am: Create the logd job definition and install |
| 2156 | * Makefile.am (SUBDIRS): event.d directory has been removed. |
| 2157 | * configure.ac (AC_CONFIG_FILES): No longer make event.d/Makefile |
| 2158 | |
Scott James Remnant | 59093a8 | 2006-10-10 13:09:58 +0100 | [diff] [blame] | 2159 | * configure.ac: Check for --enable-compat, default to sysv if given |
| 2160 | or no compat if not given. |
| 2161 | * compat/sysv/Makefile.am: Don't build binaries or install manpages |
| 2162 | unless COMPAT_SYSV is defined. |
| 2163 | |
Scott James Remnant | 4515094 | 2006-10-06 16:36:27 +0100 | [diff] [blame] | 2164 | 2006-10-06 Scott James Remnant <scott@netsplit.com> |
| 2165 | |
| 2166 | * doc/upstart-logo.svg: Include the logo Alexandre designed. |
| 2167 | * doc/Makefile.am (EXTRA_DIST): Ship the logo in the tarball. |
| 2168 | * Makefile.am (SUBDIRS): Install under doc |
| 2169 | * configure.ac: Generate doc/Makefile |
| 2170 | * AUTHORS: Ensure he's credited fully. |
| 2171 | |
Scott James Remnant | 10b8c0e | 2006-09-27 21:27:38 +0100 | [diff] [blame] | 2172 | 2006-09-27 Scott James Remnant <scott@netsplit.com> |
| 2173 | |
Scott James Remnant | 44052a3 | 2006-09-28 00:04:32 +0100 | [diff] [blame] | 2174 | * event.d/Makefile.am (do_subst): Eliminate duplicate /s |
| 2175 | |
Scott James Remnant | 5222c40 | 2006-09-27 22:48:48 +0100 | [diff] [blame] | 2176 | * man/init.8: Move to init/man |
| 2177 | * init/Makefile.am: Update to install man page. |
| 2178 | * man/logd.8: Move to logd/man |
| 2179 | * logd/Makefile.am: Update to install man page. |
| 2180 | * man/initctl.8, man/start.8: Move to initctl/man |
| 2181 | * initctl/Makefile.am: Update to install man pages. |
| 2182 | * man/reboot.8, man/runlevel.8, man/shutdown.8, man/telinit.8: |
| 2183 | Move to compat/sysv/man |
| 2184 | * compat/sysv/Makefile.am: Update to install man pages. |
| 2185 | * man/Makefile.am: Remove |
| 2186 | * configure.ac (AC_CONFIG_FILES): Remove man/Makefile |
| 2187 | * Makefile.am (SUBDIRS): Don't build in man |
| 2188 | |
Scott James Remnant | 545cb8c | 2006-09-27 21:32:49 +0100 | [diff] [blame] | 2189 | * util: Rename to initctl |
| 2190 | * configure.ac (AC_CONFIG_FILES): Update. |
| 2191 | * Makefile.am (SUBDIRS): Update. |
| 2192 | |
Scott James Remnant | 960c82d | 2006-09-27 21:30:42 +0100 | [diff] [blame] | 2193 | * util/reboot.c: Move to compat/sysv |
| 2194 | * util/shutdown.c: Move to compat/sysv |
| 2195 | * util/Makefile.am: Update. |
| 2196 | * compat/sysv/Makefile.am: Update. |
| 2197 | |
Scott James Remnant | 10b8c0e | 2006-09-27 21:27:38 +0100 | [diff] [blame] | 2198 | * configure.ac: Replace macros with single call to NIH_INIT. |
| 2199 | Bump version to 0.3.0 to begin new development cycle. |
| 2200 | |
Scott James Remnant | e559199 | 2006-09-21 05:49:34 +0100 | [diff] [blame] | 2201 | 2006-09-21 Scott James Remnant <scott@netsplit.com> |
| 2202 | |
| 2203 | * logd/main.c: Revert the change that logged to the console, in |
| 2204 | practice this doesn't work so well. I want to get rid of logd |
| 2205 | in the long term, or at least just have it as a simple logging |
| 2206 | proxy, so giving it features seems wrong. |
| 2207 | |
Scott James Remnant | 9b58b84 | 2006-09-20 05:37:47 +0100 | [diff] [blame] | 2208 | 2006-09-20 Scott James Remnant <scott@netsplit.com> |
| 2209 | |
Scott James Remnant | 97f08fa | 2006-09-20 06:34:12 +0100 | [diff] [blame] | 2210 | * configure.ac: Bump version to 0.2.8 |
| 2211 | * NEWS: Updated. |
| 2212 | |
Scott James Remnant | e59c71e | 2006-09-20 06:14:32 +0100 | [diff] [blame] | 2213 | * logd/main.c (main): Check the kernel command-line for "quiet" |
| 2214 | (line_reader): Write to console unless silent or a daemon |
| 2215 | |
Scott James Remnant | 9b58b84 | 2006-09-20 05:37:47 +0100 | [diff] [blame] | 2216 | * man/Makefile.am (dist_man_MANS): Drop sulogin.8 |
| 2217 | * man/sulogin.8: Drop, we don't include an sulogin |
| 2218 | |
Scott James Remnant | 0fafba4 | 2006-09-20 01:36:29 +0100 | [diff] [blame] | 2219 | 2006-09-19 Michael Biebl <mbiebl@gmail.com> |
| 2220 | |
| 2221 | * event.d/Makefile.am (logd): Drop $(srcdir) |
| 2222 | * init/Makefile.am (init_SOURCES): Distribute paths.h |
| 2223 | |
Scott James Remnant | 58f165f | 2006-09-18 19:43:07 +0100 | [diff] [blame] | 2224 | 2006-09-18 Michael Biebl <mbiebl@gmail.com> |
| 2225 | |
| 2226 | * configure.ac: Check for sys/inotify.h |
| 2227 | |
Scott James Remnant | e371cab | 2006-09-18 16:16:00 +0100 | [diff] [blame] | 2228 | 2006-09-18 Scott James Remnant <scott@netsplit.com> |
| 2229 | |
| 2230 | * util/shutdown.c (warning_message): Adjust method of constructing |
| 2231 | the message to not confuse poor translators who think \r and \n are |
| 2232 | the same thing! |
| 2233 | |
Scott James Remnant | f2b1c05 | 2006-09-14 10:34:45 +0100 | [diff] [blame] | 2234 | 2006-09-14 Scott James Remnant <scott@netsplit.com> |
| 2235 | |
Scott James Remnant | b2e03d0 | 2006-09-14 11:20:13 +0100 | [diff] [blame] | 2236 | * init/job.c (job_change_state): Catch runaway respawns when we |
| 2237 | enter the running state, so we catch stop/start loops too. |
| 2238 | * init/tests/test_job.c (test_change_state): Update test. |
| 2239 | |
Scott James Remnant | b7714f7 | 2006-09-14 11:07:38 +0100 | [diff] [blame] | 2240 | * event.d/logd: Rename to logd.in |
| 2241 | * event.d/logd.in: Replace /sbin with @sbindir@ so we can transform |
| 2242 | * event.d/Makefile.am: Generate logd from logd.in |
| 2243 | |
Scott James Remnant | 7e6bdb3 | 2006-09-14 10:57:03 +0100 | [diff] [blame] | 2244 | * util/reboot.c: Don't hardcode the location of /sbin/shutdown |
| 2245 | * util/Makefile.am (DEFS): Use autoconf to seed it |
| 2246 | * util/shutdown.c (sysvinit_shutdown): Don't hardcode the location |
| 2247 | of /dev/initctl |
| 2248 | |
Scott James Remnant | e0d0dd1 | 2006-09-14 10:51:05 +0100 | [diff] [blame] | 2249 | * init/paths.h: Create a new configuration file that can contain |
| 2250 | all of the path definitions, and in particular, allow them to be |
| 2251 | overidden elsewhere. |
| 2252 | * init/Makefile.am (DEFS): Override definitions of CFG_DIR and |
| 2253 | TELINIT using autoconf |
| 2254 | * init/main.c: Include paths.h. Don't hardcode location of telinit |
| 2255 | * init/job.c: Include paths.h |
| 2256 | * init/process.c: Include paths.h |
| 2257 | * init/process.h: Remove definitions from here. |
| 2258 | |
Scott James Remnant | f2b1c05 | 2006-09-14 10:34:45 +0100 | [diff] [blame] | 2259 | * configure.ac: Bump version to 0.2.7 |
| 2260 | |
Scott James Remnant | 0b8f23f | 2006-09-13 16:51:38 +0100 | [diff] [blame] | 2261 | 2006-09-13 Scott James Remnant <scott@netsplit.com> |
| 2262 | |
Scott James Remnant | 948ab87 | 2006-09-14 10:34:34 +0100 | [diff] [blame] | 2263 | * NEWS: Updated. |
| 2264 | |
Scott James Remnant | 0b8f23f | 2006-09-13 16:51:38 +0100 | [diff] [blame] | 2265 | * TODO: More TODO. |
| 2266 | |
Scott James Remnant | 080dd8d | 2006-09-10 12:42:03 +0100 | [diff] [blame] | 2267 | 2006-09-10 Scott James Remnant <scott@netsplit.com> |
| 2268 | |
| 2269 | * util/reboot.c (main): Don't give -H with "halt". |
| 2270 | |
Scott James Remnant | d704286 | 2006-09-09 00:50:10 +0100 | [diff] [blame] | 2271 | 2006-09-09 Scott James Remnant <scott@netsplit.com> |
| 2272 | |
Scott James Remnant | edb9790 | 2006-09-09 05:48:42 +0100 | [diff] [blame] | 2273 | * configure.ac: Bump version to 0.2.6 |
| 2274 | |
Scott James Remnant | 760237e | 2006-09-09 05:38:32 +0100 | [diff] [blame] | 2275 | * NEWS: Update. |
| 2276 | * TODO: Update. |
| 2277 | |
Scott James Remnant | 5e267a4 | 2006-09-09 05:21:28 +0100 | [diff] [blame] | 2278 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Change |
| 2279 | the magic to be the package string. |
| 2280 | * upstart/tests/test_control.c (test_recv_msg): Update tests. |
| 2281 | |
Scott James Remnant | 17fec6e | 2006-09-09 05:05:42 +0100 | [diff] [blame] | 2282 | * util/initctl.c (main): Set the usage string. |
| 2283 | * util/shutdown.c (main): Set the usage string. |
| 2284 | * util/start.c (main): Set the usage string. |
| 2285 | * compat/sysv/runlevel.c (main): Set the usage string. |
| 2286 | * compat/sysv/telinit.c (main): Set the usage string. |
| 2287 | |
Scott James Remnant | abede80 | 2006-09-09 05:01:45 +0100 | [diff] [blame] | 2288 | * man/Makefile.am: Use install-data-hook and $(man8dir) |
| 2289 | * util/Makefile.am: Also use install-exec-hook |
| 2290 | |
Scott James Remnant | c6c2005 | 2006-09-09 04:58:11 +0100 | [diff] [blame] | 2291 | * Makefile.am (SUBDIRS): Install contents of the man directory |
| 2292 | * configure.ac (AC_CONFIG_FILES): Generate man/Makefile |
| 2293 | * man/Makefile.am: Install manpages in the appropriate places. |
| 2294 | * man/init.8, man/logd.8, man/initctl.8, man/reboot.8, |
| 2295 | * man/shutdown.8, man/start.8, man/sulogin.8, man/runlevel.8, |
| 2296 | * man/telinit.8: Include some basic manpages so we at least have |
| 2297 | some level of documentation. |
| 2298 | |
Scott James Remnant | 33e4711 | 2006-09-09 03:45:00 +0100 | [diff] [blame] | 2299 | * init/job.c (job_child_reaper): Don't check the exit status of |
| 2300 | a respawning job if the goal is to stop it. |
| 2301 | |
Scott James Remnant | 1889aa6 | 2006-09-09 03:41:53 +0100 | [diff] [blame] | 2302 | * compat/sysv/telinit.c (main): Generate events rather than |
| 2303 | starting and stopping jobs directly, the events are named |
| 2304 | "runlevel-X". 0, 1, 6 and s/S are shutdown events. |
| 2305 | |
Scott James Remnant | 515b2b9 | 2006-09-09 03:41:27 +0100 | [diff] [blame] | 2306 | * logd/main.c (main): Raise SIGSTOP before entering the main loop. |
| 2307 | * init/main.c (main): Interlock with logd. |
| 2308 | |
Scott James Remnant | 17eb905 | 2006-09-09 03:41:04 +0100 | [diff] [blame] | 2309 | * event.d/logd: Should not be a console owner, but should stop |
| 2310 | on shutdown. |
| 2311 | |
Scott James Remnant | 3475226 | 2006-09-09 01:38:02 +0100 | [diff] [blame] | 2312 | * init/process.c (process_setup_console): Revert part of the previous |
| 2313 | change, should just output to /dev/null if we don't have logd. |
| 2314 | |
Scott James Remnant | e553333 | 2006-09-09 01:36:07 +0100 | [diff] [blame] | 2315 | * configure.ac: Bump version to 0.2.5 |
| 2316 | |
Scott James Remnant | b4a1c2b | 2006-09-09 01:28:26 +0100 | [diff] [blame] | 2317 | * init/main.c (main): Start the logd job if it exists. |
| 2318 | |
| 2319 | * init/process.c (process_setup_console): Ignore ECONNREFUSED as |
| 2320 | that just means that logd isn't around, handle errors by falling |
| 2321 | back to opening the console. |
| 2322 | |
Scott James Remnant | 9fb20d4 | 2006-09-09 01:22:03 +0100 | [diff] [blame] | 2323 | * init/process.c (process_setup_console): Implement handling for |
| 2324 | CONSOLE_LOGGED and generally clean up the other handling. |
| 2325 | * init/process.h: Update. |
| 2326 | * init/main.c (main): Pass NULL for the job to setup console. |
| 2327 | * TODO: Update. |
| 2328 | |
Scott James Remnant | d704286 | 2006-09-09 00:50:10 +0100 | [diff] [blame] | 2329 | * logd/main.c: Implement the logging daemon, it accepts connections |
| 2330 | on a unix stream socket with the abstract name |
| 2331 | "/com/ubuntu/upstart/logd", expects the length of the name and the |
| 2332 | name to follow; then sequences of lines which are logged to |
| 2333 | /var/log/boot, or memory until that file can be opened. |
| 2334 | |
Scott James Remnant | 527b945 | 2006-09-08 17:15:07 +0100 | [diff] [blame] | 2335 | 2006-09-08 Scott James Remnant <scott@netsplit.com> |
| 2336 | |
Scott James Remnant | cb655e7 | 2006-09-08 17:49:20 +0100 | [diff] [blame] | 2337 | * util/shutdown.c (event_setter): Change the event names to |
| 2338 | distinguish between "shutdown -h" and "shutdown -h -H". |
| 2339 | |
Scott James Remnant | 90732d3 | 2006-09-08 17:33:19 +0100 | [diff] [blame] | 2340 | * init/job.c (job_handle_event): Allow jobs to react to their own |
| 2341 | events, this is how we'll do respawn eventually. |
| 2342 | * init/tests/test_job.c (test_handle_event): Remove test. |
| 2343 | |
Scott James Remnant | bb3cc3f | 2006-09-08 17:17:47 +0100 | [diff] [blame] | 2344 | * init/main.c (cad_handler, kbd_handler): Generate the new event |
| 2345 | names. |
| 2346 | * init/event.h (CTRLALTDEL_EVENT, KBDREQUEST_EVENT): Add definitions |
| 2347 | of these event names, change the ctrlaltdel event to just that. |
| 2348 | |
Scott James Remnant | 527b945 | 2006-09-08 17:15:07 +0100 | [diff] [blame] | 2349 | * logd/main.c (main): Add the code to daemonise, etc. |
| 2350 | |
Scott James Remnant | a17917d | 2006-09-07 00:18:28 +0100 | [diff] [blame] | 2351 | 2006-09-07 Scott James Remnant <scott@netsplit.com> |
| 2352 | |
Scott James Remnant | 214ebe8 | 2006-09-07 21:48:55 +0100 | [diff] [blame] | 2353 | * TODO: Long discussion today on #upstart, many improvements to the |
| 2354 | job and event model that make it more elegant. |
| 2355 | * AUTHORS: Include a list of thanks. |
| 2356 | |
Scott James Remnant | b828007 | 2006-09-07 03:19:00 +0100 | [diff] [blame] | 2357 | * util/shutdown.c (shutdown_now): If we get ECONNREFUSED when we |
| 2358 | try and send the shutdown event to init, it probably means we're |
| 2359 | still in sysvinit. So try that instead. |
| 2360 | (sysvinit_shutdown): Function to send a hand-crafted runlevel |
| 2361 | change message across /dev/initctl. |
| 2362 | |
Scott James Remnant | ae96906 | 2006-09-07 00:43:57 +0100 | [diff] [blame] | 2363 | * util/initctl.c (main): Add a shutdown command that takes an |
| 2364 | arbitrary event name to be issued after "shutdown". You'll |
| 2365 | nearly always want the /sbin/shutdown tool instead. |
| 2366 | |
Scott James Remnant | 987bcc4 | 2006-09-07 00:38:24 +0100 | [diff] [blame] | 2367 | * init/job.c (job_detect_idle): Only generate the stalled event |
| 2368 | if at least one job handles it in its start_events list. |
| 2369 | * init/tests/test_job.c (test_detect_idle): Make sure that works. |
| 2370 | |
Scott James Remnant | ea204d4 | 2006-09-07 00:30:53 +0100 | [diff] [blame] | 2371 | * init/event.h (STARTUP_EVENT, SHUTDOWN_EVENT, STALLED_EVENT): |
| 2372 | Macros to define the standard event names. |
| 2373 | * init/main.c (main): Use STARTUP_EVENT macro instead of "startup" |
| 2374 | * init/control.c (control_handle): Use SHUTDOWN_EVENT macro |
| 2375 | instead of "shutdown". |
| 2376 | * init/job.c (job_detect_idle): Use STALLED_EVENT macro instead |
| 2377 | of "stalled". |
| 2378 | |
Scott James Remnant | 84607df | 2006-09-07 00:27:22 +0100 | [diff] [blame] | 2379 | * init/job.c (job_detect_idle): Add some log messages for when we |
| 2380 | detect the idle or stalled states. |
| 2381 | (job_kill_process, job_kill_timer): Increase log verbosity. |
| 2382 | * init/event.c (event_queue_run): Log which events we're handling |
| 2383 | if --debug is given. |
| 2384 | |
Scott James Remnant | a17917d | 2006-09-07 00:18:28 +0100 | [diff] [blame] | 2385 | * compat/sysv/telinit.c (main): Send a shutdown command when |
| 2386 | requesting to enter runlevel 0 or runlevel 6, likewise for |
| 2387 | runlevel 1, s or S which all run "rc1" not "rcS". |
| 2388 | * init/main.c (main): When called directory (pid != 1) try and |
| 2389 | run telinit before complaining that we're not init. Make sure |
| 2390 | errors aren't lost. |
| 2391 | |
Scott James Remnant | f5c376c | 2006-09-04 16:25:04 +0100 | [diff] [blame] | 2392 | 2006-09-04 Johan Kiviniemi <johan@kiviniemi.name> |
Scott James Remnant | edcae30 | 2006-09-04 07:06:23 +0100 | [diff] [blame] | 2393 | |
Scott James Remnant | f5c376c | 2006-09-04 16:25:04 +0100 | [diff] [blame] | 2394 | * upstart/control.c (upstart_addr): Replace use of __builtin_offsetof |
| 2395 | with offsetof. |
| 2396 | * upstart/tests/test_control.c (test_recv_msg): Likewise. |
| 2397 | |
| 2398 | 2006-09-04 Scott James Remnant <scott@netsplit.com> |
| 2399 | |
Scott James Remnant | edcae30 | 2006-09-04 07:06:23 +0100 | [diff] [blame] | 2400 | * util/shutdown.c (main): Exit normally after sending the warning |
| 2401 | message if -k is given. |
| 2402 | |
Scott James Remnant | e94bd20 | 2006-09-01 00:48:36 +0100 | [diff] [blame] | 2403 | 2006-09-01 Scott James Remnant <scott@netsplit.com> |
Scott James Remnant | d4cdaca | 2006-08-31 00:47:11 +0100 | [diff] [blame] | 2404 | |
Scott James Remnant | 294cde7 | 2006-09-01 19:58:35 +0100 | [diff] [blame] | 2405 | * configure.ac: Bump version to 0.2.2 |
| 2406 | |
Scott James Remnant | 7663bfb | 2006-09-01 19:58:19 +0100 | [diff] [blame] | 2407 | * NEWS: Update. |
| 2408 | * configure.ac: Bump version to 0.2.1 |
| 2409 | |
Scott James Remnant | 6798214 | 2006-09-01 19:47:39 +0100 | [diff] [blame] | 2410 | * init/process.c (process_setup_console): Ensure that the console |
| 2411 | is always initialised to at least /dev/null |
| 2412 | * init/job.c (job_change_state): Initialise event to NULL. |
| 2413 | * init/event.c (event_read_state): Don't mask initialisation of |
| 2414 | other variable. |
| 2415 | * init/cfgfile.c (cfg_job_stanza, cfg_parse_script, cfg_next_token): |
| 2416 | Print lineno using %zi not %d |
| 2417 | * compat/sysv/runlevel.c (store): Cast pointer type of timeval. |
| 2418 | |
Scott James Remnant | 097b2a9 | 2006-09-01 19:30:37 +0100 | [diff] [blame] | 2419 | * init/main.c: Move the kernel headers include beneath the C |
| 2420 | library ones, so that compilation doesn't fail on !i386. |
| 2421 | * util/reboot.c: Likewise. |
| 2422 | |
Scott James Remnant | 28fcc92 | 2006-09-01 04:15:57 +0100 | [diff] [blame] | 2423 | * init/main.c (term_handler): Close the control connection if we |
| 2424 | re-exec init, otherwise it won't be able to bind. Drop debugging. |
| 2425 | |
Scott James Remnant | 6f46496 | 2006-09-01 04:10:20 +0100 | [diff] [blame] | 2426 | * init/main.c (term_handler): It always helps if we dup2 the |
| 2427 | right file descriptor. |
| 2428 | |
Scott James Remnant | 1db8804 | 2006-09-01 03:14:19 +0100 | [diff] [blame] | 2429 | * init/main.c: Use the TERM signal instead of USR1, as old init |
| 2430 | used that for something else. Also rather than passing across |
| 2431 | file descriptor numbers, use a fixed descriptor and just pass |
| 2432 | "--restart". When we get that option we need to unmask signals |
| 2433 | otherwise we sit there looking like a lemon. |
| 2434 | |
Scott James Remnant | e7a7326 | 2006-09-01 02:32:27 +0100 | [diff] [blame] | 2435 | * init/job.c (job_change_state): Don't free the event unless we |
| 2436 | generate one. |
| 2437 | |
Scott James Remnant | 12dd725 | 2006-09-01 02:27:04 +0100 | [diff] [blame] | 2438 | * NEWS: Update. |
| 2439 | |
Scott James Remnant | 694172a | 2006-09-01 02:26:45 +0100 | [diff] [blame] | 2440 | * init/cfgfile.c (cfg_watcher): Ignore any file with '.' or '~' |
| 2441 | |
Scott James Remnant | c6e63dd | 2006-09-01 02:16:43 +0100 | [diff] [blame] | 2442 | * TODO: Update. |
| 2443 | |
Scott James Remnant | 3401ab7 | 2006-09-01 02:14:47 +0100 | [diff] [blame] | 2444 | * init/main.c (main): Parse command-line arguments, specifically |
| 2445 | look for --state-fd which we'll use for reexec. Don't do a couple |
| 2446 | of things if we're passed this. |
| 2447 | (read_state): Parse the line-buffered state. |
| 2448 | * init/job.c (job_read_state, job_write_state): Job state |
| 2449 | serialisation so that we can re-exec ourselves. |
| 2450 | * init/job.h: Update. |
| 2451 | * init/tests/test_job.c: Test the serialisation. |
| 2452 | * init/event.c (event_read_state, event_write_state): And similar |
| 2453 | functions for serialising the event queue. |
| 2454 | * init/event.h: Update. |
| 2455 | * init/tests/test_event.c: Test the serialisation. |
| 2456 | * init/cfgfile.c (cfg_read_job): Fix a bug, need to subtract current |
| 2457 | time to get due time. |
| 2458 | |
Scott James Remnant | e94bd20 | 2006-09-01 00:48:36 +0100 | [diff] [blame] | 2459 | * upstart/job.c (job_goal_from_name, job_state_from_name) |
| 2460 | (process_state_from_name): Add opposite numbers that convert a |
| 2461 | string back into an enumeration. |
| 2462 | * upstart/job.h: Update. |
| 2463 | * upstart/tests/test_job.c: Test the new functions. |
| 2464 | |
| 2465 | 2006-08-31 Scott James Remnant <scott@netsplit.com> |
Scott James Remnant | 694172a | 2006-09-01 02:26:45 +0100 | [diff] [blame] | 2466 | |
Scott James Remnant | b7260a7 | 2006-08-31 22:08:56 +0100 | [diff] [blame] | 2467 | * init/job.h (Job): Add respawn_limit, respawn_interval, |
| 2468 | respawn_count and respawn_time members so that we can keep track of |
| 2469 | runaway processes. |
| 2470 | * init/job.c (job_catch_runaway): Increment the respawn_count |
| 2471 | within respawn_interval, or reset it if we go over. |
| 2472 | (job_new): Initialise respawn_limit and respawn_interval to sensible |
| 2473 | defaults. |
| 2474 | * init/tests/test_job.c (test_new): Check the defaults are set. |
| 2475 | (test_change_state): Check the respawning code works. |
| 2476 | * init/cfgfile.c (cfg_job_stanza): Parse the "respawn limit" stanza. |
| 2477 | * init/tests/test_cfgfile.c (test_read_job): Test the new stanza. |
| 2478 | |
Scott James Remnant | ff0d26a | 2006-08-31 20:49:43 +0100 | [diff] [blame] | 2479 | * init/process.c (process_setup_console): Remove the console reset |
| 2480 | code, it tends to just crash X and seems to do nothing interesting. |
| 2481 | * init/main.c (reset_console): Instead put it here and just do it |
| 2482 | on startup. |
| 2483 | |
Scott James Remnant | 25b263a | 2006-08-31 18:59:02 +0100 | [diff] [blame] | 2484 | * configure.ac: Bump version to 0.2.0 |
| 2485 | |
Scott James Remnant | 4b61be9 | 2006-08-31 17:08:44 +0100 | [diff] [blame] | 2486 | * util/Makefile.am (install-exec-local): Create symbolic links, |
| 2487 | not hard links. |
| 2488 | |
Scott James Remnant | af1404f | 2006-08-31 16:04:16 +0100 | [diff] [blame] | 2489 | * init/main.c: Can't catch STOP. |
| 2490 | |
Scott James Remnant | 242b50b | 2006-08-31 15:40:42 +0100 | [diff] [blame] | 2491 | * util/reboot.c: Pause init while shutting down or rebooting. |
| 2492 | |
Scott James Remnant | eabb780 | 2006-08-31 15:39:04 +0100 | [diff] [blame] | 2493 | * init/main.c (stop_handler): Catch STOP/TSTP and CONT. |
| 2494 | * init/event.c (event_queue_run): Don't run the event queue while |
| 2495 | paused. |
| 2496 | * init/job.c (job_detect_idle): Don't detect idle jobs while paused. |
| 2497 | |
Scott James Remnant | 1cd8d86 | 2006-08-31 15:17:16 +0100 | [diff] [blame] | 2498 | * util/reboot.c: if we get the -w argument ("only write to wtmp") |
| 2499 | we need to exit, and not behave as halt normally would. |
| 2500 | |
Scott James Remnant | ff63cf7 | 2006-08-31 04:39:34 +0100 | [diff] [blame] | 2501 | * compat/sysv/runlevel.c (main): Add missing newline. |
| 2502 | * compat/sysv/telinit.c (main): And here too. |
| 2503 | |
Scott James Remnant | 32de922 | 2006-08-31 04:34:27 +0100 | [diff] [blame] | 2504 | * init/main.c (main): Check for idle after the startup event queue |
| 2505 | has been run, otherwise we may just sit there. |
| 2506 | |
Scott James Remnant | 13ffffe | 2006-08-31 04:33:39 +0100 | [diff] [blame] | 2507 | * compat/sysv/Makefile.am (sbin_PROGRAMS): Build and install telinit |
| 2508 | (telinit_SOURCES, telinit_LDFLAGS, telinit_LDADD): Details for |
| 2509 | telinit binary. |
| 2510 | * compat/sysv/telinit.c: Trivial telinit program that just runs |
| 2511 | the appropriate rcX job. |
| 2512 | * compat/sysv/runlevel.c (main): Suggest help on illegal runlevel. |
| 2513 | |
Scott James Remnant | 40f0901 | 2006-08-31 04:21:49 +0100 | [diff] [blame] | 2514 | * util/Makefile.am: Tidy up. |
| 2515 | |
Scott James Remnant | 1247356 | 2006-08-31 04:21:05 +0100 | [diff] [blame] | 2516 | * configure.ac (AC_CONFIG_FILES): Create compat/sysv/Makefile |
| 2517 | * Makefile.am (SUBDIRS): Build things found in compat/sysv |
| 2518 | * compat/sysv/Makefile.am (sbin_PROGRAMS): Build and install runlevel |
| 2519 | (runlevel_SOURCES, runlevel_LDFLAGS, runlevel_LDADD): Details for |
| 2520 | runlevel binary. |
| 2521 | * compat/sysv/runlevel.c: Helper to store and retrieve the current |
| 2522 | "runlevel" from utmp/wtmp; as well as the reboot time. |
| 2523 | |
Scott James Remnant | d909cca | 2006-08-31 04:20:14 +0100 | [diff] [blame] | 2524 | * init/main.c (main): Drop debugging set. |
| 2525 | |
Scott James Remnant | cedd11a | 2006-08-31 02:59:29 +0100 | [diff] [blame] | 2526 | * init/job.c (job_change_state): As well as the job/state events, |
| 2527 | send the job event when a service is running or a task is stopping. |
| 2528 | * init/tests/test_job.c (test_change_state): Check the events get |
| 2529 | sent properly. |
| 2530 | |
Scott James Remnant | 44b684a | 2006-08-31 02:58:45 +0100 | [diff] [blame] | 2531 | * util/start.c: Write a simple utility to start, stop, or query |
| 2532 | the status of the named jobs. |
| 2533 | * util/Makefile.am (sbin_PROGRAMS): Build and install start |
| 2534 | (start_SOURCES, start_LDFLAGS, start_LDADD): Details for start |
| 2535 | (install-exec-local): Also install as stop and status. |
| 2536 | * util/reboot.c (main): Drop the debugging set. |
| 2537 | |
Scott James Remnant | b8ed2d1 | 2006-08-31 02:15:48 +0100 | [diff] [blame] | 2538 | * init/cfgfile.c (cfg_job_stanza): Correct nih_alloc error. |
| 2539 | |
Scott James Remnant | a6125ae | 2006-08-31 02:14:25 +0100 | [diff] [blame] | 2540 | * init/process.c (process_setup_environment): Guard memory alloc. |
| 2541 | * init/job.c (job_set_idle_event): Likewise. |
| 2542 | (job_change_state): And here too. |
| 2543 | (job_run_command): Likewise. |
| 2544 | * init/control.c (control_send): Likewise. |
| 2545 | * init/cfgfile.c: And throughout this file. |
| 2546 | * upstart/control.c (upstart_recv_msg): And once here too. |
| 2547 | |
Scott James Remnant | 0b358ab | 2006-08-31 02:07:32 +0100 | [diff] [blame] | 2548 | * upstart/control.h: Abolish the separate halt, reboot and poweroff |
| 2549 | messages and replace with a single shutdown message that takes |
| 2550 | an event name (for the idle event issued afterwards). |
| 2551 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Handle |
| 2552 | the new shutdown event type by just treating it as an event. |
| 2553 | * upstart/tests/test_control.c (test_messages): Update tests. |
| 2554 | * init/job.c (job_set_idle_event): Store a copy of the idle event |
| 2555 | name. |
| 2556 | * init/control.c (control_send): Copy the shutdown event name. |
| 2557 | (control_handle): Replace individual handling with the new |
| 2558 | single event. |
| 2559 | * init/tests/test_control.c (test_watcher): Update. |
| 2560 | * util/initctl.c: Drop handling for things that shutdown does now. |
| 2561 | * util/shutdown.c: Send the UPSTART_SHUTDOWN event and let the user |
| 2562 | specify anything they want, just give defaults. |
| 2563 | |
Scott James Remnant | ff5efb9 | 2006-08-31 01:45:19 +0100 | [diff] [blame] | 2564 | This is quite a big change and abolishes level events entirely, |
| 2565 | along with the event history. We now just treat events as a |
| 2566 | transient queue of strings that go past, may cause things to change, |
| 2567 | but are otherwise forgotten. This turns out to be much easier to |
| 2568 | understand and has no real loss of power. |
| 2569 | |
| 2570 | * init/event.c: Vastly simplify; gone are the separate notions of |
| 2571 | edge and level events, instead we just treat them as one-shot |
| 2572 | things that go past and are forgotten about. |
| 2573 | * init/event.h (Event): Remove value member. |
| 2574 | Update prototypes. |
| 2575 | * init/tests/test_event.c: Update. |
| 2576 | * init/job.c (job_change_state): Change the event pattern to be |
| 2577 | one that includes the job name and a description of the transition |
| 2578 | instead of the new state. |
| 2579 | (job_detect_idle): Call event_queue rather than event_queue_edge. |
| 2580 | * init/tests/test_job.c: Update. |
| 2581 | * init/cfgfile.c (cfg_job_stanza): Drop "when" and "while". |
| 2582 | * init/tests/test_cfgfile.c (test_read_job): Drop mentions of |
| 2583 | "when" and "while". |
| 2584 | * init/control.c (control_send, control_handle): Drop cases for |
| 2585 | level events. |
| 2586 | (control_handle_event): Don't include a level in the event. |
| 2587 | * init/tests/test_control.c: Update |
| 2588 | * init/main.c: Call event_queue rather than event_queue_edge. |
| 2589 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Change |
| 2590 | event handling so that only a name is read. |
| 2591 | * upstart/control.h: Remove value/level event structures. |
| 2592 | * upstart/tests/test_control.c (test_messages): Update. |
| 2593 | * upstart/job.c (process_state_name): Not used for events, adjust |
| 2594 | documentation so it doesn't lie. |
| 2595 | * util/initctl.c (main): Drop the set function, simplify trigger. |
| 2596 | * util/shutdown.c (shutdown_now): Call UPSTART_EVENT_QUEUE for |
| 2597 | shutdown into maintenance mode. |
| 2598 | |
Scott James Remnant | fcbee2d | 2006-08-31 00:49:36 +0100 | [diff] [blame] | 2599 | * init/control.c (control_handle): Place a message in the syslog |
| 2600 | before halting, powering off or rebooting. |
| 2601 | |
Scott James Remnant | d4cdaca | 2006-08-31 00:47:11 +0100 | [diff] [blame] | 2602 | * util/shutdown.c: Adjust so that the warning message is sent out |
| 2603 | if shutdown is immediate, and when it actually happens. Include |
| 2604 | the hostname as wall does. |
| 2605 | |
Scott James Remnant | 255c5f2 | 2006-08-30 16:05:01 +0100 | [diff] [blame] | 2606 | 2006-08-30 Scott James Remnant <scott@netsplit.com> |
| 2607 | |
Scott James Remnant | 5be5566 | 2006-08-30 19:13:25 +0100 | [diff] [blame] | 2608 | * TODO: Update. |
| 2609 | |
Scott James Remnant | 4a9245f | 2006-08-30 19:13:00 +0100 | [diff] [blame] | 2610 | * util/shutdown.c: Implement shutdown utility along the same lines |
| 2611 | as the sysvinit one, but with rather different code. |
| 2612 | |
Scott James Remnant | 2a71aaa | 2006-08-30 16:34:06 +0100 | [diff] [blame] | 2613 | * util/initctl.c (main): Call setuid on the effective user id so |
| 2614 | that we can be made setuid root and executable by a special group. |
| 2615 | * util/reboot.c (main): Likewise. |
| 2616 | |
Scott James Remnant | 70cc229 | 2006-08-30 16:06:03 +0100 | [diff] [blame] | 2617 | * util/initctl.c (main): Check the effective rather than the real |
| 2618 | user id, if we're effectively root, that's good enough. |
| 2619 | |
Scott James Remnant | 255c5f2 | 2006-08-30 16:05:01 +0100 | [diff] [blame] | 2620 | * util/reboot.c: Implement reboot/halt/poweroff utility. |
| 2621 | * util/Makefile.am (sbin_PROGRAMS): Build and install reboot |
| 2622 | (reboot_SOURCES, reboot_LDFLAGS, reboot_LDADD): Details for reboot |
| 2623 | (install-exec-local): Create hardlinks to reboot for halt and poweroff. |
| 2624 | |
Scott James Remnant | dc8877d | 2006-08-29 16:56:48 +0100 | [diff] [blame] | 2625 | 2006-08-29 Scott James Remnant <scott@netsplit.com> |
| 2626 | |
| 2627 | * init/main.c (main): Actually run the idle-detect function. |
| 2628 | * init/job.c (job_detect_idle): Interrupt the main loop, otherwise |
| 2629 | we may end up waiting for a signal before we process the event |
| 2630 | we just issued. |
| 2631 | |
Scott James Remnant | f43bdf3 | 2006-08-27 18:20:29 +0100 | [diff] [blame] | 2632 | 2006-08-27 Scott James Remnant <scott@netsplit.com> |
| 2633 | |
Scott James Remnant | 4715848 | 2006-08-27 22:37:10 +0100 | [diff] [blame] | 2634 | * util/shutdown.c: Template main function. |
| 2635 | * util/Makefile.am (sbin_PROGRAMS): Build and install the |
| 2636 | shutdown binary. |
| 2637 | (shutdown_SOURCES, shutdown_LDFLAGS, shutdown_LDADD): Details for |
| 2638 | the shutdown binary |
| 2639 | |
Scott James Remnant | 70a6ec6 | 2006-08-27 22:23:50 +0100 | [diff] [blame] | 2640 | * util/initctl.c (main): Add commands for halt, poweroff and reboot. |
| 2641 | |
Scott James Remnant | 0c7e72a | 2006-08-27 22:22:53 +0100 | [diff] [blame] | 2642 | * init/event.c (event_queue_run): Remove the parameters. |
| 2643 | * init/event.h: Update. |
| 2644 | * init/main.c (main): Update. |
| 2645 | * init/tests/test_control.c (test_watcher): Update. |
| 2646 | * init/tests/test_job.c (test_detect_idle): Update. |
| 2647 | |
Scott James Remnant | 96ae9e4 | 2006-08-27 22:15:34 +0100 | [diff] [blame] | 2648 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Deal |
| 2649 | with halting, rebooting and powering off; or at least the appropriate |
| 2650 | messages. |
| 2651 | * upstart/control.h: Add control message structures for halting, |
| 2652 | powering off and rebooting the machine. |
| 2653 | * upstart/tests/test_control.c (test_messages): Run the tests. |
| 2654 | * init/control.c (control_handle): Add handling for halt, power off |
| 2655 | and reboot that issue the shutdown event and arrange for the halt, |
| 2656 | poweroff or reboot to be issued the next time the system is idle. |
| 2657 | * init/tests/test_control.c (test_watcher): Test the events. |
| 2658 | |
Scott James Remnant | 01a3708 | 2006-08-27 21:51:00 +0100 | [diff] [blame] | 2659 | * TODO: Update. |
| 2660 | |
Scott James Remnant | e02892b | 2006-08-27 21:49:44 +0100 | [diff] [blame] | 2661 | * init/job.c (job_detect_idle): Function to detect when the system is |
| 2662 | stalled or idle. |
| 2663 | * init/job.h: Update |
| 2664 | * init/tests/test_job.c (test_detect_idle): Test the new function. |
| 2665 | |
Scott James Remnant | 6a8508c | 2006-08-27 19:10:44 +0100 | [diff] [blame] | 2666 | * util/initctl.c (main): Handle the list command. |
| 2667 | |
Scott James Remnant | a9476ad | 2006-08-27 19:07:23 +0100 | [diff] [blame] | 2668 | * TODO: Update. |
| 2669 | |
Scott James Remnant | 4da474d | 2006-08-27 19:06:35 +0100 | [diff] [blame] | 2670 | * upstart/control.c (WireJobStatusPayload): add description to the |
| 2671 | job status payload. |
| 2672 | (upstart_send_msg_to, upstart_recv_msg): Send and receieve the |
| 2673 | description over the wire. |
| 2674 | * upstart/control.h (UpstartJobStatusMsg): add a description field |
| 2675 | * upstart/tests/test_control.c: Update test cases. |
| 2676 | * init/control.c (control_handle): Include the job description in |
| 2677 | the message. |
| 2678 | (control_send): Copy the description when we put the message on |
| 2679 | the queue. |
| 2680 | (control_handle_job): Copy the description here too |
| 2681 | * init/tests/test_control.c: Update test cases. |
| 2682 | |
Scott James Remnant | 84f5e93 | 2006-08-27 18:49:25 +0100 | [diff] [blame] | 2683 | * init/job.c (job_list): Add a function to return the job list. |
| 2684 | * init/job.h: Update. |
| 2685 | * init/control.c (control_handle): Handle the JOB_LIST message |
| 2686 | by sending back a list of job status messages followed by the |
| 2687 | JOB_LIST_END message. |
| 2688 | * init/tests/test_control.c (test_watcher_child): Check the |
| 2689 | JOB_LIST message works properly. |
| 2690 | |
Scott James Remnant | f4ad6d1 | 2006-08-27 18:40:01 +0100 | [diff] [blame] | 2691 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Handle |
| 2692 | the JOB_LIST and JOB_LIST_END messages which have no payload. |
| 2693 | * upstart/control.h: Add enums and structures for job list messages. |
| 2694 | * upstart/tests/test_control.c (test_messages): Update tests. |
| 2695 | |
Scott James Remnant | f497081 | 2006-08-27 18:27:19 +0100 | [diff] [blame] | 2696 | * init/main.c (main): Check that we're both uid and process #1 |
| 2697 | |
Scott James Remnant | f43bdf3 | 2006-08-27 18:20:29 +0100 | [diff] [blame] | 2698 | * init/main.c (main): Stop handling SIGTERM, we never want people |
| 2699 | to kill init. Handle SIGINT and SIGWINCH through the ordinary |
| 2700 | handler and SIGSEGV through a direct handler. |
| 2701 | (segv_handler): Write a sensible core dump handler, we use a child |
| 2702 | to dump core while we carry on in the parent hopefully stepping over |
| 2703 | the bad instruction. |
| 2704 | (cad_handler): Generate the control-alt-delete event. |
| 2705 | (kbd_handler): Generate the kbdrequest event. |
| 2706 | |
Scott James Remnant | 33e64d0 | 2006-08-25 14:44:32 +0200 | [diff] [blame] | 2707 | 2006-08-25 Scott James Remnant <scott@netsplit.com> |
| 2708 | |
Scott James Remnant | 2167925 | 2006-08-25 16:22:13 +0200 | [diff] [blame] | 2709 | * configure.ac: Bump version to 0.1.2 |
| 2710 | * NEWS: Update. |
| 2711 | |
Scott James Remnant | fef12b5 | 2006-08-25 16:16:45 +0200 | [diff] [blame] | 2712 | * TODO: Update. |
| 2713 | |
Scott James Remnant | 94d0098 | 2006-08-25 15:38:22 +0200 | [diff] [blame] | 2714 | * init/process.c (process_setup_environment): Inherit the PATH |
| 2715 | and TERM environment variables from the init process, so the |
| 2716 | console works properly. |
| 2717 | * init/process.h (PATH): Declare a default value for this variable |
| 2718 | * init/main.c (main): Set the value of PATH to the default. |
| 2719 | * init/tests/test_process.c (child): Update test case. |
| 2720 | |
Scott James Remnant | 33e64d0 | 2006-08-25 14:44:32 +0200 | [diff] [blame] | 2721 | * NEWS: Update. |
| 2722 | * configure.ac: Bump version to 0.1.1 |
| 2723 | |
Scott James Remnant | 68ccc9e | 2006-08-24 00:10:41 +0200 | [diff] [blame] | 2724 | 2006-08-24 Scott James Remnant <scott@netsplit.com> |
| 2725 | |
Scott James Remnant | 279d435 | 2006-08-24 15:33:19 +0200 | [diff] [blame] | 2726 | * init/cfgfile.h (CFG_DIR): Change configuration directory to |
| 2727 | /etc/event.d -- it's not been used by anyone, but is similar to |
| 2728 | other directories that have which is a good precedent. |
| 2729 | * event.d/Makefile.am (eventdir, dist_event_DATA): Install files |
| 2730 | into the new directory name. |
| 2731 | * Makefile.am (SUBDIRS): Rename sub directory |
| 2732 | * configure.ac (AC_CONFIG_FILES): Rename generated Makefile |
| 2733 | |
Scott James Remnant | 937192c | 2006-08-24 02:57:50 +0200 | [diff] [blame] | 2734 | * init/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 2735 | directories so out of tree builds work. |
| 2736 | * logd/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 2737 | directories so out of tree builds work. |
| 2738 | * upstart/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 2739 | directories so out of tree builds work. |
| 2740 | (upstartinclude_HEADERS): Install errors.h |
| 2741 | * util/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 2742 | directories so out of tree builds work. |
| 2743 | |
| 2744 | * Makefile.am (SUBDIRS): Add m4 to the list |
| 2745 | * configure.ac (AC_CONFIG_FILES): Generate m4/Makefile |
| 2746 | * upstart/Makefile.am (upstartinclude_HEADERS): Add errors.h |
| 2747 | |
| 2748 | * upstart/control.c (upstart_open): |
| 2749 | |
Scott James Remnant | e4c3d55 | 2006-08-24 02:34:01 +0200 | [diff] [blame] | 2750 | * init/control.c (control_open): Raise the error before |
| 2751 | performing other actions so errno is not lost. |
Scott James Remnant | 7355009 | 2006-08-24 02:27:03 +0200 | [diff] [blame] | 2752 | |
Scott James Remnant | e4c3d55 | 2006-08-24 02:34:01 +0200 | [diff] [blame] | 2753 | * TODO: Update.o |
Scott James Remnant | f8b776b | 2006-08-24 00:36:15 +0200 | [diff] [blame] | 2754 | * init/cfgfile.c (cfg_next_token): Don't count quote characters |
| 2755 | unless we're actually planning to dequote the file, otherwise we |
| 2756 | end up allocating short. |
| 2757 | |
Scott James Remnant | 9e17fc0 | 2006-08-24 00:28:10 +0200 | [diff] [blame] | 2758 | * init/control.c (control_close): Free the io_watch using list_free |
| 2759 | in case a destructor has been set. |
| 2760 | * init/tests/test_control.c: Initialise the type of the message, and |
| 2761 | free job correctly. |
| 2762 | |
Scott James Remnant | 68ccc9e | 2006-08-24 00:10:41 +0200 | [diff] [blame] | 2763 | * upstart/tests/test_control.c: Fix overwrite of buffer. |
| 2764 | * init/tests/test_job.c: Clean up not-freed job. |
| 2765 | |
Scott James Remnant | c961ce3 | 2006-08-23 19:46:29 +0200 | [diff] [blame] | 2766 | 2006-08-23 Scott James Remnant <scott@netsplit.com> |
| 2767 | |
Scott James Remnant | 013e972 | 2006-08-23 23:00:14 +0200 | [diff] [blame] | 2768 | * init/tests/test_event.c: free the entry allocated and initialise |
| 2769 | the return values. |
| 2770 | |
Scott James Remnant | c961ce3 | 2006-08-23 19:46:29 +0200 | [diff] [blame] | 2771 | * init/cfgfile.c (cfg_skip_token): Drop this function; we'll |
| 2772 | make sure *pos is pointing at the start of the thing we want |
| 2773 | to parse, not the first token. Update the other functions |
| 2774 | accordingly. |
| 2775 | (cfg_read_job): Implement function to look over a job file and |
| 2776 | parse all of the stanzas that are found. Also sanity checks the |
| 2777 | job afterwards and deals with reloading existing jobs. |
| 2778 | (cfg_job_stanza): Function that parses an individual stanza, |
| 2779 | calling out to the other parse functions; this is the main config |
| 2780 | file parser! |
| 2781 | (cfg_parse_args, cfg_parse_command): Drop requirement that filename |
| 2782 | and lineno be passed, so we can be called to reparse arguments after |
| 2783 | we've already done so. |
| 2784 | (cfg_parse_script): Remove requirement that it be called at the |
| 2785 | start of the entire stanza, and instead at the start of the script. |
| 2786 | When hitting EOF, return the script so far, not NULL. |
| 2787 | (cfg_parse_args): Correct bug where we didn't check sufficient |
| 2788 | characters while skipping whitespace. |
| 2789 | (cfg_next_token): Correct bug where we didn't copy the character |
| 2790 | after a slash into the text, instead of just not copying the slash. |
| 2791 | Adjust line numbers to match the fact that it's zero based now. |
| 2792 | * init/cfgfile.h: Define prototype. |
| 2793 | * init/tests/test_cfgfile.c (test_read_job): Pretty thoroughly |
| 2794 | test the config file parser code. |
| 2795 | |
Scott James Remnant | 0c58ed0 | 2006-08-22 11:42:19 +0200 | [diff] [blame] | 2796 | 2006-08-22 Scott James Remnant <scott@netsplit.com> |
| 2797 | |
Scott James Remnant | 214168f | 2006-08-22 18:52:51 +0200 | [diff] [blame] | 2798 | * init/cfgfile.c (cfg_tokenise): Rename to cfg_next_token. |
| 2799 | (cfg_skip_token): Code to skip whitespace, token and whitespace. |
| 2800 | (cfg_parse_args): Function to parse an argument list. |
| 2801 | (cfg_next_token): Extend to support the removal of quotes and |
| 2802 | slashes from the token. |
| 2803 | |
Scott James Remnant | 21590a2 | 2006-08-22 17:40:48 +0200 | [diff] [blame] | 2804 | * init/cfgfile.c (cfg_parse_script): Pass filename and lineno and |
| 2805 | increment the latter as we go. |
| 2806 | (cfg_script_end): Pass and increment lineno. |
| 2807 | |
Scott James Remnant | eed2e8d | 2006-08-22 17:31:07 +0200 | [diff] [blame] | 2808 | * init/cfgfile.c: Correct a missing semi-colon in prototypes. |
| 2809 | (cfg_parse_command): Function to parse any stanza that requires |
| 2810 | a command and arguments list, e.g. exec/respawn/daemon. We don't |
| 2811 | want to require that the list be quoted, etc. and do want to allow |
| 2812 | it to be folded over lines. |
| 2813 | (cfg_tokenise): Function used by the above to tokenise the file, |
| 2814 | handling things like \, quoted strings and newlines, etc. Can be |
| 2815 | used both to determine the length of the token and to copy it. |
| 2816 | |
Scott James Remnant | fcc98ad | 2006-08-22 12:28:19 +0200 | [diff] [blame] | 2817 | * init/cfgfile.c (cfg_read_script): Rename to cfg_parse_script. |
| 2818 | |
Scott James Remnant | fd32dd3 | 2006-08-22 11:46:01 +0200 | [diff] [blame] | 2819 | * init/cfgfile.c (cfg_read_script): Function to parse a script |
| 2820 | fragment ("foo script\n....end script\n") from the job file, which |
| 2821 | is the most complex form we can find. Write it assuming the file is |
| 2822 | in a character array which may not be NULL terminated (ie. a mmap'd |
| 2823 | file). |
| 2824 | (cfg_script_end): Used by the above to detect the end of the |
| 2825 | fragment. |
| 2826 | * init/cfgfile.h: Empty header file. |
| 2827 | * init/Makefile.am (init_SOURCES): Build and link cfgfile.c |
| 2828 | using the cfgfile.h header |
| 2829 | (TESTS): Build and run the config file test cases. |
| 2830 | (test_cfgfile_SOURCES, test_cfgfile_LDFLAGS, test_cfgfile_LDADD): |
| 2831 | Details for config file test case binary. |
| 2832 | |
Scott James Remnant | 0c58ed0 | 2006-08-22 11:42:19 +0200 | [diff] [blame] | 2833 | * init/main.c (main): Remove the calls to the unfinished config |
| 2834 | file code. |
| 2835 | |
Scott James Remnant | 6ce4481 | 2006-08-21 08:46:32 +0200 | [diff] [blame] | 2836 | 2006-08-21 Scott James Remnant <scott@netsplit.com> |
| 2837 | |
Scott James Remnant | 027dd7b | 2006-08-21 09:01:25 +0200 | [diff] [blame] | 2838 | * init/main.c: Add missing include for unistd.h |
| 2839 | * init/process.c (process_setup_console): Drop use of job. |
| 2840 | * util/initctl.c (main): Check that we're run as root. |
| 2841 | |
Scott James Remnant | 77e8db3 | 2006-08-21 08:47:50 +0200 | [diff] [blame] | 2842 | * init/main.c (main): Write the main function |
| 2843 | |
Scott James Remnant | 6ecceb8 | 2006-08-21 08:47:23 +0200 | [diff] [blame] | 2844 | * init/event.c (event_queue_cb): Rename to event_queue_run. |
| 2845 | * init/event.h: Update. |
| 2846 | |
Scott James Remnant | 6ce4481 | 2006-08-21 08:46:32 +0200 | [diff] [blame] | 2847 | * init/process.c (process_setup_console): Become an exported |
| 2848 | function that includes the code to reset a console. |
| 2849 | |
Scott James Remnant | 5befd93 | 2006-08-19 19:24:54 +0100 | [diff] [blame] | 2850 | 2006-08-19 Scott James Remnant <scott@netsplit.com> |
| 2851 | |
Scott James Remnant | cd39a7c | 2006-08-19 20:02:17 +0100 | [diff] [blame] | 2852 | * logd/main.c (main): Write the basic main function. |
| 2853 | |
Scott James Remnant | 3bcd15e | 2006-08-19 19:50:12 +0100 | [diff] [blame] | 2854 | * util/initctl.c (main): Fill in the details to give us a basic |
| 2855 | test client. |
| 2856 | |
Scott James Remnant | 3dc965c | 2006-08-19 19:25:23 +0100 | [diff] [blame] | 2857 | * TODO: Update. |
| 2858 | |
Scott James Remnant | 5befd93 | 2006-08-19 19:24:54 +0100 | [diff] [blame] | 2859 | * util/initctl.c (main): Provide the most basic main function. |
| 2860 | * util/Makefile.am (sbin_PROGRAMS): Build the initctl binary |
| 2861 | * Makefile.am (SUBDIRS): Build the utilities. |
| 2862 | * configure.ac (AC_CONFIG_FILES): Generate the util Makefile. |
| 2863 | |
Scott James Remnant | 1fe38a8 | 2006-08-18 17:06:25 +0100 | [diff] [blame] | 2864 | 2006-08-18 Scott James Remnant <scott@netsplit.com> |
| 2865 | |
Scott James Remnant | c265961 | 2006-08-18 22:19:47 +0100 | [diff] [blame] | 2866 | * init/Makefile.am (test_job_LDADD): Remove the duplicate link. |
| 2867 | |
Scott James Remnant | d5e0705 | 2006-08-18 20:39:30 +0100 | [diff] [blame] | 2868 | * TODO: Update. |
| 2869 | |
Scott James Remnant | a060bb7 | 2006-08-18 20:16:55 +0100 | [diff] [blame] | 2870 | * init/job.c (job_handle_child): Rename to job_child_reaper. |
| 2871 | * init/job.h: Update. |
| 2872 | * init/tests/test_job.c: Update function names. |
| 2873 | |
Scott James Remnant | 829dc08 | 2006-08-18 20:10:02 +0100 | [diff] [blame] | 2874 | * init/control.c (control_cb): Rename to control_watcher |
| 2875 | * init/tests/test_control.c: Update function names. |
| 2876 | |
Scott James Remnant | ddc3e28 | 2006-08-18 18:49:50 +0100 | [diff] [blame] | 2877 | * TODO: Update. |
| 2878 | |
Scott James Remnant | c2cac3f | 2006-08-18 17:17:57 +0100 | [diff] [blame] | 2879 | * Makefile.am (SUBDIRS): Install the rc.d files. |
| 2880 | * configure.ac (AC_CONFIG_FILES): Generate the rc.d Makefile. |
| 2881 | * rc.d/Makefile.am (rcdir): Define rcdir to be /etc/rc.d |
| 2882 | (dist_rc_DATA): Install the logd file into that directory. |
| 2883 | * rc.d/logd: Write a simple service definition for the log daemon, |
| 2884 | this saves us hardcoding any information about it into init; it'll |
| 2885 | just need to know the name. |
| 2886 | |
Scott James Remnant | 1fe38a8 | 2006-08-18 17:06:25 +0100 | [diff] [blame] | 2887 | * Makefile.am (SUBDIRS): Build the logd daemon |
| 2888 | * configure.ac (AC_CONFIG_FILES): Generate the logd Makefile. |
| 2889 | * logd/Makefile.am (sbin_PROGRAMS): Install the logd binary into |
| 2890 | the sbin directory by default. |
| 2891 | (logd_SOURCES): Build and link main.c |
| 2892 | * logd/main.c (main): Add basic main function for testing purposes. |
| 2893 | |
Scott James Remnant | b981443 | 2006-08-16 02:11:51 +0100 | [diff] [blame] | 2894 | 2006-08-16 Scott James Remnant <scott@netsplit.com> |
| 2895 | |
Scott James Remnant | c5da6fd | 2006-08-16 18:06:49 +0100 | [diff] [blame] | 2896 | * init/job.c (job_start): Ignore self-dependencies; over-document |
| 2897 | why the dependency event prodding has a surprise in its tail. |
| 2898 | (job_change_state): Move the job_release_depends call to here. |
| 2899 | |
Scott James Remnant | 133a7a3 | 2006-08-16 17:45:51 +0100 | [diff] [blame] | 2900 | * init/event.c (event_queue_cb): Add event consumer/dispatcher. |
Scott James Remnant | 13e5dbf | 2006-08-16 17:48:01 +0100 | [diff] [blame] | 2901 | * init/event.h: Update. |
Scott James Remnant | 133a7a3 | 2006-08-16 17:45:51 +0100 | [diff] [blame] | 2902 | |
Scott James Remnant | 3772bc6 | 2006-08-16 17:41:34 +0100 | [diff] [blame] | 2903 | * init/control.c (control_send): Make the event code clearer. |
| 2904 | (control_handle): Handle the changed event semantics. |
| 2905 | (control_handle_event): Issue the new event type. |
| 2906 | * init/tests/test_control.c: Update tests. |
| 2907 | |
Scott James Remnant | caee5b5 | 2006-08-16 17:32:12 +0100 | [diff] [blame] | 2908 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Adjust |
| 2909 | marshal code to match. |
| 2910 | * upstart/control.h: Update all structures appropriately to the |
| 2911 | previous changes. |
| 2912 | * upstart/tests/test_control.c: Update. |
| 2913 | |
Scott James Remnant | 4d4389d | 2006-08-16 17:19:20 +0100 | [diff] [blame] | 2914 | * init/job.c (job_change_state): Change call to event_trigger_level |
| 2915 | to event_queue_level. |
| 2916 | |
Scott James Remnant | 51664d7 | 2006-08-16 17:17:58 +0100 | [diff] [blame] | 2917 | * init/event.c (event_trigger_edge, event_trigger_level): Place |
| 2918 | the event on the event_queue rather than directly triggering it. |
| 2919 | Rename to event_queue_edge and event_queue_level respectively. |
| 2920 | * init/event.h: Update. |
| 2921 | * init/tests/test_event.c: Update test cases. |
| 2922 | |
Scott James Remnant | 4ddc86e | 2006-08-16 16:17:48 +0100 | [diff] [blame] | 2923 | * init/job.c (job_handle_event): Add another sanity check, jobs |
| 2924 | should not be able to react to their own events; that's just silly. |
| 2925 | * init/tests/test_job.c (test_handle_event): Check that the new |
| 2926 | condition does the right thing. |
| 2927 | |
Scott James Remnant | 930f3e0 | 2006-08-16 16:13:03 +0100 | [diff] [blame] | 2928 | * init/job.c (job_change_state): Make it illegal for a job to exist |
| 2929 | without either a command or script or both. This is for sanity |
| 2930 | reasons, allowing no primary process makes no sense and can lead |
| 2931 | to event loops if someone is feeling nefarious. |
| 2932 | * init/tests/test_job.c (test_change_state): Drop test on behaviour |
| 2933 | we've just outlawed. |
| 2934 | |
Scott James Remnant | 7dd047e | 2006-08-16 13:43:50 +0100 | [diff] [blame] | 2935 | * init/job.c (job_start): Only announce the change if we're still |
| 2936 | in the waiting state, we could have moved on to running already. |
| 2937 | |
Scott James Remnant | f9261ba | 2006-08-16 13:40:05 +0100 | [diff] [blame] | 2938 | * init/job.c (job_start): If holding the job, at least announce |
| 2939 | the goal change to subscribed clients. |
| 2940 | |
Scott James Remnant | 853cc77 | 2006-08-16 13:34:51 +0100 | [diff] [blame] | 2941 | * TODO: Update. |
| 2942 | |
Scott James Remnant | fdb8259 | 2006-08-16 13:31:49 +0100 | [diff] [blame] | 2943 | * init/job.c (job_start): Check for dependencies before starting |
| 2944 | the process, if we have any that aren't running we stay in waiting |
| 2945 | until they are. Any that aren't even starting get poked with a |
| 2946 | dependency event to see whether that wakes them up. |
| 2947 | * init/tests/test_job.c (test_start): Test paths through new |
| 2948 | dependency code. |
| 2949 | |
Scott James Remnant | 278150a | 2006-08-16 12:56:34 +0100 | [diff] [blame] | 2950 | * init/job.c (job_run_process): Once we've got an active process |
| 2951 | in the running state, release our dependencies. |
| 2952 | |
Scott James Remnant | 6d4104d | 2006-08-16 12:50:39 +0100 | [diff] [blame] | 2953 | * init/job.c (job_release_depends): Function to release any waiting |
| 2954 | dependencies on the given job. |
| 2955 | * init/job.h: Update. |
| 2956 | * init/tests/test_job.c (test_release_depends): Test the behaviour |
| 2957 | of the function on its own. |
| 2958 | |
Scott James Remnant | 1da1dad | 2006-08-16 12:18:50 +0100 | [diff] [blame] | 2959 | * init/job.h (Job): Add depends list field |
| 2960 | (JobName): New structure to hold the name of a job. |
| 2961 | * init/job.c (job_new): Initialise the depends list. |
| 2962 | * init/tests/test_job.c (test_new): Make sure the depends list is |
| 2963 | initialised properly. |
| 2964 | |
Scott James Remnant | 37eee03 | 2006-08-16 12:10:49 +0100 | [diff] [blame] | 2965 | * init/job.c (job_next_state): Return JOB_STARTING if we're in |
| 2966 | JOB_WAITING and the goal is JOB_START. This is only called when |
| 2967 | there's some change, and I don't want to hard-code the goal there. |
| 2968 | (job_start): Don't hardcode JOB_STARTING, instead just use the next |
| 2969 | state. |
| 2970 | * init/tests/test_job.c (test_next_state): Adjust test case. |
| 2971 | |
Scott James Remnant | c3d3ead | 2006-08-16 09:00:50 +0100 | [diff] [blame] | 2972 | * init/control.c (control_subscribe): Allow the current |
| 2973 | subscription to be found by passing NOTIFY_NONE. |
| 2974 | (control_handle): Don't remove an existing subscription to jobs, |
| 2975 | a GUI will probably want a permanent one to keep the status up to |
| 2976 | date. |
| 2977 | |
Scott James Remnant | b9a568c | 2006-08-16 08:57:46 +0100 | [diff] [blame] | 2978 | * init/job.c (job_kill_process, job_kill_timer): Don't hardcode |
| 2979 | JOB_STOPPING here, instead move to the next logical state. |
| 2980 | (job_kill_process): Notify subscribed processes that we killed |
| 2981 | the job. |
| 2982 | (job_start, job_stop): Notify subscribed processes of a change of |
| 2983 | goal that doesn't result in an immediate state change. |
| 2984 | |
Scott James Remnant | 8dbc601 | 2006-08-16 08:57:38 +0100 | [diff] [blame] | 2985 | * init/event.c (event_trigger_edge, event_trigger_level): Swap |
| 2986 | order so that events are announced before processed. |
| 2987 | |
Scott James Remnant | 2816125 | 2006-08-16 08:41:48 +0100 | [diff] [blame] | 2988 | * init/control.c (control_handle): Handle requests to watch and |
| 2989 | unwatch jobs and events. |
| 2990 | * init/tests/test_control.c (test_cb_child, test_cb): Check that |
| 2991 | subscriptions work. |
| 2992 | |
Scott James Remnant | b6d55bf | 2006-08-16 08:24:16 +0100 | [diff] [blame] | 2993 | * init/tests/test_control.c (test_cb_child): Add a sleep to avoid |
| 2994 | a race that upsets gdb, have tried this with a STOP/CONT interlock |
| 2995 | but can't seem to find where the child should reach first. |
| 2996 | |
Scott James Remnant | 5612b23 | 2006-08-16 08:21:06 +0100 | [diff] [blame] | 2997 | * init/job.c (job_change_state): Notify the control handler. |
| 2998 | * init/event.c (event_trigger_edge, event_trigger_level): Pass |
| 2999 | event to the control handler. |
| 3000 | * init/tests/test_control.c (test_cb_child): Expect to receive |
| 3001 | job status events as well. |
| 3002 | * init/Makefile.am (test_event_LDADD, test_process_LDADD) |
| 3003 | (test_job_LDADD): Add control.o to the linkage. |
| 3004 | |
Scott James Remnant | 9e0626a | 2006-08-16 08:17:07 +0100 | [diff] [blame] | 3005 | * init/control.c (control_cb): Don't display an error for |
| 3006 | ECONNREFUSED, just remove any subscriptions. |
| 3007 | * init/tests/test_control.c (test_handle_job, test_handle_error): |
| 3008 | Clean up our subscriptions properly. |
| 3009 | |
Scott James Remnant | 3c465c8 | 2006-08-16 07:40:24 +0100 | [diff] [blame] | 3010 | * init/control.c (control_handle_job): Function to send out an |
| 3011 | UPSTART_JOB_STATUS message to subscribed processes whenever a |
| 3012 | job state changes. |
| 3013 | (control_handle_event): Function to send out an |
| 3014 | UPSTART_EVENT_TRIGGERED message to subscribed processes whenever |
| 3015 | an event is triggered. |
| 3016 | * init/control.h: Update. |
| 3017 | * init/tests/test_control.c (test_handle_job, test_handle_event): |
| 3018 | Check that the functions work properly. |
| 3019 | |
Scott James Remnant | 16dadc5 | 2006-08-16 07:27:40 +0100 | [diff] [blame] | 3020 | * init/control.c (control_handle): Handle messages that trigger |
| 3021 | edge and level events; subscribe the process to receive notification |
| 3022 | of job changes during the event. |
| 3023 | * init/tests/test_control.c (test_cb_child): Check that the messages |
| 3024 | are handled properly (without subscription check). |
| 3025 | |
Scott James Remnant | a7ba72a | 2006-08-16 07:11:30 +0100 | [diff] [blame] | 3026 | * init/control.c (control_cb): Unsubscribe a process if it stops |
| 3027 | listening. |
| 3028 | |
Scott James Remnant | 2c9669c | 2006-08-16 07:10:05 +0100 | [diff] [blame] | 3029 | * init/control.c (control_send): Copy the pointers in the new |
| 3030 | event messages. |
| 3031 | * init/tests/test_control.c (test_send): Check the pointers are |
| 3032 | copied across correctly. |
| 3033 | |
Scott James Remnant | 15d61c6 | 2006-08-16 06:55:58 +0100 | [diff] [blame] | 3034 | * init/control.c (control_subscribe): Add function to handle |
| 3035 | processes that want to subscribe to changes. |
| 3036 | (control_init): Initialise the subscriptions list. |
| 3037 | * init/control.h: Add structures and prototypes. |
| 3038 | * init/tests/test_control.c (test_subscribe): Test the function. |
| 3039 | |
Scott James Remnant | 8692f76 | 2006-08-16 06:21:13 +0100 | [diff] [blame] | 3040 | * upstart/control.h (UpstartMsgType): add messages for triggering |
| 3041 | edge and level events, receiving the trigger for an event and for |
| 3042 | watching jobs and events. |
| 3043 | (UpstartEventTriggerEdgeMsg, UpstartEventTriggerLevelMsg) |
| 3044 | (UpstartEventTriggeredMsg, UpstartWatchJobsMsg) |
| 3045 | (UpstartUnwatchJobsMsg, UpstartWatchEventsMsg): |
| 3046 | (UpstartUnwatchEventsMsg): Add structures for the new messages. |
| 3047 | (UpstartMsg): And add them to the union. |
| 3048 | * upstart/control.c (WireEventPayload): The event messages can all |
| 3049 | share a wire payload type; the watch messages don't need any special |
| 3050 | payload. |
| 3051 | (upstart_send_msg_to): Add the payloads onto the wire. |
| 3052 | (upstart_recv_msg): And take the payloads back off the wire. |
| 3053 | * upstart/tests/test_control.c (test_messages): Test the new |
| 3054 | message types. |
| 3055 | |
Scott James Remnant | 8ed97eb | 2006-08-16 05:46:44 +0100 | [diff] [blame] | 3056 | * upstart/control.h (UpstartJobStatusMsg): add a process id. |
| 3057 | * upstart/control.c (WireJobStatusPayload): and here too. |
| 3058 | (upstart_send_msg_to): copy the process id onto the wire. |
| 3059 | (upstart_recv_msg): copy the process id from the wire. |
| 3060 | * init/control.c (control_handle): Fill in the pid from the job. |
| 3061 | * upstart/tests/test_control.c (test_messages): Check the pid gets |
| 3062 | passed across the wire properly. |
| 3063 | |
Scott James Remnant | 7d91431 | 2006-08-16 05:37:50 +0100 | [diff] [blame] | 3064 | * init/control.c (control_cb): Disable the poll for write once the |
| 3065 | send queue becomes empty. |
| 3066 | |
Scott James Remnant | 59707c2 | 2006-08-16 05:32:20 +0100 | [diff] [blame] | 3067 | * upstart/Makefile.am (libupstart_la_SOURCES): Correct ordering. |
| 3068 | |
Scott James Remnant | a98c8b8 | 2006-08-16 05:32:02 +0100 | [diff] [blame] | 3069 | * init/control.c (control_handle): Add missing break. |
| 3070 | |
Scott James Remnant | b5c7a30 | 2006-08-16 05:24:55 +0100 | [diff] [blame] | 3071 | * upstart/job.c (job_goal_name, process_state_name): For completeness |
| 3072 | add these two functions as well. |
| 3073 | * upstart/job.h: Update. |
| 3074 | * upstart/tests/test_job.c (test_goal_name) |
| 3075 | (test_process_state_name): Test the new functions. |
| 3076 | |
Scott James Remnant | 20b15ad | 2006-08-16 05:20:02 +0100 | [diff] [blame] | 3077 | * init/job.c (job_state_name): Move this utility function from here |
| 3078 | * upstart/job.c (job_state_name): to here so all clients can use |
| 3079 | it. |
| 3080 | * init/job.h: Update. |
| 3081 | * upstart/job.h: Update. |
| 3082 | * init/tests/test_job.c (test_state_name): Move the test case from here |
| 3083 | * upstart/tests/test_job.c: to here as well. |
| 3084 | * upstart/Makefile.am (libupstart_la_SOURCES): Build and link job.c |
| 3085 | (TESTS): Run the job test cases |
| 3086 | (test_job_SOURCES, test_job_LDFLAGS, test_job_LDADD): Details for |
| 3087 | job test case binary. |
| 3088 | * init/Makefile.am (test_job_LDADD, test_process_LDADD) |
| 3089 | (test_event_LDADD): Link to libupstart.la |
| 3090 | |
Scott James Remnant | 7a5c667 | 2006-08-16 05:01:13 +0100 | [diff] [blame] | 3091 | * init/control.c: Code to handle the server end of the control |
| 3092 | socket, a bit more complex than a client as we want to avoid |
| 3093 | blocking on malcious clients. |
| 3094 | * init/control.h: Prototypes. |
| 3095 | * init/tests/test_control.c: Test the control code. |
| 3096 | * init/Makefile.am (init_SOURCES): Build and link control.c |
| 3097 | using the control.h header |
| 3098 | (init_LDADD): Link to libupstart as well |
| 3099 | (TESTS): Build and run the control test suite. |
| 3100 | (test_control_SOURCES, test_control_LDFLAGS, test_control_LDADD): |
| 3101 | Details for control test suite binary. |
| 3102 | |
Scott James Remnant | b7cbda5 | 2006-08-16 04:53:38 +0100 | [diff] [blame] | 3103 | * upstart/control.c: Add a way to disable the safety checks. |
| 3104 | * upstart/tests/test_control.c (test_free): Fix bad test case. |
| 3105 | |
Scott James Remnant | 71d4d84 | 2006-08-16 04:29:21 +0100 | [diff] [blame] | 3106 | * upstart/control.c (upstart_recv_msg): fixed bogus return type |
| 3107 | for recvmsg from size_t to ssize_t so we don't infiniloop on error. |
| 3108 | |
Scott James Remnant | 2bda383 | 2006-08-16 03:41:10 +0100 | [diff] [blame] | 3109 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Avoid |
| 3110 | job_start as the short-cut for assigning name, as that might become |
| 3111 | a more complex message eventually. Use job_query instead. |
| 3112 | |
Scott James Remnant | d154b95 | 2006-08-16 03:39:35 +0100 | [diff] [blame] | 3113 | * upstart/control.c (upstart_free): Add wrapper function around |
| 3114 | nih_free so we're a proper library and don't expose libnih too much |
| 3115 | (upstart_recv_msg): Stash the sender pid in an argument. |
| 3116 | * upstart/control.h: Update. |
| 3117 | * upstart/tests/test_control.c (test_recv_msg): Test pid is |
| 3118 | returned properly. |
| 3119 | (test_free): Test the nih_free wrapper. |
| 3120 | |
Scott James Remnant | dc0eb44 | 2006-08-16 02:40:29 +0100 | [diff] [blame] | 3121 | * init/job.c (job_run_script): Document future FIXME. |
| 3122 | |
Scott James Remnant | 2f55853 | 2006-08-16 02:24:55 +0100 | [diff] [blame] | 3123 | * init/exent.h, init/job.h, init/process.h: Fix up headers. |
| 3124 | |
Scott James Remnant | 45aab69 | 2006-08-16 02:23:27 +0100 | [diff] [blame] | 3125 | * upstart/control.c, upstart/control.h, upstart/errors.h, |
| 3126 | upstart/job.h, upstart/libupstart.h: Fix up headers. |
| 3127 | |
Scott James Remnant | 8c16cc8 | 2006-08-16 02:13:40 +0100 | [diff] [blame] | 3128 | * upstart/control.c: Write the code to handle the control socket |
| 3129 | and communication over it; turns out this was possible to write so |
| 3130 | that both ends are handled in the same code. |
| 3131 | * upstart/control.h: Structures and prototypes. |
| 3132 | * upstart/tests/test_control.c: Test the new code. |
| 3133 | |
Scott James Remnant | 729d922 | 2006-08-16 02:12:23 +0100 | [diff] [blame] | 3134 | * upstart/Makefile.am (libupstart_la_LIBADD): Link to libnih |
| 3135 | |
Scott James Remnant | b981443 | 2006-08-16 02:11:51 +0100 | [diff] [blame] | 3136 | * upstart/errors.h: Header file containing errors raised by |
| 3137 | libupstart. |
| 3138 | * upstart/libupstart.h: Include errors.h |
| 3139 | |
Scott James Remnant | 342451a | 2006-08-15 00:08:20 +0100 | [diff] [blame] | 3140 | 2006-08-15 Scott James Remnant <scott@netsplit.com> |
| 3141 | |
Scott James Remnant | 0a8e347 | 2006-08-15 23:54:14 +0100 | [diff] [blame] | 3142 | * init/event.h: Add missing attribute for event_new() |
| 3143 | |
Scott James Remnant | 6f12887 | 2006-08-15 23:54:05 +0100 | [diff] [blame] | 3144 | * init/job.h (JobGoal, JobState, ProcessState, ConsoleType): Move |
| 3145 | the enums from here |
| 3146 | * upstart/job.h: into here so that we can use them across the |
| 3147 | control socket. |
| 3148 | |
Scott James Remnant | e583179 | 2006-08-15 21:46:21 +0100 | [diff] [blame] | 3149 | * Makefile.am (SUBDIRS): Build the libupstart library |
| 3150 | * configure.ac (AC_CONFIG_FILES): Generate upstart/Makefile |
| 3151 | * upstart/Makefile.am: Makefile for sub-directory |
| 3152 | * upstart/libupstart.ver: Linker version script. |
| 3153 | * upstart/libupstart.h: "Include everything" header file. |
| 3154 | |
Scott James Remnant | 26a8eec | 2006-08-15 05:46:27 +0100 | [diff] [blame] | 3155 | * TODO: Update. |
| 3156 | |
Scott James Remnant | 1f8619c | 2006-08-15 05:45:38 +0100 | [diff] [blame] | 3157 | * init/job.c (job_handle_child): Warn when processes are killed |
| 3158 | or exit with an abnormal status. Warn when respawning. |
| 3159 | |
Scott James Remnant | eb5ad27 | 2006-08-15 05:43:05 +0100 | [diff] [blame] | 3160 | * init/job.c (job_handle_child): Respawn processes that were not |
| 3161 | supposed to have died. |
| 3162 | * init/tests/test_job.c (test_handle_child): Test the respawn code. |
| 3163 | |
Scott James Remnant | 77c926d | 2006-08-15 05:22:08 +0100 | [diff] [blame] | 3164 | * TODO: Update. |
| 3165 | |
Scott James Remnant | 429cd67 | 2006-08-15 05:09:51 +0100 | [diff] [blame] | 3166 | * init/event.c (event_trigger_edge, event_trigger_level): Call |
| 3167 | job_handle_event so that we actually do something useful. |
| 3168 | * init/Makefile.am (test_event_LDADD): Link to process.o and job.o |
| 3169 | now that event.c calls code from job. |
| 3170 | |
Scott James Remnant | 355e1b6 | 2006-08-15 05:07:24 +0100 | [diff] [blame] | 3171 | * init/job.c (job_start_event): Function to start a job if an event |
| 3172 | matches. |
| 3173 | (job_stop_event): Function to stop a job if an event matches. |
| 3174 | (job_handle_event): Iterate the job list and dispatch the given event, |
| 3175 | causing jobs to be stopped or started using the above two functions. |
| 3176 | * init/job.h: Update. |
| 3177 | * init/tests/test_job.c: Test the new functions. |
| 3178 | |
Scott James Remnant | 923400d | 2006-08-15 04:27:44 +0100 | [diff] [blame] | 3179 | * init/job.c (job_new): Initialise start_events and stop_events to |
| 3180 | an empty list. |
| 3181 | * init/job.h (Job): Add start_events and stop_events list heads. |
| 3182 | * init/tests/test_job.c (test_new): Check the lists are initialised |
| 3183 | correctly to the empty list. |
| 3184 | |
Scott James Remnant | 865534f | 2006-08-15 04:22:06 +0100 | [diff] [blame] | 3185 | * init/event.c (event_match): Function to check events for equality. |
| 3186 | * init/event.h: Update. |
| 3187 | * init/tests/test_event.c (test_match): Test function. |
| 3188 | |
Scott James Remnant | 97137a7 | 2006-08-15 04:07:08 +0100 | [diff] [blame] | 3189 | * init/job.c (job_change_state): Trigger the level event with the |
| 3190 | same name as the job, with the value taken from the state. |
| 3191 | * init/tests/test_job.c (test_change_state): Check the event |
| 3192 | gets set to the right values as we go. |
| 3193 | * init/Makefile.am (test_job_LDADD, test_process_LDADD): Link to |
| 3194 | event.o now that job.c uses code from there. |
| 3195 | |
Scott James Remnant | 3b35a52 | 2006-08-15 04:01:32 +0100 | [diff] [blame] | 3196 | * init/event.c (event_change_value): Rename event_set_value to this |
| 3197 | as we intended in the first place; makes it more consistent with job. |
| 3198 | Always change the value. |
| 3199 | (event_trigger_edge): Add a high-level function to trigger an edge |
| 3200 | event. |
| 3201 | (event_trigger_level): And another to trigger a level event with |
| 3202 | a given value, this inherits the "don't change it" functionality |
| 3203 | that was in event_set_value. |
| 3204 | * init/event.h: Update. |
| 3205 | * init/tests/test_event.c: Test new behaviours and functions. |
| 3206 | |
Scott James Remnant | 4fef073 | 2006-08-15 01:45:02 +0100 | [diff] [blame] | 3207 | * init/event.c: Add simple code to keep track of events, whether |
| 3208 | they have been recorded or not and their current value if any. |
| 3209 | * init/event.h: Structures and prototypes. |
| 3210 | * init/tests/test_event.c: Test cases for event code. |
| 3211 | * init/Makefile.am (init_SOURCES): Build and link event.c using event.h |
| 3212 | (TESTS): Run the event test suite. |
| 3213 | (test_event_SOURCES, test_event_LDFLAGS, test_event_LDADD): Details |
| 3214 | for event test suite binary. |
| 3215 | |
Scott James Remnant | 38fc8ff | 2006-08-15 00:43:26 +0100 | [diff] [blame] | 3216 | * init/job.c (job_run_process, job_kill_process, job_kill_timer): |
| 3217 | Downgrade error messages to warning as they're not fatal. |
| 3218 | (job_change_state): Change info message to be more regular. |
| 3219 | |
Scott James Remnant | f033fb0 | 2006-08-15 00:37:33 +0100 | [diff] [blame] | 3220 | * init/job.c (job_start): A very simple, but very necessary, function. |
| 3221 | Set the goal of the given job to JOB_START and kick it off. |
| 3222 | (job_stop): And its companion, cause a running job to be stopped. |
| 3223 | * init/job.h: Update. |
| 3224 | * init/tests/test_job.c: Test the functions. |
| 3225 | |
Scott James Remnant | 342451a | 2006-08-15 00:08:20 +0100 | [diff] [blame] | 3226 | * init/job.c (job_handle_child): Child handler to kick jobs into |
| 3227 | the next state when their process dies. |
| 3228 | * init/job.h: Update. |
| 3229 | * init/tests/test_job.c (test_handle_child): Test the handler |
| 3230 | directly by just invoking it with various job states. |
| 3231 | |
Scott James Remnant | 1c463b9 | 2006-08-14 14:46:17 +0100 | [diff] [blame] | 3232 | 2006-08-14 Scott James Remnant <scott@netsplit.com> |
| 3233 | |
Scott James Remnant | 51c827d | 2006-08-14 23:06:00 +0100 | [diff] [blame] | 3234 | * init/tests/test_process.c (test_kill): Use select rather than |
| 3235 | poll for consistency with other test cases. |
| 3236 | |
Scott James Remnant | e6e4a73 | 2006-08-14 23:04:53 +0100 | [diff] [blame] | 3237 | * init/job.c (job_kill_process): Add function to send the active |
| 3238 | process of a job the TERM signal, and then set a timer to follow |
| 3239 | up with the KILL signal if the job doesn't get cleaned up in time. |
| 3240 | (job_kill_timer): Timer callback to send the KILL signal; this |
| 3241 | does the same job as the child handler and puts the job into the |
| 3242 | next state as there's no point waiting around now. |
| 3243 | * init/job.h: Update. |
| 3244 | * init/tests/test_job.c (test_kill_process): Test both functions |
| 3245 | in one test case (as one is just the bottom half of the other). |
| 3246 | |
Scott James Remnant | 6868f65 | 2006-08-14 21:42:45 +0100 | [diff] [blame] | 3247 | * init/tests/test_process.c (test_spawn): Use the right thing in |
| 3248 | the test case filename and unlink it to make sure. |
| 3249 | |
Scott James Remnant | 85df942 | 2006-08-14 21:41:39 +0100 | [diff] [blame] | 3250 | * init/job.c (job_change_state): Write the principal state gate |
| 3251 | function, called once a state has been left to enter the given new |
| 3252 | state (which one should determine with job_next_state). Spawns |
| 3253 | the necessary processes or moves to the next appropriate state. |
| 3254 | * init/job.h: Update. |
| 3255 | * init/tests/test_job.c: Test the state changes. |
| 3256 | |
Scott James Remnant | ba44b8b | 2006-08-14 20:06:28 +0100 | [diff] [blame] | 3257 | * init/job.c (job_run_process): Internal function to call |
| 3258 | process_spawn and update the job structure. |
| 3259 | (job_run_command): Simple(ish) wrapper for the above to split |
| 3260 | a command by whitespace, or use a shell if it needs more complex |
| 3261 | argument processing. |
| 3262 | (job_run_script): More complex wrapper that uses a shell to execute |
| 3263 | verbatim script, either using -c or a /dev/fd/NN and feeding the |
| 3264 | shell down a pipe to it. |
| 3265 | * init/job.h: Update. |
| 3266 | * init/tests/test_job.c: Test the new functions. |
| 3267 | |
Scott James Remnant | 156f548 | 2006-08-14 19:09:55 +0100 | [diff] [blame] | 3268 | * init/Makefile.am (init_SOURCES, TESTS): Reorder so that process.c, |
| 3269 | which is arguably lower level, comes first. |
| 3270 | (test_job_LDADD): Link the process code. |
| 3271 | (test_process_LDADD): Swap the order. |
| 3272 | |
Scott James Remnant | 00bcc93 | 2006-08-14 19:07:28 +0100 | [diff] [blame] | 3273 | * TODO: Update. |
| 3274 | |
Scott James Remnant | 1c463b9 | 2006-08-14 14:46:17 +0100 | [diff] [blame] | 3275 | * init/process.c (process_spawn): Correct typo (progress -> process), |
| 3276 | thanks Johan. |
| 3277 | |
Scott James Remnant | 43534ca | 2006-08-12 14:52:01 +0100 | [diff] [blame] | 3278 | 2006-08-12 Scott James Remnant <scott@netsplit.com> |
| 3279 | |
Scott James Remnant | 3030cc2 | 2006-08-12 15:18:55 +0100 | [diff] [blame] | 3280 | * init/process.c (process_spawn): Correct formatting of function. |
| 3281 | * init/process.h (SHELL): Define the location of the shell, all in |
| 3282 | the spirit of not hard-coding stuff like this. |
| 3283 | |
Scott James Remnant | 43534ca | 2006-08-12 14:52:01 +0100 | [diff] [blame] | 3284 | * init/job.c (job_new): Initialise all structure members to zero |
| 3285 | as this doesn't happen automatically. |
| 3286 | |
Scott James Remnant | 60b03e3 | 2006-08-10 00:59:00 +0100 | [diff] [blame] | 3287 | 2006-08-10 Scott James Remnant <scott@netsplit.com> |
| 3288 | |
| 3289 | * init/job.h (job_state_name): Declare as a const function. |
| 3290 | |
Scott James Remnant | 143a857 | 2006-08-09 17:37:00 +0100 | [diff] [blame] | 3291 | 2006-08-09 Scott James Remnant <scott@netsplit.com> |
| 3292 | |
Scott James Remnant | d945d2e | 2006-08-09 23:47:44 +0100 | [diff] [blame] | 3293 | * init/job.c (job_next_state): State transition logic; this uses |
| 3294 | our departure from the specification (the goal) so that the state |
| 3295 | can always be currently accurate rather than suggestive. |
| 3296 | (job_state_name): Cute function to convert enum into a name. |
| 3297 | * init/job.h: Update. |
| 3298 | * init/tests/test_job.c (test_next_state): Test the transitions. |
| 3299 | (test_state_name): And the return values. |
| 3300 | |
Scott James Remnant | 5fa1567 | 2006-08-09 23:23:17 +0100 | [diff] [blame] | 3301 | * TODO: Add file to keep track of things. |
| 3302 | |
Scott James Remnant | dbc7861 | 2006-08-09 23:22:45 +0100 | [diff] [blame] | 3303 | * init/job.c: Include nih/macros.h and nih/list.h |
| 3304 | * init/process.c: Include order fixing, include nih/macros.h |
| 3305 | * init/tests/test_job.c: Include nih/macros.h and nih/list.h |
| 3306 | * init/tests/test_process.c: Include nih/list.h |
| 3307 | |
Scott James Remnant | 03853ed | 2006-08-09 23:11:59 +0100 | [diff] [blame] | 3308 | * init/job.c: Include order fixing. |
| 3309 | (job_find_by_name): Function to find a job by its (unique) name. |
| 3310 | (job_find_by_pid): Function to find a job by the pid of its process. |
| 3311 | * init/job.h: Update. |
| 3312 | * init/tests/test_job.c (test_find_by_name, test_find_by_pid): Test |
| 3313 | new functions. |
| 3314 | |
Scott James Remnant | 143a857 | 2006-08-09 17:37:00 +0100 | [diff] [blame] | 3315 | * init/process.c (process_spawn): Spawn a process using the job |
| 3316 | details to set up the environment, etc. |
| 3317 | (process_setup_console): Set up the console according to the job. |
| 3318 | (process_setup_limits): Set up the limits according to the job. |
| 3319 | (process_setup_environment): Set up the environment according to |
| 3320 | the job. |
| 3321 | (process_kill): Simple function to send a kill signal or raise an |
| 3322 | error; mostly just a wrapper without any particular logic. |
| 3323 | * init/process.h: Prototypes and macros. |
| 3324 | * init/tests/test_process.c: Test cases. |
| 3325 | * init/Makefile.am (init_SOURCES): Build and link process.c and |
| 3326 | its header file. |
| 3327 | (TESTS): Run the process test suite. |
| 3328 | (test_process_SOURCES, test_process_LDFLAGS, test_process_LDADD): |
| 3329 | Details for process test sutie binary. |
| 3330 | |
Scott James Remnant | 29abda0 | 2006-08-08 15:01:24 +0100 | [diff] [blame] | 3331 | 2006-08-08 Scott James Remnant <scott@netsplit.com> |
| 3332 | |
Scott James Remnant | 31ee263 | 2006-08-08 15:06:02 +0100 | [diff] [blame] | 3333 | * init/job.c (job_new): nih_list_free is necessary. |
| 3334 | * init/tests/test_job.c (test_new): Free job when done. |
| 3335 | |
Scott James Remnant | 29abda0 | 2006-08-08 15:01:24 +0100 | [diff] [blame] | 3336 | * init/job.h: Header file to contain the definition of the Job |
| 3337 | structure and associated typedefs, etc. |
| 3338 | (JobGoal): In a divergence from the specification, we introduced a |
| 3339 | "goal" for a job which tells us which way round the state machine |
| 3340 | we're going (towards start, or towards stop). |
| 3341 | (JobState): Which means this always holds the current state, even |
| 3342 | if we're trying to get out of this state (ie. if we've sent the TERM |
| 3343 | signal to the running process, we're still in the running state until |
| 3344 | it's actually been reaped). |
| 3345 | (ProcessState): And in another divergence, we keep the state of the |
| 3346 | process so we know whether we need to force a state transition or |
| 3347 | can just expect one because something transient is happening. |
| 3348 | * init/job.c (job_new): Function to allocate a Job structure, set |
| 3349 | the pointers to NULL and other important members to sensible |
| 3350 | defaults. |
| 3351 | (job_init): Initialise the list of jobs. |
| 3352 | * init/tests/test_job.c: Test suite. |
| 3353 | * init/Makefile.am (init_SOURCES): Compile and link job.c using |
| 3354 | its header file. |
| 3355 | (TESTS): Run the job test suite. |
| 3356 | (test_job_SOURCES, test_job_LDFLAGS, test_job_LDADD): Details for the |
| 3357 | job test suite binary. |
| 3358 | |
Scott James Remnant | b933bc9 | 2006-08-02 02:29:25 +0100 | [diff] [blame] | 3359 | 2006-08-02 Scott James Remnant <scott@netsplit.com> |
| 3360 | |
Scott James Remnant | 6c7667a | 2006-08-02 02:43:12 +0100 | [diff] [blame] | 3361 | * configure.ac: Check for C99 |
| 3362 | |
Scott James Remnant | b933bc9 | 2006-08-02 02:29:25 +0100 | [diff] [blame] | 3363 | * HACKING: Document dependency on libnih. |
| 3364 | |
Scott James Remnant | a780d6c | 2006-07-27 18:40:51 +0100 | [diff] [blame] | 3365 | 2006-07-27 Scott James Remnant <scott@netsplit.com> |
| 3366 | |
| 3367 | * init/Makefile.am (DEFS): Append to the default DEFS list, rather |
| 3368 | than overriding, otherwise we lose HAVE_CONFIG_H |
| 3369 | |
Scott James Remnant | b6270dd | 2006-07-13 02:16:38 +0100 | [diff] [blame] | 3370 | 2006-07-13 Scott James Remnant <scott@netsplit.com> |
| 3371 | |
Scott James Remnant | 1bb3514 | 2006-07-13 02:30:58 +0100 | [diff] [blame] | 3372 | * HACKING: Correct incorrect Bazaar URL. |
| 3373 | |
Scott James Remnant | b6270dd | 2006-07-13 02:16:38 +0100 | [diff] [blame] | 3374 | * AUTHORS: Change e-mail address to ubuntu.com. |
| 3375 | * HACKING: Update Bazaar and Release URLS. |
| 3376 | * configure.ac (AC_COPYRIGHT): Change copyright to Canonical Ltd. |
| 3377 | (AC_INIT): Change bug submission address to Launchpad. |
| 3378 | * init/main.c: Update header to use Canonical copyright and |
| 3379 | credit me as author. |
| 3380 | |
Scott James Remnant | 5074884 | 2006-05-16 21:02:31 +0100 | [diff] [blame] | 3381 | 2006-05-16 Scott James Remnant <scott@netsplit.com> |
| 3382 | |
| 3383 | * init/main.c: Add the simplest template main.c |
| 3384 | * init/Makefile.am: Add template Makefile.am that builds init from |
| 3385 | main.c and links to libnih statically |
| 3386 | * configure.ac (AC_CONFIG_FILES): Configure nih and init subdirs. |
| 3387 | * Makefile.am (SUBDIRS): Recurse into nih and init subdirs. |
| 3388 | |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 3389 | 2006-05-14 Scott James Remnant <scott@netsplit.com> |
| 3390 | |
| 3391 | * ChangeLog: Initial project infrastructure created. |