Scott James Remnant | 0ea658f | 2011-03-22 10:46:46 -0700 | [diff] [blame] | 1 | 2011-3-22 Scott James Remnant <scott@netsplit.com> |
| 2 | |
Scott James Remnant | 8c89a7b | 2011-03-22 10:52:25 -0700 | [diff] [blame] | 3 | * NEWS: Release 1.2 |
| 4 | |
Scott James Remnant | 0ea658f | 2011-03-22 10:46:46 -0700 | [diff] [blame] | 5 | * init/job_process.c (job_process_run): Correct shell redirection; |
| 6 | the form we used dosen't work with at least pdksh |
| 7 | |
Scott James Remnant | 74c6f02 | 2011-03-16 14:55:03 -0700 | [diff] [blame] | 8 | 2011-03-16 Scott James Remnant <scott@netsplit.com> |
| 9 | |
Scott James Remnant | de6c4eb | 2011-03-16 18:03:52 -0700 | [diff] [blame] | 10 | * configure.ac: Bump version to 1.2 |
| 11 | * NEWS: Begin new release |
| 12 | |
Scott James Remnant | cef00b8 | 2011-03-16 18:03:01 -0700 | [diff] [blame] | 13 | * NEWS: Release 1.1 |
| 14 | |
| 15 | * configure.ac (NIH_COPYRIGHT): Update |
| 16 | |
Scott James Remnant | 540dcfd | 2011-03-16 15:54:56 -0700 | [diff] [blame] | 17 | * init/main.c: Don't close the console until initialization is |
| 18 | complete. |
| 19 | |
Scott James Remnant | c709577 | 2011-03-16 15:49:20 -0700 | [diff] [blame] | 20 | * util/Makefile.am (uninstall-hook): Clean up symlinks on uninstall |
| 21 | |
Scott James Remnant | 5e32d58 | 2011-03-16 15:42:48 -0700 | [diff] [blame] | 22 | * init/environ.c (environ_all_valid): Only verify that an = is present |
| 23 | (environ_valid): Drop this function, the part of POSIX I read about |
| 24 | valid environment variable names only applies to other things defined |
| 25 | by POSIX, elsewhere it explicitly says Applications may do whatever |
| 26 | they like (and even encourages to avoid conflict) |
| 27 | (environ_expand_until): Remove validity check for name. |
| 28 | * init/environ.h: Update header. |
| 29 | * init/tests/test_environ.c (test_valid): Drop tests. |
| 30 | (test_all_valid): Drop name tests. |
| 31 | (test_expand): Remove illegal expansion test. |
| 32 | * init/tests/test_control.c (test_emit_event): Remove the test case for |
| 33 | an invalid name in the environment. |
| 34 | * init/tests/test_job_class.c (test_start, test_stop) |
| 35 | (test_restart): Change the invalid argument tests to use an entry |
| 36 | without an = as the invalid test. |
| 37 | |
Scott James Remnant | 2e05526 | 2011-03-16 15:15:58 -0700 | [diff] [blame] | 38 | * util/reboot.c: pass '-H' to shutdown when called as 'halt' |
| 39 | |
Scott James Remnant | 36fa116 | 2011-03-16 15:11:24 -0700 | [diff] [blame] | 40 | * init/job_process.c (job_process_handler): Check the job's normal exit |
| 41 | list, decrease log priority of messages from warning to information if |
| 42 | the exit status or signal is in the list. |
| 43 | * init/tests/test_job_process.c (test_handler): Change the normal exit |
| 44 | test cases to not expect the warning |
| 45 | |
Scott James Remnant | 74c6f02 | 2011-03-16 14:55:03 -0700 | [diff] [blame] | 46 | * init/job_process.c (job_process_run): Prepend a shell command to the |
| 47 | pasted script to force the shell to close the file descriptor being |
| 48 | used to paste the script. The shell will already have a new copy when |
| 49 | it opened the path. |
| 50 | |
James Hunt | 3813073 | 2011-03-15 11:44:09 -0700 | [diff] [blame] | 51 | 2011-03-15 James Hunt <james.hunt@ubuntu.com> |
| 52 | |
| 53 | * init/conf.c (conf_source_reload, conf_source_reload_dir): Fix typos |
| 54 | in doc-strings |
| 55 | * init/job_process.c (job_process_run): Fix typo in doc-string |
| 56 | * init/parse_job.c (stanza_env): Fix typo in doc-string |
| 57 | |
Patty Langasek | 77be936 | 2011-03-15 11:36:57 -0700 | [diff] [blame] | 58 | 2011-03-15 Patty Langasek <harmoney@dodds.net> |
| 59 | |
| 60 | * init/man/init.5: Grammar fixes |
| 61 | |
Jacek Konieczny | 2dbfe53 | 2011-03-15 11:30:57 -0700 | [diff] [blame] | 62 | 2011-03-15 Jacek Konieczny <jajcus@jajcus.net> |
| 63 | |
| 64 | * contrib/vim/syntax/upstart.vim: Further improve syntax hilighting |
| 65 | |
Scott James Remnant | 410a035 | 2011-03-01 20:56:51 -0800 | [diff] [blame] | 66 | 2011-03-01 Scott James Remnant <scott@netsplit.com> |
| 67 | |
Scott James Remnant | f1d5777 | 2011-03-01 21:15:33 -0800 | [diff] [blame] | 68 | * configure.ac: Bump version to 1.1 |
| 69 | * NEWS: Begin new release |
| 70 | |
Scott James Remnant | 410a035 | 2011-03-01 20:56:51 -0800 | [diff] [blame] | 71 | * NEWS: Release 1.0 |
| 72 | |
Scott James Remnant | 02977f8 | 2011-02-17 15:33:04 -0800 | [diff] [blame] | 73 | 2011-02-17 Scott James Remnant <scott@netsplit.com> |
| 74 | |
Scott James Remnant | 6b667b1 | 2011-02-17 15:38:40 -0800 | [diff] [blame] | 75 | * configure.ac, NEWS: Bump version to 1.0 |
| 76 | * TODO: Update. |
| 77 | |
Scott James Remnant | 02977f8 | 2011-02-17 15:33:04 -0800 | [diff] [blame] | 78 | * init/tests/test_conf.c (test_source_reload_job_dir): Add tests for |
| 79 | a crasher bug when a file is created called ".conf" |
| 80 | * init/conf.c (conf_dir_filter): Apply fix for the crasher; check that |
| 81 | the character before the ".conf" extension is not "/" |
| 82 | * NEWS: Update. |
| 83 | |
Petr Lautrbach | a87b18b | 2011-01-06 07:37:59 +0000 | [diff] [blame] | 84 | 2011-01-06 Petr Lautrbach <plautrba@redhat.com> |
| 85 | |
| 86 | * init/job_process.c (job_process_termianted): Don't rewind the |
| 87 | utmp file between updates. |
| 88 | * init/tests/test_job_process.c (test_utmp): Add test case for |
| 89 | newer mingetty behaviour. |
| 90 | |
Scott James Remnant | 9c6a203 | 2010-12-21 13:54:49 +0000 | [diff] [blame] | 91 | 2010-12-21 James Hunt <james.hunt@ubuntu.com> |
| 92 | |
| 93 | * contrib/bash_completion/upstart: Add bash completion script. |
| 94 | * contrib/Makefile.am (EXTRA_DIST): Include in tarball. |
| 95 | * NEWS: Update. |
| 96 | |
Scott James Remnant | e5e2069 | 2010-12-20 09:57:55 +0000 | [diff] [blame] | 97 | 2010-12-20 Scott James Remnant <scott@netsplit.com> |
| 98 | |
| 99 | * NEWS: update. |
| 100 | |
Petr Lautrbach | 18ff78d | 2010-12-20 09:46:30 +0000 | [diff] [blame] | 101 | 2010-12-20 Petr Lautrbach <plautrba@redhat.com> |
| 102 | |
Petr Lautrbach | 0fa3d32 | 2010-12-20 09:50:06 +0000 | [diff] [blame] | 103 | * init/job_process.c (job_process_terminated): On termination of |
| 104 | a job, update the utmp file replacing any existing entry for that |
| 105 | pid with a DEAD_PROCESS entry; likewise append an entry to wtmp. |
| 106 | * init/tests/test_job_process.c (test_utmp): Test utmp handling. |
| 107 | |
Petr Lautrbach | 18ff78d | 2010-12-20 09:46:30 +0000 | [diff] [blame] | 108 | * util/shutdown.c: Exit non-zero if unable to shutdown the system. |
| 109 | |
Scott James Remnant | 8d4c737 | 2010-12-14 15:30:06 +0000 | [diff] [blame] | 110 | 2010-12-14 Scott James Remnant <scott@netsplit.com> |
| 111 | |
Scott James Remnant | 42fb11b | 2010-12-14 16:41:18 +0000 | [diff] [blame] | 112 | * configure.ac: Bump version to 0.6.8 |
| 113 | * NEWS: Begin new release |
| 114 | |
Scott James Remnant | 5f66d4d | 2010-12-14 16:40:26 +0000 | [diff] [blame] | 115 | * NEWS: Release 0.6.7 |
| 116 | |
Scott James Remnant | 8d4c737 | 2010-12-14 15:30:06 +0000 | [diff] [blame] | 117 | * dbus/com.ubuntu.Upstart.Job.xml (start_on, stop_on, emits): Add new |
| 118 | properties to return the job's relationship to events. |
| 119 | * init/job_class.c (job_class_get_start_on) |
| 120 | (job_class_get_stop_on, job_class_get_emits): Implement the properties |
| 121 | * init/job_class.h: Add prototypes. |
| 122 | * init/tests/test_job_class.c (test_get_start_on) |
| 123 | (test_get_stop_on, test_get_emits): Test the new properties too |
| 124 | |
Scott James Remnant | 3cf4638 | 2010-12-14 12:20:28 +0000 | [diff] [blame] | 125 | 2010-12-14 James Hunt <james.hunt@ubuntu.com> |
James Hunt | b75bd61 | 2010-12-14 11:40:13 +0000 | [diff] [blame] | 126 | |
James Hunt | f5ee6b9 | 2010-12-14 16:15:46 +0000 | [diff] [blame] | 127 | * init/parse_job.c (stanza_manual): New function to handle manual |
| 128 | stanza. |
| 129 | * init/tests/test_parse_job.c (test_stanza_manual): New function to |
| 130 | test manual stanza. |
| 131 | * init/man/init.5: Update for manual stanza. |
| 132 | |
| 133 | 2010-12-14 James Hunt <james.hunt@ubuntu.com> |
| 134 | |
James Hunt | b75bd61 | 2010-12-14 11:40:13 +0000 | [diff] [blame] | 135 | * init/job_class.h: Added debug member. |
| 136 | * init/job_class.c: Initialized debug member. |
| 137 | * init/job_process.c: Pause child using raise(3). |
| 138 | * init/main.c: Display PID+PPID for debug builds. |
| 139 | * init/parse_job.c: Added new function stanza_debug. |
| 140 | * init/tests/test_job_process.c (test_spawn): Added test for debug stanza. |
| 141 | |
Scott James Remnant | a6c0536 | 2010-12-10 04:04:51 +0000 | [diff] [blame] | 142 | 2010-12-10 Scott James Remnant <scott@netsplit.com> |
| 143 | |
| 144 | * dbus/upstart.h (DBUS_SERVICE_UPSTART, DBUS_ADDRESS_UPSTART): |
| 145 | For debugging purposes, when -DDEBUG is given, change the values of |
| 146 | these constants. You'll need to modify your own D-Bus configuration |
| 147 | of course. |
| 148 | |
Scott James Remnant | 8925814 | 2010-12-09 21:10:38 +0000 | [diff] [blame] | 149 | 2010-12-09 Scott James Remnant <scott@netsplit.com> |
| 150 | |
| 151 | * init/tests/test_job.c (test_change_state): Add missing |
| 152 | DBUS_TYPE_INVALID to dbus_message_get_args() call. |
| 153 | |
Scott James Remnant | 48ac088 | 2010-12-09 21:04:03 +0000 | [diff] [blame] | 154 | 2010-12-08 Colin Watson <cjwatson@debian.org> |
Colin Watson | e2d8fac | 2010-11-13 02:44:08 +0000 | [diff] [blame] | 155 | |
Scott James Remnant | 48ac088 | 2010-12-09 21:04:03 +0000 | [diff] [blame] | 156 | * dbus/com.ubuntu.Upstart.Instance.xml (GoalChanged, StateChanged) |
| 157 | (Failed): New signals. |
Colin Watson | e2d8fac | 2010-11-13 02:44:08 +0000 | [diff] [blame] | 158 | * init/job.c (job_change_goal): Emit GoalChanged signal after |
Scott James Remnant | 48ac088 | 2010-12-09 21:04:03 +0000 | [diff] [blame] | 159 | (job_change_state): Emit StateChanged signal after changing state. |
Colin Watson | 874aab1 | 2010-11-13 01:47:34 +0000 | [diff] [blame] | 160 | (job_failed): Emit Failed signal after marking job as failed. |
Scott James Remnant | 48ac088 | 2010-12-09 21:04:03 +0000 | [diff] [blame] | 161 | * init/tests/test_job.c (test_change_goal): Test for this. |
| 162 | (test_change_state): Test for this. |
Colin Watson | 8ed1c1e | 2010-11-10 23:23:22 +0000 | [diff] [blame] | 163 | * NEWS: Update. |
| 164 | |
Scott James Remnant | 3cf4638 | 2010-12-14 12:20:28 +0000 | [diff] [blame] | 165 | 2010-12-08 James Hunt <james.hunt@ubuntu.com> |
Scott James Remnant | 87796f6 | 2010-12-08 18:40:25 +0000 | [diff] [blame] | 166 | |
| 167 | * init/event.c, init/event_operator.c: Fix grammar and factual errors |
| 168 | in comments. |
| 169 | * init/man/init.5: Fix grammar errors and clarify export behaviour. |
| 170 | |
Scott James Remnant | da55fa1 | 2010-12-08 18:33:41 +0000 | [diff] [blame] | 171 | 2010-12-08 Clint Byrum <clint@ubuntu.com> |
| 172 | |
| 173 | * init/man/init.5: Typo existing -> exiting |
| 174 | |
Scott James Remnant | dcf52cf | 2010-08-12 09:49:45 -0400 | [diff] [blame] | 175 | 2010-08-12 Scott James Remnant <scott@netsplit.com> |
| 176 | |
| 177 | * init/job_process.c (job_process_spawn): We can fail to open the |
| 178 | system console for various reasons, sometimes because there isn't |
| 179 | a console (ENXIO or ENODEV) but worse due to kernel race conditions |
| 180 | on SMP/multi-core systems (EIO). If "console output" is used, and |
| 181 | these happen, fall back to /dev/null. |
| 182 | |
Scott James Remnant | bc23b12 | 2010-04-27 10:10:19 -0700 | [diff] [blame] | 183 | 2010-04-27 Scott James Remnant <scott@netsplit.com> |
| 184 | |
Scott James Remnant | 319bde1 | 2010-04-27 12:48:44 -0700 | [diff] [blame] | 185 | * configure.ac: Bump version to 0.6.7 |
| 186 | * NEWS: Begin new release |
| 187 | |
Scott James Remnant | 98c65a6 | 2010-04-27 12:29:17 -0700 | [diff] [blame] | 188 | * NEWS: Release 0.6.6 |
| 189 | |
Scott James Remnant | bc23b12 | 2010-04-27 10:10:19 -0700 | [diff] [blame] | 190 | * configure.ac: Bump the requirement of libnih to 1.0.2 after |
| 191 | verifying that building using --with-local-libnih and an earlier |
| 192 | version installed still works. |
| 193 | |
Scott James Remnant | ef97154 | 2010-04-24 23:18:56 -0700 | [diff] [blame] | 194 | 2010-04-24 Scott James Remnant <scott@netsplit.com> |
| 195 | |
| 196 | * configure.ac: Replace the --with-local-libnih code with an |
| 197 | expansion of the NIH_WITH_LOCAL_LIBNIH macro that now contains it. |
| 198 | * README: Bump libnih version. |
| 199 | |
Colin Watson | e9633c9 | 2010-03-31 18:29:24 +0100 | [diff] [blame] | 200 | 2010-03-31 Colin Watson <cjwatson@ubuntu.com> |
| 201 | |
| 202 | * init/man/init.5 (env): Document behaviour when the environment |
| 203 | variable's value is omitted. |
| 204 | * init/parse_job.c (stanza_env): Document that arguments may be |
| 205 | simply VAR as well as VAR=VALUE. |
| 206 | |
Michael Biebl | 862fe18 | 2010-03-02 00:03:37 +0000 | [diff] [blame] | 207 | 2010-03-02 Michael Biebl <mbiebl@gmail.com> |
| 208 | |
| 209 | * configure.ac: Remove double-quoting from NIH_CFLAGS and |
| 210 | NIH_DBUS_CFLAGS when using --with-local-libnih |
| 211 | |
Scott James Remnant | 5ac1835 | 2010-02-26 15:27:14 +0000 | [diff] [blame] | 212 | 2010-02-26 Scott James Remnant <scott@netsplit.com> |
| 213 | |
Scott James Remnant | 51d109b | 2010-02-26 15:33:12 +0000 | [diff] [blame] | 214 | * NEWS: Update. |
| 215 | |
Scott James Remnant | 65ea7a6 | 2010-02-26 15:31:13 +0000 | [diff] [blame] | 216 | * init/job_process.c (job_process_run): Since /proc is always mounted, |
| 217 | guaranteed because we mount it ourselves if it isn't, we don't need |
| 218 | to check for it and can always use /proc/self/fd/NNN when we want. |
| 219 | * init/tests/test_job_process.c (test_run): Since /proc is always |
| 220 | mounted, we don't need to check for it and skip tests. |
| 221 | |
Scott James Remnant | d69c1da | 2010-02-26 15:29:07 +0000 | [diff] [blame] | 222 | * init/system.c (system_mount): Add function to mount a kernel |
| 223 | filesystem (ie. /proc and /sys) |
| 224 | * init/system.h: Add header. |
| 225 | * init/main.c: Mount /proc and /sys on initialisation. |
| 226 | |
Scott James Remnant | 5ac1835 | 2010-02-26 15:27:14 +0000 | [diff] [blame] | 227 | * init/paths.h (DEV_FD): Drop this definition, it's needless. |
| 228 | * init/job_process.c (job_process_run): Rather than using /dev/fd, |
| 229 | use /proc/self/fd which is more Linuxish and is always guaranteed to |
| 230 | exist when /proc is mounted - needing no symlinks. |
| 231 | * init/tests/test_job_process.c (test_run): Adjust test to match. |
| 232 | |
Scott James Remnant | b90310b | 2010-02-09 16:06:55 +0000 | [diff] [blame] | 233 | 2010-02-09 Scott James Remnant <scott@netsplit.com> |
| 234 | |
| 235 | * configure.ac: Use NIH_COPYRIGHT instead of AC_COPYRIGHT |
| 236 | |
Scott James Remnant | 866bfd9 | 2010-02-04 00:39:08 -0800 | [diff] [blame] | 237 | 2010-02-04 Scott James Remnant <scott@netsplit.com> |
| 238 | |
Scott James Remnant | aca7564 | 2010-02-04 16:40:04 -0800 | [diff] [blame] | 239 | * configure.ac: Bump version to 0.6.6 |
| 240 | * NEWS: Begin new release |
| 241 | |
Scott James Remnant | bfae97b | 2010-02-04 15:06:41 -0800 | [diff] [blame] | 242 | * NEWS: Release 0.6.5 |
| 243 | |
Scott James Remnant | 43af8c6 | 2010-02-04 12:43:33 -0800 | [diff] [blame] | 244 | * util/tests/test_initctl.c (test_reload_action): Don't send |
| 245 | SIGHUP to the server process, it'll be terminated anyway since |
| 246 | reload doesn't loop. |
| 247 | |
Scott James Remnant | 9f23647 | 2010-02-04 12:08:59 -0800 | [diff] [blame] | 248 | * init/event_operator.c (event_operator_match): Support operator |
| 249 | negation using != |
| 250 | * init/tests/test_event_operator.c (test_operator_update): Add |
| 251 | test cases for negation. |
| 252 | * init/man/init.5: Add negation to documentation |
| 253 | |
Scott James Remnant | d5890b3 | 2010-02-04 11:26:17 -0800 | [diff] [blame] | 254 | * init/man/init.8: Improve reference to init(5) to make it more |
| 255 | obvious that this is where documentation can be found. |
| 256 | * init/man/init.5: Add Upstart to the title to make it show up |
| 257 | with man -k upstart |
| 258 | |
Scott James Remnant | 7b50f2b | 2010-02-04 11:24:25 -0800 | [diff] [blame] | 259 | * init/man/init.8: Add missing OPTIONS section, documenting the |
| 260 | --verbose option. |
| 261 | |
Scott James Remnant | f99ea0c | 2010-02-04 11:14:30 -0800 | [diff] [blame] | 262 | * init/main.c (main): After resetting the system console, close it |
| 263 | again and reopen /dev/null for ourselves so we don't hold the |
| 264 | system console open. |
| 265 | |
Scott James Remnant | 3494001 | 2010-02-04 11:09:55 -0800 | [diff] [blame] | 266 | * init/job_process.c (job_process_error_abort): Free the error |
| 267 | before exiting. |
| 268 | |
Scott James Remnant | 004d8c0 | 2010-02-04 11:08:07 -0800 | [diff] [blame] | 269 | * util/initctl.c (reload_action): Add a reload command, this obtains |
| 270 | the pid of the main process of the given job instance and sends |
| 271 | SIGHUP to it. It might not be in its final form, but it's damned |
| 272 | useful for now. |
| 273 | * util/tests/test_initctl.c (test_reload_action): Add test cases. |
| 274 | * util/man/initctl.8: Add documentation for the reload command, |
| 275 | and missing documentation for restart. |
| 276 | * util/Makefile.am (install-data-hook, install-exec-hook): Create |
| 277 | additional reload symlinks. |
| 278 | |
Scott James Remnant | 6162629 | 2010-02-04 00:43:56 -0800 | [diff] [blame] | 279 | * util/reboot.c (main): Restore the sync() system call before |
| 280 | calling reboot(); the Linux kernel says we have to do this, and I |
| 281 | suspect that ext4 is no longer forcing this before power off. |
| 282 | |
Scott James Remnant | e713805 | 2010-02-04 00:41:25 -0800 | [diff] [blame] | 283 | * init/main.c (hup_handler): Move call to reconnect to D-Bus system |
| 284 | bus into new function |
| 285 | (usr1_handler): This is because a config reload "forgets" existing |
| 286 | state, such as events that were pending. |
| 287 | (main): Add SIGUSR1 signal handler. |
| 288 | |
Scott James Remnant | 866bfd9 | 2010-02-04 00:39:08 -0800 | [diff] [blame] | 289 | * init/job_process.c (job_process_handler): Reduce priority of the |
| 290 | stopped/continued by signal messages to informational. |
| 291 | |
Scott James Remnant | 6d61066 | 2010-02-03 20:00:11 -0800 | [diff] [blame] | 292 | 2010-02-03 Scott James Remnant <scott@netsplit.com> |
| 293 | |
| 294 | * util/shutdown.c (shutdown_now): Free error before exiting. |
| 295 | |
Johan Kiviniemi | 7ea666f | 2010-02-03 19:59:06 -0800 | [diff] [blame] | 296 | 2010-02-03 Johan Kiviniemi <johan@kiviniemi.name> |
| 297 | |
| 298 | * conf/rc-sysinit.conf: Don't replace DEFAULT_RUNLEVEL with an |
| 299 | empty string when there is no "initdefault" line in /etc/inittab |
| 300 | |
Scott James Remnant | b3918a6 | 2010-02-03 16:39:50 -0800 | [diff] [blame] | 301 | 2010-02-03 Scott James Remnant <scott@netsplit.com> |
| 302 | |
Scott James Remnant | 8003b88 | 2010-02-03 19:56:40 -0800 | [diff] [blame] | 303 | Update code to work with libnih 1.0.1 |
| 304 | |
| 305 | * init/tests/test_event.c (test_new): Replace TEST_ALLOC_ORPHAN(env) |
| 306 | with TEST_ALLOC_PARENT(env, NULL); discard environment after creating |
| 307 | event from it |
| 308 | * init/tests/test_event_operator.c (test_operator_new): Replace |
| 309 | TEST_ALLOC_ORPHAN(env) with TEST_ALLOC_PARENT(env, NULL); discard |
| 310 | environment after creating event from it |
| 311 | * init/tests/test_control.c (test_emit_event): Discard event |
| 312 | environment after emission |
| 313 | * init/init.supp: Add nih_alloc_ref_new() to init functions |
| 314 | |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 315 | libnih is now released as its own project, so rather than expecting |
| 316 | to include it with the source we depend on it being outside of it. |
| 317 | |
| 318 | * Makefile.am (SUBDIRS): Remove m4 directory along with the nih bits. |
| 319 | (EXTRA_DIST): Remove ChangeLog.nih |
| 320 | * configure.ac (AM_INIT_AUTOMAKE): Remove dist-bzip2, since we don't |
| 321 | actually use it; add color-tests and silent-rules. |
| 322 | (AM_SILENT_RULES): Use silent rules by default |
| 323 | (AM_MAINTAINER_MODE): Enable maintainer mode by default (as before), |
| 324 | but allow it to be disabled |
| 325 | (AM_GNU_GETTEXT_VERSION): Bump to 0.17 |
| 326 | (NIH_INIT): Replace with the expanded out calls that we actually need. |
| 327 | (AC_CONFIG_FILES): Remove nih directories |
| 328 | Add magic to allow use of a local libnih source tree. |
| 329 | * init/Makefile.am (AM_CFLAGS): Add NIH_CFLAGS and NIH_DBUS_CFLAGS |
| 330 | (init_LDADD, test_system_LDADD, test_environ_LDADD, test_process_LDADD) |
| 331 | (test_job_class_LDADD, test_job_process_LDADD, test_job_LDADD) |
| 332 | (test_event_LDADD, test_event_operator_LDADD) |
| 333 | (test_blocked_LDADD, test_parse_job_LDADD) |
| 334 | (test_parse_conf_LDADD, test_conf_LDADD, test_control_LDADD): |
| 335 | Replace library paths with NIH_LIBS and NIH_DBUS_LIBS |
| 336 | ($(com_ubuntu_Upstart_OUTPUTS)), |
| 337 | ($(com_ubuntu_Upstart_Job_OUTPUTS)), |
| 338 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Use external nih-dbus-tool |
| 339 | and obey silent rules. |
| 340 | (test_system_LDFLAGS, test_environ_LDFLAGS) |
| 341 | (test_process_LDFLAGS, test_job_class_LDFLAGS) |
| 342 | (test_job_process_LDFLAGS, test_job_LDFLAGS, test_event_LDFLAGS) |
| 343 | (test_event_operator_LDFLAGS, test_blocked_LDFLAGS) |
| 344 | (test_parse_job_LDFLAGS, test_parse_conf_LDFLAGS) |
| 345 | (test_conf_LDFLAGS, test_control_LDFLAGS): Drop -static |
| 346 | * util/Makefile.am (AM_CFLAGS): Add NIH_CFLAGS and NIH_DBUS_CFLAGS |
| 347 | (initctl_LDADD, reboot_LDADD, runlevel_LDADD, shutdown_LDADD) |
| 348 | (test_initctl_LDADD, test_utmp_LDADD, test_sysv_LDADD) |
| 349 | (test_telinit_LDADD): Replace library paths with NIH_LIBS and |
| 350 | NIH_DBUS_LIBS |
| 351 | ($(com_ubuntu_Upstart_OUTPUTS)): |
| 352 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): |
| 353 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Use external nih-dbus-tool |
| 354 | and obey silent rules. |
| 355 | (initctl_LDFLAGS, reboot_LDFLAGS, runlevel_LDFLAGS) |
| 356 | (shutdown_LDFLAGS, telinit_LDFLAGS, test_initctl_LDFLAGS) |
| 357 | (test_utmp_LDFLAGS, test_sysv_LDFLAGS, test_telinit_LDFLAGS): Drop |
| 358 | -static |
| 359 | * README: Add libnih to the dependencies. |
| 360 | * HACKING: Remove the instructions for checking out libnih, replace |
| 361 | with a description about how to use a libnih source tree instead of |
| 362 | the installed one. |
| 363 | |
Scott James Remnant | b3918a6 | 2010-02-03 16:39:50 -0800 | [diff] [blame] | 364 | * configure.ac: Bump version to 0.6.5, bump copyright year to 2010. |
| 365 | * NEWS: Begin new release. |
| 366 | |
Scott James Remnant | facdb67 | 2009-08-02 20:01:34 +0100 | [diff] [blame] | 367 | 2009-08-02 Scott James Remnant <scott@netsplit.com> |
| 368 | |
| 369 | * NEWS: Release 0.6.3 |
| 370 | |
Scott James Remnant | 826b876 | 2009-08-01 19:08:50 +0100 | [diff] [blame] | 371 | 2009-08-01 Scott James Remnant <scott@netsplit.com> |
| 372 | |
| 373 | * init/tests/test_job_process.c (test_handler): Add a missing test |
| 374 | case for the running process exiting while we're in the stopping |
| 375 | state. |
| 376 | * init/job_process.c (job_process_terminated): Don't change the |
| 377 | state or record failure information if we're in the stopping state |
| 378 | when the main process dies, otherwise we hit an assertion later; |
| 379 | just wait for the stopping event to finish and carry on as before. |
| 380 | |
Scott James Remnant | 1eb8143 | 2009-07-31 12:34:43 +0100 | [diff] [blame] | 381 | 2009-07-31 Scott James Remnant <scott@netsplit.com> |
| 382 | |
| 383 | * dbus/upstart.h: Allow the service name and address to be overriden |
| 384 | |
Michael Biebl | 5e2f15b | 2009-07-29 11:18:47 +0100 | [diff] [blame] | 385 | 2009-07-29 Michael Biebl <mbiebl@gmail.com> |
| 386 | |
| 387 | * init/tests/test_job_process.c: Add missing sys/ptrace.h include |
| 388 | |
Scott James Remnant | beae7f2 | 2009-07-21 12:27:55 +0100 | [diff] [blame] | 389 | 2009-07-21 Scott James Remnant <scott@netsplit.com> |
| 390 | |
Scott James Remnant | 726290a | 2009-07-21 18:31:35 +0100 | [diff] [blame] | 391 | * configure.ac: Bump version to 0.6.3 |
| 392 | * NEWS: Begin new release |
| 393 | |
Scott James Remnant | 73e8fd3 | 2009-07-21 18:30:51 +0100 | [diff] [blame] | 394 | * NEWS: Release 0.6.2 |
| 395 | |
Scott James Remnant | 9d736bb | 2009-07-21 18:15:20 +0100 | [diff] [blame] | 396 | * init/main.c (crash_handler): Restore missing chdir ("/") call. |
| 397 | |
Scott James Remnant | 0a0c47d | 2009-07-21 13:03:23 +0100 | [diff] [blame] | 398 | * init/tests/test_job_process.c (test_handler): We should allow |
| 399 | a job to exec() before it calls fork() to allow shell scripts to |
| 400 | exec daemons. |
| 401 | * init/job_process.c (job_process_trace_exec): Continue the traced |
| 402 | process instead of detaching if it has not yet forked. |
| 403 | |
Scott James Remnant | beae7f2 | 2009-07-21 12:27:55 +0100 | [diff] [blame] | 404 | * init/job.c (job_change_state): Obvious bug fix; the set of states |
| 405 | into which we can enter JOB_STOPPING includes JOB_STARTING because |
| 406 | we can get the "stop" event or command there. |
| 407 | |
Scott James Remnant | e6de045 | 2009-07-16 17:26:00 +0100 | [diff] [blame] | 408 | 2009-07-16 Scott James Remnant <scott@netsplit.com> |
| 409 | |
Scott James Remnant | 9c37230 | 2009-07-16 18:08:52 +0100 | [diff] [blame] | 410 | * configure.ac: Bump version to 0.6.2 |
| 411 | * NEWS: Begin new release |
| 412 | |
Scott James Remnant | b52deb1 | 2009-07-16 18:05:31 +0100 | [diff] [blame] | 413 | * NEWS: Release 0.6.1 |
| 414 | |
Scott James Remnant | 3ef8fac | 2009-07-16 17:39:04 +0100 | [diff] [blame] | 415 | * util/runlevel.c: Output the path before the error message, |
| 416 | to make it clear that it's the utmp file missing not runlevel. |
| 417 | |
Scott James Remnant | e6de045 | 2009-07-16 17:26:00 +0100 | [diff] [blame] | 418 | * util/runlevel.c: If there is no current runlevel because the |
| 419 | environment variable is empty, output "unknown" instead of "N N". |
| 420 | |
Scott James Remnant | 0acfdc5 | 2009-07-15 11:13:46 +0100 | [diff] [blame] | 421 | 2009-07-15 Scott James Remnant <scott@netsplit.com> |
| 422 | |
| 423 | * README: Now that D-Bus 1.2.16 proper has been released, update |
| 424 | our requirements. |
| 425 | |
Scott James Remnant | 6ca3c75 | 2009-07-14 11:40:08 +0100 | [diff] [blame] | 426 | 2009-07-14 Scott James Remnant <scott@netsplit.com> |
| 427 | |
Scott James Remnant | 9f17521 | 2009-07-14 18:45:47 +0100 | [diff] [blame] | 428 | * TODO: Update |
| 429 | |
Scott James Remnant | cf9f3ce | 2009-07-14 14:55:47 +0100 | [diff] [blame] | 430 | * init/tests/test_job_process.c (test_handler): Rework the existing |
| 431 | ptrace fork handler test case to make sure we test the case where |
| 432 | we get the fork event before the stopped child. Add a second test |
| 433 | case for the opposite (stopped child before the fork event) which |
| 434 | we don't currently handle. |
| 435 | * init/job_process.c (job_process_trace_fork): Test for the missed |
| 436 | child event using ptrace(), if it succeeds the child is ready so |
| 437 | we can just assume we had the event. |
| 438 | |
Scott James Remnant | 5de1bfe | 2009-07-14 12:34:49 +0100 | [diff] [blame] | 439 | * util/Makefile.am (EXTRA_DIST): Distribute the valgrind suppressions |
| 440 | file |
| 441 | |
Scott James Remnant | 92ac1ce | 2009-07-14 12:04:34 +0100 | [diff] [blame] | 442 | * util/tests/test_utmp.c (test_write_shutdown): Additional instance |
| 443 | of the same test. |
| 444 | |
Scott James Remnant | 6ca3c75 | 2009-07-14 11:40:08 +0100 | [diff] [blame] | 445 | * util/tests/test_utmp.c (test_write_runlevel): Looks like glibc |
| 446 | is fixed to return the right error code. |
| 447 | |
Scott James Remnant | ce95ce2 | 2009-07-11 12:46:57 +0100 | [diff] [blame] | 448 | 2009-07-11 Scott James Remnant <scott@netsplit.com> |
| 449 | |
Scott James Remnant | de9cacb | 2009-07-11 12:47:12 +0100 | [diff] [blame] | 450 | * init/control.c (control_server_open): Don't hardcode the server |
| 451 | address, otherwise the test suite can't test this function. |
| 452 | * init/tests/test_control.c (test_server_open) |
| 453 | (test_server_connect, test_server_close): Change the server |
| 454 | address in the tests. |
| 455 | |
Scott James Remnant | ce95ce2 | 2009-07-11 12:46:57 +0100 | [diff] [blame] | 456 | * configure.ac: Bump version to 0.6.1 |
| 457 | * NEWS: Begin new release |
| 458 | |
Scott James Remnant | 6e17785 | 2009-07-09 00:09:09 +0100 | [diff] [blame] | 459 | 2009-07-09 Scott James Remnant <scott@netsplit.com> |
| 460 | |
Scott James Remnant | 11caefc | 2009-07-09 17:18:26 +0100 | [diff] [blame] | 461 | * NEWS: Release 0.6.0 |
| 462 | |
Scott James Remnant | 057a869 | 2009-07-09 16:40:34 +0100 | [diff] [blame] | 463 | * README: Note that we need D-Bus GIT HEAD. |
| 464 | * NEWS: Update. |
| 465 | |
Scott James Remnant | 6e56843 | 2009-07-09 16:01:07 +0100 | [diff] [blame] | 466 | * init/man/inittab.5: People keep trying "man inittab", so explain |
| 467 | that it's gone. |
| 468 | * init/Makefile.am (dist_man_MANS): Install it |
| 469 | |
Scott James Remnant | 7c23b1f | 2009-07-09 15:56:49 +0100 | [diff] [blame] | 470 | * NEWS: Declare the "lacks documentation" bug fixed |
| 471 | |
Scott James Remnant | 8bdf071 | 2009-07-09 15:54:28 +0100 | [diff] [blame] | 472 | * init/man/init.8: Refresh and turn it into more of an overview |
| 473 | of Upstart now that we have lots of other pages to refer to. |
| 474 | * init/man/upstart.7: Since it's an overview, people might go |
| 475 | "man upstart" so redirect to it. |
| 476 | * init/man/init.5: Actually document the configuration format. |
| 477 | * init/Makefile.am (dist_man_MANS): Install the configuration |
| 478 | documentation, and the redirect. |
| 479 | |
Scott James Remnant | a5b683a | 2009-07-09 14:21:16 +0100 | [diff] [blame] | 480 | * util/man/runlevel.8, util/man/telinit.8, util/man/shutdown.8, |
| 481 | * util/man/reboot.8: Add environment and files sections. |
| 482 | |
Scott James Remnant | 8a50b2c | 2009-07-09 13:26:11 +0100 | [diff] [blame] | 483 | * init/man/startup.7, init/man/starting.7, init/man/started.7, |
| 484 | * init/man/stopping.7, init/man/stopped.7 |
| 485 | * init/man/control-alt-delete.7, init/man/keyboard-request.7, |
| 486 | * init/man/power-status-changed.7: Write manual pages for each |
| 487 | of the events generated by the init daemon by default. |
| 488 | * init/Makefile.am (dist_man_MANS): Distribute and install the |
| 489 | new manpages. |
| 490 | * util/man/runlevel.7: Indent the example, don't boldface |
| 491 | |
Scott James Remnant | b175de8 | 2009-07-09 12:50:19 +0100 | [diff] [blame] | 492 | * init/job.c (job_start, job_stop, job_restart): Restructure |
| 493 | slightly to avoid gcc warning |
| 494 | * init/job_class.c (job_class_start, job_class_restart): Make the |
| 495 | same change to these too |
| 496 | * util/shutdown.c: Warn if we can't change directory |
| 497 | * util/telinit.c: Assert that we don't fall out of the switch |
| 498 | * init/tests/test_job_class.c (test_get_version) |
| 499 | (test_get_author, test_get_description, test_get_name): Initialise |
| 500 | alloc-safe variables to NULL to avoid gcc warning |
| 501 | * util/tests/test_initctl.c (test_job_status, test_start_action) |
| 502 | (test_stop_action, test_restart_action, test_status_action) |
| 503 | (test_list_action, test_emit_action) |
| 504 | (test_reload_configuration_action, test_version_action) |
| 505 | (test_log_priority_action, test_upstart_open): Initialise alloc-safe |
| 506 | variables to NULL and diverted return values to 0 to avoid gcc |
| 507 | warnings. |
| 508 | (test_start_action, test_stop_action, test_restart_action): |
| 509 | Replace sigsetjmp/siglongjmp with a call to _exit() in the handler |
| 510 | * util/tests/test_sysv.c (test_change_runlevel): Initialise alloc-safe |
| 511 | variables to NULL to avoid gcc warnings |
| 512 | |
Scott James Remnant | e5cadae | 2009-07-09 12:02:06 +0100 | [diff] [blame] | 513 | * util/man/runlevel.7: Formatting fixes, and mention that rcS |
| 514 | runs rc-sysinit again. |
| 515 | * util/man/runlevel.8: s/utilities/tools/ |
| 516 | * util/man/telinit.8: s/utilities/tools/ |
| 517 | * util/man/shutdown.8: s/utilities/tools/ |
| 518 | * util/man/reboot.8: s/utilities/programs/ |
| 519 | * util/man/initctl.8: s/utility/tool/ |
| 520 | |
Scott James Remnant | 60d91ea | 2009-07-09 12:01:53 +0100 | [diff] [blame] | 521 | * init/job_class.h (JobClass): Drop the leader option; at the time |
| 522 | it seemed to make sense that Upstart would provide a "daemon"-like |
| 523 | environment, but it really doesn't in practice. Software should |
| 524 | feel safe to daemonise on its own, and I'd rather fix supervision |
| 525 | of those; freeing up Upstart jobs to run as new sessions by default |
| 526 | again. This is also the only real option that would change the |
| 527 | behaviour between 0.6 and 0.10 in an awkwardly compatible way. |
| 528 | * init/job_class.c (job_class_new): Remove leader initialisation |
| 529 | * init/tests/test_job_class.c (test_new): Drop the initialisation |
| 530 | check for leader |
| 531 | * init/parse_job.c (stanza_session): Drop the stanza |
| 532 | * init/tests/test_parse_job.c (test_stanza_session): Drop the |
| 533 | stanza test cases. |
| 534 | * init/job_process.c (job_process_spawn): Drop the double-fork. |
| 535 | This means we don't need to read the pid of our extra child either. |
| 536 | (job_process_error_read): we no longer need a fork error. |
| 537 | * init/job_process.h (JobProcessErrorType): Drop the fork error. |
| 538 | * init/tests/test_job_process.c (test_spawn): Replace the simple job |
| 539 | test case with the session leader test case, now that's the default. |
| 540 | (test_run, test_spawn, test_kill, test_handler): Remove all the |
| 541 | class->leader = TRUE from the tests, we only ever really tested |
| 542 | session leaders anyway since that's all the test suite could follow |
| 543 | * init/tests/test_job.c (test_change_goal, test_change_state): |
| 544 | Remove the leader flag from test jobs |
| 545 | * init/tests/test_event.c (test_pending, test_finished): Remove |
| 546 | the leader flag from test jobs. |
| 547 | |
Scott James Remnant | 1e812b5 | 2009-07-09 10:10:37 +0100 | [diff] [blame] | 548 | * init/job_process.c (job_process_catch_runaway): Use a monotonic |
| 549 | clock, not the realtime clock, for respawn interval detection. |
| 550 | * init/tests/test_job_process.c (test_kill, test_handler): Use the |
| 551 | monotonic clock in test cases too |
| 552 | * init/Makefile.am (init_LDADD): Link with librt |
| 553 | * NEWS: Update. |
| 554 | |
Scott James Remnant | fbff5df | 2009-07-09 09:43:17 +0100 | [diff] [blame] | 555 | * util/utmp.c (utmp_write_runlevel): Don't write 'N' to utmp or |
| 556 | wtmp for the previous runlevel, this will force writing reboot |
| 557 | records if prevlevel='N'/0 since read_runlevel will always return |
| 558 | 'N' in that case. |
| 559 | * util/tests/test_utmp.c (test_write_runlevel): Add test case for |
| 560 | passing 'N' and having it treated as zero |
| 561 | (test_read_runlevel): Add a couple of test cases for the problems |
| 562 | we found last night where shutdown and corrupt utmp records result |
| 563 | in the wrong data being returned. |
| 564 | * util/tests/test_sysv.c (test_change_runlevel): Add a test case |
| 565 | for switching from sysinit to the first runlevel |
| 566 | |
Scott James Remnant | 8e35498 | 2009-07-09 09:36:52 +0100 | [diff] [blame] | 567 | * init/conf.h, |
| 568 | * init/control.h, |
| 569 | * init/event.h, |
| 570 | * init/job_class.h: Variable declarations in header files need to |
| 571 | be prefixed with "extern", the NIH_BEGIN_EXTERN stuff only applies |
| 572 | to C++. |
| 573 | |
Scott James Remnant | 5619fdc | 2009-07-09 00:57:10 +0100 | [diff] [blame] | 574 | * util/reboot.c: Reboot can't write the shutdown time before |
| 575 | calling shutdown, otherwise shutdown won't be able to get the |
| 576 | current runlevel anymore. |
| 577 | * util/man/reboot.8: Update, we don't write the shutdown time |
| 578 | before calling shutdown - it's up to the shutdown scripts to |
| 579 | call reboot -w before remounting the root filesystem. |
| 580 | |
Scott James Remnant | 9c95b10 | 2009-07-09 00:39:55 +0100 | [diff] [blame] | 581 | * util/tests/test_utmp.c (test_get_runlevel): Replace test case |
| 582 | with one that expects 'N' rather than fall-through. |
| 583 | * util/tests/test_sysv.c (test_change_runlevel): Expect N when |
| 584 | there is no previous runlevel |
| 585 | |
Scott James Remnant | a849b0a | 2009-07-09 00:36:46 +0100 | [diff] [blame] | 586 | * util/utmp.c (utmp_read_runlevel): Also catch a zero runlevel from |
| 587 | utmp, replacing with 'N' - these functions should never return 0 |
| 588 | * util/sysv.c (sysv_change_runlevel): Should set prevlevel to N |
| 589 | when we don't find one |
| 590 | |
Scott James Remnant | 5091edc | 2009-07-09 00:34:53 +0100 | [diff] [blame] | 591 | * util/utmp.c (utmp_read_runlevel): Catch a negative runlevel from |
| 592 | corrupt utmp data, convert to 'N' |
| 593 | (utmp_get_runlevel): Return N when RUNLEVEL is set but empty, |
| 594 | rather than falling through |
| 595 | |
Scott James Remnant | 98af00b | 2009-07-09 00:22:25 +0100 | [diff] [blame] | 596 | * util/telinit.c: Catch a missing argument separately so we don't |
| 597 | output "(null)" |
| 598 | |
Scott James Remnant | bf7399d | 2009-07-09 00:14:49 +0100 | [diff] [blame] | 599 | * README: Update requirements. |
| 600 | * TODO: Update. |
| 601 | |
Scott James Remnant | 6e17785 | 2009-07-09 00:09:09 +0100 | [diff] [blame] | 602 | * conf/rc-sysinit.conf: Fix typo. |
| 603 | |
Scott James Remnant | 63473d7 | 2009-07-08 21:03:50 +0100 | [diff] [blame] | 604 | 2009-07-08 Scott James Remnant <scott@netsplit.com> |
| 605 | |
Scott James Remnant | 5094d2e | 2009-07-08 23:04:13 +0100 | [diff] [blame] | 606 | * conf/rc-sysinit.conf: Michael Biebl pointed out that by setting |
| 607 | the runlevel to "S" during sysinit, we end up with the runlevel |
| 608 | after boot being "S 2" - and that means scripts in rc2.d that |
| 609 | are also in rcS.d won't get started. The way we had it before |
| 610 | ("N 2") was correct. This happily fixes the one corner case our |
| 611 | reboot handling didn't cover - crashing in single user mode and |
| 612 | rebooting. |
| 613 | |
Scott James Remnant | c80b09f | 2009-07-08 22:48:03 +0100 | [diff] [blame] | 614 | * util/telinit.c: Fix missing ret = from kill |
| 615 | |
Scott James Remnant | df7d14a | 2009-07-08 22:46:26 +0100 | [diff] [blame] | 616 | * conf/rc-sysinit.conf: Ignore -s/single if we're already coming |
| 617 | from single-user-mode. |
| 618 | |
Scott James Remnant | c2ebba9 | 2009-07-08 22:43:49 +0100 | [diff] [blame] | 619 | * util/telinit.c (options): Unignore the -t option |
| 620 | * NEWS: Update. |
| 621 | |
Scott James Remnant | 911cb2e | 2009-07-08 22:40:50 +0100 | [diff] [blame] | 622 | * init/main.c (hup_handler): Also try and reconnect to the message |
| 623 | bus if we've lost the connection. |
| 624 | |
Scott James Remnant | 545bbe3 | 2009-07-08 22:05:59 +0100 | [diff] [blame] | 625 | * init/conf.c (conf_source_reload_dir): Don't blacklist certain |
| 626 | patterns from the configuration directory, instead just filter |
| 627 | to whitelist. |
| 628 | (conf_dir_filter): Whitelist filter, only accept files ending |
| 629 | in .conf |
| 630 | (conf_reload_path): Strip .conf from the filename to generate |
| 631 | the job name. |
| 632 | (conf_file_filter): Add the extra is_dir argument. |
| 633 | * init/tests/test_conf.c (test_source_reload_job_dir) |
| 634 | (test_source_reload_conf_dir, test_source_reload_file) |
| 635 | (test_source_reload): Append .conf to all our filenames |
| 636 | * init/tests/test_control.c (test_reload_configuration): Append |
| 637 | .conf to filenames here too |
| 638 | * NEWS: Update. |
| 639 | |
Scott James Remnant | 63473d7 | 2009-07-08 21:03:50 +0100 | [diff] [blame] | 640 | * init/job_process.c (job_process_run): Stop being stingy, the |
| 641 | post-stop script can have the stop environment too |
| 642 | * init/tests/test_job_process.c (test_run): Add a test case to |
| 643 | make sure it is. |
| 644 | |
Scott James Remnant | d3a6ca7 | 2009-07-08 20:59:21 +0100 | [diff] [blame] | 645 | 2009-07-08 Michael Biebl <mbiebl@gmail.com> |
| 646 | |
| 647 | * contrib/vim/syntax/upstart.vim: Upstart job syntax highlighting |
| 648 | * contrib/vim/ftdetect/upstart.vim: Use for the /etc/init directory |
| 649 | * contrib/Makefile.am: Include the vim syntax files in the |
| 650 | distribution |
| 651 | * configure.ac (AC_CONFIG_FILES): Create contrib/Makefile |
| 652 | * Makefile.am (SUBDIRS): Recurse into the contrib sub-directory |
| 653 | |
Scott James Remnant | 9f322cb | 2009-07-08 15:42:15 +0100 | [diff] [blame] | 654 | 2009-07-08 Scott James Remnant <scott@netsplit.com> |
| 655 | |
Scott James Remnant | 0a046c6 | 2009-07-08 20:55:15 +0100 | [diff] [blame] | 656 | * conf/rc.conf: This doesn't need to be an instance job, Upstart |
| 657 | will do the right thing and stop the task before starting it again |
| 658 | with the new environment (I spent so much time on that, you'd think |
| 659 | I'd remember :p) |
| 660 | |
Scott James Remnant | edb382a | 2009-07-08 20:43:16 +0100 | [diff] [blame] | 661 | * conf/control-alt-delete.conf: Default job for Control-Alt-Delete |
| 662 | * conf/rc-sysinit.conf: Default job for system initialisation |
| 663 | * conf/rc.conf: A fully wacky instance job that runs the rc script |
| 664 | for runlevel changes |
| 665 | * conf/rcS.conf: And a job for single-user-mode, which calls back |
| 666 | to rc-sysinit |
| 667 | * conf/Makefile.am (dist_init_DATA): Install the default files |
| 668 | into the /etc/init directory |
| 669 | * configure.ac (AC_CONFIG_FILES): Create conf/Makefile |
| 670 | * Makefile.am (SUBDIRS): Recurse into the conf directory. |
| 671 | |
Scott James Remnant | 10a35f2 | 2009-07-08 20:05:46 +0100 | [diff] [blame] | 672 | * util/initctl.c (upstart_open, start_action, stop_action) |
| 673 | (restart_action, status_action, list_action): Don't auto-start |
| 674 | the init daemon, it makes no sense. |
| 675 | (upstart_open): When not running from the test suite, and not as |
| 676 | root, it makes sense to default to using the system bus daemon. |
| 677 | * util/tests/test_initctl.c (test_upstart_open): Make sure that |
| 678 | auto-start is FALSE, not TRUE. |
| 679 | * NEWS: Update. |
| 680 | |
Scott James Remnant | 3b61f51 | 2009-07-08 19:59:00 +0100 | [diff] [blame] | 681 | * util/Makefile.am (dist_man_MANS): Oops, had the wrong name for |
| 682 | the runlevel(7) manpage. |
| 683 | |
Scott James Remnant | f24e55d | 2009-07-08 19:58:37 +0100 | [diff] [blame] | 684 | * util/shutdown.c: Gets a bit of a redress, but not much of rewrite |
| 685 | since this is largely just compatibility madness. |
| 686 | (shutdown_now): Port to use sysv_change_runlevel() |
| 687 | (warning_message): Construct plural forms a little better. |
| 688 | (wall): use utmpx, rather than utmp |
| 689 | * util/man/shutdown.8: Minor tweaks and improvements |
| 690 | * NEWS: Update. |
| 691 | |
Scott James Remnant | 461578a | 2009-07-08 19:30:12 +0100 | [diff] [blame] | 692 | * util/reboot.c: Following the pattern of the previous, remove much |
| 693 | of the reboot code, but in the process adding support for reboot |
| 694 | implying --force in runlevel 0 or 6, and writing the shutdown |
| 695 | wtmp record. |
| 696 | * util/man/reboot.8: Minor updates. |
| 697 | * NEWS: Update. |
| 698 | |
Scott James Remnant | 3aac713 | 2009-07-08 19:02:56 +0100 | [diff] [blame] | 699 | * util/telinit.c: Drop quite a bit of the code of telinit too, |
| 700 | just becoming a wrapper about sysv_change_runlevel() - also support |
| 701 | Qq/Uu by using kill() |
| 702 | * util/tests/test_telinit.c (test_env_option): Since we have an |
| 703 | env option, we should test it. |
| 704 | * util/man/telinit.8: Update the manual page. |
| 705 | * util/man/runlevel.8: Typo (/var/run/wtmp -> /var/log/wtmp) |
| 706 | * util/Makefile.am (TESTS): Run the new test |
| 707 | (test_telinit_SOURCES, test_telinit_CFLAGS) |
| 708 | (test_telinit_LDFLAGS, test_telinit_LDADD): Details for the |
| 709 | test suite binary |
| 710 | * NEWS: Update. |
| 711 | |
Scott James Remnant | ff87eaf | 2009-07-08 18:38:25 +0100 | [diff] [blame] | 712 | * util/runlevel.c: Drop about 90% of the code, this just becomes |
| 713 | a wrapper around utmp_get_runlevel() |
| 714 | * util/man/runlevel.8: Update the runlevel manpage. |
| 715 | * util/man/runlevel.7: Also put together a manual page that |
| 716 | describes the runlevel event, as well as the implementation in |
| 717 | Upstart. |
| 718 | * util/Makefile.am (dist_man_MANS): Install the new manpage. |
| 719 | * NEWS: Update. |
| 720 | |
Scott James Remnant | 054c5c4 | 2009-07-08 17:07:14 +0100 | [diff] [blame] | 721 | * util/Makefile.am (reboot_SOURCES, runlevel_SOURCES): Compile and |
| 722 | link the utmp handling source, depending on the header. |
| 723 | (reboot_LDADD, runlevel_LDADD): Drop dependency on libupstart |
| 724 | (shutdown_SOURCES, telinit_SOURCES): Compile and link both the |
| 725 | utmp handling and sysv compat source, depending on the headers |
| 726 | (nodist_shutdown_SOURCES, nodist_telinit_SOURCES): Also link in |
| 727 | the auto-generated bindings |
| 728 | (shutdown_LDADD, telinit_LDADD): Drop dependencies on libupstart, |
| 729 | replacing with dependencies on libnih-dbus and the D-Bus libs. |
| 730 | (runlevel_SOURCES, runlevel_LDFLAGS, runlevel_LDADD) |
| 731 | (shutdown_SOURCES, shutdown_LDFLAGS, shutdown_LDADD) |
| 732 | (telinit_SOURCES, telinit_LDFLAGS, telinit_LDADD): Remove duplicate |
| 733 | entries mistakenly copied from compat/sysv |
| 734 | |
Scott James Remnant | d5a366e | 2009-07-08 17:03:05 +0100 | [diff] [blame] | 735 | * util/sysv.c (sysv_change_runlevel): Pretty much the core compat |
| 736 | function for System V, generate a runlevel event and store the |
| 737 | appropriate things in utmp and wtmp. |
| 738 | * util/sysv.h: Prototype. |
| 739 | * util/tests/test_sysv.c: Test cases for the new function. |
| 740 | * util/Makefile.am (TESTS): Run the sysv test cases |
| 741 | (test_sysv_SOURCES, nodist_test_sysv_SOURCES, test_sysv_LDFLAGS) |
| 742 | (test_sysv_LDADD): Details for the sysv test cases, which obviously |
| 743 | depend on the auto-generated bindings code. |
| 744 | |
Scott James Remnant | 27c0c76 | 2009-07-08 16:56:53 +0100 | [diff] [blame] | 745 | * util/utmp.c (utmp_write_runlevel): Make sure that it's ok to |
| 746 | have no previous runlevel. |
| 747 | * util/tests/test_utmp.c (test_write_runlevel): Add no previous |
| 748 | runlevel test. |
| 749 | |
Scott James Remnant | 591ab47 | 2009-07-08 15:52:55 +0100 | [diff] [blame] | 750 | * util/utmp.c (utmp_read_runlevel): Don't call utmpxname() if we |
| 751 | don't pass a utmp_file, letting glibc pick the default. |
| 752 | * util/tests/test_utmp.c (test_read_runlevel): Add a test case for |
| 753 | no filename. |
| 754 | |
Scott James Remnant | 9802566 | 2009-07-08 15:42:41 +0100 | [diff] [blame] | 755 | * util/util.supp: utmpname leaks memory, so suppress it from valgrind |
| 756 | |
Scott James Remnant | 9f322cb | 2009-07-08 15:42:15 +0100 | [diff] [blame] | 757 | * util/utmp.c: Set of functions for dealing with utmp and wtmp |
| 758 | (utmp_read_runlevel): Read the current runlevel from the file |
| 759 | (utmp_get_runlevel): Obtain the current runlevel from the |
| 760 | environment, or the file if not set |
| 761 | (utmp_write_runlevel): Write a runlevel change record, and also |
| 762 | deal with the reboot record if the utmp or wtmp files don't quite |
| 763 | match. |
| 764 | (utmp_write_shutdown): Write a shutdown time record |
| 765 | (utmp_entry, utmp_write, wtmp_write): utility functions for creating |
| 766 | and writing utmp and wtmp records. |
| 767 | * util/utmp.h: Prototypes for new functions. |
| 768 | * util/tests/test_utmp.c: Test cases. |
| 769 | * util/Makefile.am (test_utmp_SOURCES, test_utmp_LDFLAGS) |
| 770 | (test_utmp_LDADD): Details for utmp test cases |
| 771 | (tests): Move to the bottom of the file and make PHONY |
| 772 | |
Scott James Remnant | 07b3224 | 2009-07-07 10:49:43 +0100 | [diff] [blame] | 773 | 2009-07-07 Scott James Remnant <scott@netsplit.com> |
| 774 | |
| 775 | * util/man/initctl.8: Improve the manpage. |
| 776 | |
Scott James Remnant | cf2e833 | 2009-07-06 20:32:07 +0100 | [diff] [blame] | 777 | 2009-07-06 Scott James Remnant <scott@netsplit.com> |
| 778 | |
| 779 | * util/initctl.c: Rewrite from scratch, utilising the current |
| 780 | D-Bus API and auto-generated method functions for it. |
| 781 | * util/tests/test_initctl.c: Rewrite from scratch to test all |
| 782 | of the new methods. |
| 783 | * util/Makefile.am (test_initctl_CFLAGS): Include AM_CFLAGS |
| 784 | (install-data-hook, install-exec-hook): Install a symlink for |
| 785 | "restart" as well. |
| 786 | * NEWS: Update. |
| 787 | |
Scott James Remnant | b95895c | 2009-07-03 12:35:48 +0100 | [diff] [blame] | 788 | 2009-07-03 Scott James Remnant <scott@netsplit.com> |
| 789 | |
Scott James Remnant | 5417912 | 2009-07-03 17:38:02 +0100 | [diff] [blame] | 790 | * dbus/com.ubuntu.Upstart.Instance.xml (Start, Stop, Restart): add |
| 791 | wait arguments to the instance commands as well. |
| 792 | * init/job.c (job_start, job_stop, job_restart): Add wait arguments, |
| 793 | when TRUE the functions behave as before; when FALSE the methods |
| 794 | return after changing the goal and no blocked entries are created. |
| 795 | * init/job.h: Amend prototypes. |
| 796 | * init/tests/test_job.c (test_start, test_stop, test_restart): |
| 797 | Pass TRUE for wait and check for a blocking entry in existing tests, |
| 798 | add tests for passing FALSE and making sure that there's no blocking |
| 799 | but we still get the reply. |
| 800 | |
Scott James Remnant | f2926f0 | 2009-07-03 17:28:21 +0100 | [diff] [blame] | 801 | * dbus/com.ubuntu.Upstart.Job.xml (Start, Stop, Restart): Add wait |
| 802 | arguments to these too |
| 803 | * init/job_class.c (job_class_start, job_class_stop) |
| 804 | (job_class_restart): Add wait arguments, when TRUE the functions |
| 805 | behave as before; when FALSE the methods return after changing |
| 806 | the goal and no blocked entries are created. |
| 807 | * init/job_class.h: Amend prototypes. |
| 808 | * init/tests/test_job_class.c (test_start, test_stop, test_restart): |
| 809 | Pass TRUE for wait and check for a blocking entry in existing tests, |
| 810 | add tests for passing FALSE and making sure that there's no blocking |
| 811 | but we still get the reply. |
| 812 | (test_get_name, test_get_description, test_get_author) |
| 813 | (test_get_version): Add missing code to free the class on enomem |
| 814 | |
Scott James Remnant | fb8242d | 2009-07-03 17:08:10 +0100 | [diff] [blame] | 815 | * dbus/com.ubuntu.Upstart.xml (EmitEvent): Add wait argument |
| 816 | * init/control.c (control_emit_event): Add wait argument, when TRUE |
| 817 | this behaves as before; when FALSE the method returns after queuing |
| 818 | the event and no blocked entry is created for it. |
| 819 | * init/control.h: Amend prototype. |
| 820 | * init/tests/test_control.c (test_emit_event): Pass TRUE for wait |
| 821 | and check for a blocking entry in existing tests, add a test for |
| 822 | passing FALSE and making sure that there's no blocking but we |
| 823 | still get the reply. |
| 824 | |
Scott James Remnant | b9f5ee8 | 2009-07-03 16:03:25 +0100 | [diff] [blame] | 825 | * dbus/com.ubuntu.Upstart.Instance.xml: Add a "processes" property |
| 826 | to obtain the list of current job processes, both their type and |
| 827 | their pid. |
| 828 | * init/job.c (job_get_processes): Implement the new property accessor |
| 829 | * init/job.h: Add prototype |
| 830 | * init/tests/test_job.c (test_get_processes): Add test cases for |
| 831 | returning process arrays. |
| 832 | (test_get_name, test_get_goal, test_get_state): Add missing free |
| 833 | for job class. |
| 834 | |
Scott James Remnant | de5a166 | 2009-07-03 12:51:34 +0100 | [diff] [blame] | 835 | * init/tests/test_control.c (test_emit_event): Directly acess |
| 836 | the number from an NihDBusError |
| 837 | |
Scott James Remnant | b95895c | 2009-07-03 12:35:48 +0100 | [diff] [blame] | 838 | * dbus/com.ubuntu.Upstart.xml: Add a "version" property to obtain |
| 839 | the version of the init daemon, and a "log_priority" property to |
| 840 | get and set the daemon's log priority. |
| 841 | * init/control.c (control_get_version, control_get_log_priority) |
| 842 | (control_set_log_priority): Methods to support the new properties |
| 843 | * init/control.h: Prototypes. |
| 844 | * init/tests/test_control.c (test_get_version) |
| 845 | (test_get_log_priority, test_set_log_priority): Add tests for the |
| 846 | property accessor functions. |
| 847 | |
Scott James Remnant | 0260613 | 2009-07-02 18:31:25 +0100 | [diff] [blame] | 848 | 2009-07-02 Scott James Remnant <scott@netsplit.com> |
| 849 | |
Scott James Remnant | 0cbb06c | 2009-07-02 18:46:41 +0100 | [diff] [blame] | 850 | * dbus/Upstart.conf: Need to adjust the security configuration |
| 851 | * dbus/upstart.h: And the constants as well. |
| 852 | |
Scott James Remnant | 02bdd77 | 2009-07-02 18:41:52 +0100 | [diff] [blame] | 853 | * dbus/com.ubuntu.Upstart.xml, |
| 854 | * dbus/com.ubuntu.Upstart.Job.xml, |
| 855 | * dbus/com.ubuntu.Upstart.Instance.xml: Now we don't hardcode the |
| 856 | interface name anywhere, we can version it properly. |
| 857 | * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): |
| 858 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): |
| 859 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Update default interface |
| 860 | names. |
| 861 | * util/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): |
| 862 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): |
| 863 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Update here too. |
| 864 | |
Scott James Remnant | 0260613 | 2009-07-02 18:31:25 +0100 | [diff] [blame] | 865 | * dbus/Makefile.am (EXTRA_DIST): Make sure we distribute it |
| 866 | * dbus/upstart.h: Add a header file with the usual D-Bus constants. |
| 867 | * init/control.h: Drop CONTROL_ROOT, replace with DBUS_PATH_UPSTART |
| 868 | * init/control.c (control_server_open, control_bus_open) |
| 869 | (control_register_all): Replace CONTROL_* constants with the new ones |
| 870 | (control_get_job_by_name): Use DBUS_INTERFACE_UPSTART when constructing |
| 871 | error names. |
| 872 | * init/job_class.c (job_class_new, job_class_register) |
| 873 | (job_class_unregister): Construct paths using DBUS_PATH_UPSTART |
| 874 | (job_class_get_instance) |
| 875 | (job_class_get_instance_by_name, job_class_start) |
| 876 | (job_class_stop, job_class_restart): Use DBUS_INTERFACE_UPSTART to |
| 877 | construct error names |
| 878 | * init/job.c (job_new): Construct path using DBUS_PATH_UPSTART |
| 879 | (job_finished, job_start, job_stop, job_restart): Use |
| 880 | DBUS_INTERFACE_UPSTART to construct error names. |
| 881 | * init/event.c (event_finished): Use DBUS_INTERFACE_UPSTART to |
| 882 | construct error name. |
| 883 | * init/tests/test_control.c (test_server_open): Don't hardcode |
| 884 | the address, extract the abstract path from the constant. |
| 885 | (test_server_connect, test_bus_open, test_emit_event): Don't |
| 886 | harcode addresses, paths or interfaces - use the constants |
| 887 | * init/tests/test_job_class.c (test_consider, test_reconsider) |
| 888 | (test_register, test_unregister, test_start, test_stop) |
| 889 | (test_restart, test_get_instance, test_get_instance_by_name): |
| 890 | Use the constants instead of harcoding. |
| 891 | (test_new): Derive the expected path from the constant |
| 892 | * init/tests/test_job.c (test_new): Derive the paths from the |
| 893 | constant, check for jobs by that interface constant. |
| 894 | (test_change_state): Use DBUS_INTERFACE_UPSTART_JOB |
| 895 | (test_start, test_stop, test_restart): Use DBUS_INTERFACE_UPSTART_INSTANCE, |
| 896 | and generate errors from DBUS_INTERFACE_UPSTART |
| 897 | |
| 898 | * dbus/com.ubuntu.Upstart.xml, |
| 899 | * dbus/com.ubuntu.Upstart.Job.xml, |
| 900 | * dbus/com.ubuntu.Upstart.Instance.xml: Remove the empty symbol |
| 901 | annotation for the interfaces. |
| 902 | * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): |
| 903 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): |
| 904 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Define the default |
| 905 | interface and build-time instead. |
| 906 | * util/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): |
| 907 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): |
| 908 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Likewise for util |
| 909 | |
Scott James Remnant | dcf6771 | 2009-06-30 13:20:25 +0100 | [diff] [blame] | 910 | 2009-06-30 Scott James Remnant <scott@netsplit.com> |
| 911 | |
| 912 | * dbus/Upstart.conf: It doesn't make much sense to restrict getting |
| 913 | the values of properties, or looking up jobs or interfaces, so make |
| 914 | these public. |
| 915 | |
Scott James Remnant | b333820 | 2009-06-23 01:02:58 +0100 | [diff] [blame] | 916 | 2009-06-23 Scott James Remnant <scott@netsplit.com> |
| 917 | |
Scott James Remnant | 047b94f | 2009-06-23 13:45:12 +0100 | [diff] [blame] | 918 | * Makefile.am (SUBDIRS): Add util to the list of sub-directories |
| 919 | again. |
| 920 | * configure.ac (AC_CONFIG_FILES): Generate util/Makefile |
| 921 | * util/Makefile.am (AM_CFLAGS): Append D-Bus CFLAGS |
| 922 | (AM_CPPFLAGS): Make sure the build directory is also in the quoted |
| 923 | include path |
| 924 | (nodist_initctl_SOURCES): Build and link the generated D-Bus |
| 925 | bindings, but don't distribute them |
| 926 | (initctl_LDADD): Drop the libupstart dependency, instead put |
| 927 | libnih-dbus and DBUS_LIBS in there. |
| 928 | (com_ubuntu_Upstart_OUTPUTS, com_ubuntu_Upstart_XML) |
| 929 | ($(com_ubuntu_Upstart_OUTPUTS)): Auto-generate D-Bus binding code |
| 930 | to proxy the manager object |
| 931 | (com_ubuntu_Upstart_Job_OUTPUTS, com_ubuntu_Upstart_Job_XML) |
| 932 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): Auto-generate D-Bus binding |
| 933 | code to proxy job class objects |
| 934 | (com_ubuntu_Upstart_Instance_OUTPUTS) |
| 935 | (com_ubuntu_Upstart_Instance_XML) |
| 936 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Auto-generate D-Bus |
| 937 | binding code to proxy job instance objects |
| 938 | (BUILT_SOURCES, CLEANFILES): Built sources have to come first |
| 939 | and be cleaned up |
| 940 | (test_initctl_LDADD): Tests need to be linked to libnih-dbus |
| 941 | and the D-Bus libraries, as well as the auto-generated output |
| 942 | * init/Makefile.am (EXTRA_DIST): Drop the EXTRA_DIST for the |
| 943 | sources, already handled since they're in a different directory |
| 944 | |
Scott James Remnant | 0c0c5a5 | 2009-06-23 10:29:35 +0100 | [diff] [blame] | 945 | * COPYING: Change licence to version 2 of the GNU GPL. |
| 946 | All files have been updated to reflect this. |
| 947 | |
Scott James Remnant | 854fda2 | 2009-06-23 01:21:55 +0100 | [diff] [blame] | 948 | * init/paths.h (CONFFILE): Add new macro |
| 949 | * init/Makefile.am (AM_CPPFLAGS): Add CONFFILE definition |
| 950 | (install-data-local): No need to make conf.d or jobs.d |
| 951 | * init/main.c: Only parse CONFFILE (/etc/init.conf) as a |
| 952 | configuration file source and CONFDIR (/etc/init) as a job |
| 953 | configuration source. |
| 954 | |
Scott James Remnant | b333820 | 2009-06-23 01:02:58 +0100 | [diff] [blame] | 955 | * configure.ac: Bump version to 0.6.0 |
| 956 | * NEWS: Copy in news from 0.5.3; that release doesn't appear in |
| 957 | this ChangeLog since it was made on a separate branch. Begin |
| 958 | new release. |
| 959 | |
Scott James Remnant | a25cc90 | 2009-06-18 18:44:15 +0100 | [diff] [blame] | 960 | 2009-06-18 Casey Dahlin <cdahlin@redhat.com> |
| 961 | |
| 962 | * util/man/initctl.8: Fix formatting of SYNOPSIS |
| 963 | |
Scott James Remnant | 11a2158 | 2009-06-18 11:29:39 +0100 | [diff] [blame] | 964 | 2009-06-18 Scott James Remnant <scott@netsplit.com> |
| 965 | |
| 966 | * dbus/com.ubuntu.Upstart.xml, dbus/com.ubuntu.Upstart.Job.xml, |
| 967 | dbus/com.ubuntu.Upstart.Instance.xml: Add a comment to these files |
| 968 | to clarify that you may communicate and interact with Upstart |
| 969 | through these interfaces without restriction. It also makes sense |
| 970 | that these files be copied into software that does so to turn into |
| 971 | their own bindings, so use the FSF permissive licence for them. |
| 972 | |
Scott James Remnant | 2ec8b04 | 2009-06-17 16:49:13 +0100 | [diff] [blame] | 973 | 2009-06-17 Scott James Remnant <scott@netsplit.com> |
| 974 | |
Scott James Remnant | ebbbb0d | 2009-06-17 19:03:24 +0100 | [diff] [blame] | 975 | * configure.ac: Bump version to 0.5.3 |
| 976 | |
Scott James Remnant | 4ef6e28 | 2009-06-17 19:02:13 +0100 | [diff] [blame] | 977 | * NEWS: Copy in news from 0.5.2; that release doesn't appear in |
| 978 | this ChangeLog since it was made on a separate branch. |
| 979 | |
Scott James Remnant | fff115a | 2009-06-17 18:47:22 +0100 | [diff] [blame] | 980 | * NEWS: Include 0.3.10 release, which happened from a separate branch. |
| 981 | |
Scott James Remnant | e22f81e | 2009-06-17 18:28:24 +0100 | [diff] [blame] | 982 | * init/parse_job.c (stanza_kill, stanza_respawn, stanza_nice) |
| 983 | (stanza_oom): Check errno after using strtol() to avoid overflows. |
| 984 | (stanza_normal, stanza_umask, stanza_limit): Also check with |
| 985 | strtoul() too |
| 986 | * init/tests/test_parse_job.c (test_stanza_kill) |
| 987 | (test_stanza_respawn): Add test cases for the two that don't |
| 988 | check for overflow already. |
| 989 | (test_stanza_limit): Add test for the too large case where we don't |
| 990 | already cope. |
| 991 | |
Scott James Remnant | 180b544 | 2009-06-17 17:52:18 +0100 | [diff] [blame] | 992 | * dbus/Upstart.conf: Allow root to obtain properties |
| 993 | |
Scott James Remnant | 6684a9a | 2009-06-17 17:49:58 +0100 | [diff] [blame] | 994 | * dbus/com.ubuntu.Upstart.Instance.xml: Add name, goal and state |
| 995 | properties to the instance |
| 996 | * init/job.c (job_get_name, job_get_goal, job_get_state): Add methods |
| 997 | to return the property values |
| 998 | * init/job.h: Add prototypes. |
| 999 | * init/tests/test_job.c (test_get_name, test_get_goal) |
| 1000 | (test_get_state): Test cases. |
| 1001 | |
Scott James Remnant | 6f49af0 | 2009-06-17 17:41:09 +0100 | [diff] [blame] | 1002 | * dbus/com.ubuntu.Upstart.Job.xml: Add name, description, author |
| 1003 | and version properties to the job |
| 1004 | * init/job_class.c (job_class_get_name) |
| 1005 | (job_class_get_description, job_class_get_author) |
| 1006 | (job_class_get_version): Add methods to return the property values. |
| 1007 | * init/job_class.h: Add prototypes |
| 1008 | |
Scott James Remnant | d9bbe97 | 2009-06-17 17:09:49 +0100 | [diff] [blame] | 1009 | * init/job_process.c (job_process_error_abort): Don't abort() from |
| 1010 | a child process, it confuses people; just exit with an interesting |
| 1011 | error code (which we ignore anyway). |
| 1012 | |
Scott James Remnant | 2ec8b04 | 2009-06-17 16:49:13 +0100 | [diff] [blame] | 1013 | * dbus/Upstart.conf: Update the D-Bus configuration based on newer |
| 1014 | D-Bus recommended practice with a proper deny-by-default D-Bus, |
| 1015 | making sure to not use send_interface without send_destination. |
| 1016 | Allow introspection as well. |
| 1017 | |
Scott James Remnant | 25c9694 | 2009-06-17 16:41:34 +0100 | [diff] [blame] | 1018 | 2009-06-17 Jeff Oliver <Jeffrey.Oliver@panasonic.aero> |
| 1019 | |
| 1020 | * init/job_process.c (job_process_spawn): Only attempt to set |
| 1021 | the OOM adjustment if set in the class, avoiding issue where /proc |
| 1022 | is not mounted for the first job. |
| 1023 | |
Scott James Remnant | a5efa6c | 2009-06-17 14:30:45 +0100 | [diff] [blame] | 1024 | 2009-06-17 Scott James Remnant <scott@netsplit.com> |
| 1025 | |
Scott James Remnant | 1b91df4 | 2009-06-17 16:24:11 +0100 | [diff] [blame] | 1026 | * init/tests/test_job_process.c (test_handler): Add test cases for a |
| 1027 | respawning job failing while it's post-start or pre-stop processes |
| 1028 | are still running while making sure that it still respawns afterwards. |
| 1029 | * init/job_process.c (job_process_terminated): To fix it, check for |
| 1030 | a running post-start or pre-stop process before checking for a the |
| 1031 | respawn. That's not enough because then we won't respawn when the |
| 1032 | existing process finishes, so use the goal as a hint. |
| 1033 | * init/job.c (job_next_state): Use that hint goal here, remembering |
| 1034 | to set the goal back to JOB_START afterwards. |
| 1035 | (job_change_goal): Nothing to do in the respawn case |
| 1036 | (job_goal_name, job_goal_from_name): Add the new values |
| 1037 | * init/job.h (job_goal): Add the respawn goal |
| 1038 | * init/tests/test_job.c (test_next_state): Add tests for the respawn |
| 1039 | goal |
| 1040 | (test_goal_name, test_goal_from_name): Tests for the new values |
| 1041 | |
Scott James Remnant | f727167 | 2009-06-17 14:59:38 +0100 | [diff] [blame] | 1042 | * configure.ac (AC_CONFIG_FILES): dbus goes before init just in case |
| 1043 | we ever do anything to them later |
| 1044 | |
Scott James Remnant | 0a8bd92 | 2009-06-17 14:37:23 +0100 | [diff] [blame] | 1045 | * init/job_class.c (job_class_register, job_class_unregister): Update |
| 1046 | name of signal functions that we call. |
| 1047 | (job_class_interfaces): No need to declare this separately |
| 1048 | * init/job.c (job_register, job_change_state): Update name of signal |
| 1049 | functions. |
| 1050 | (job_interfaces): Drop, it comes from the generated header now |
| 1051 | * init/control.c (manager_interfaces): Drop, comes from the header |
| 1052 | as control_interfaces |
| 1053 | (control_register_all): Change array name |
| 1054 | * init/tests/test_job_class.c, |
| 1055 | * init/tests/test_job.c, |
| 1056 | * init/tests/test_control.c, |
| 1057 | * init/tests/test_blocked.c: Rename conn member of NihDBusMessage |
| 1058 | to connection |
| 1059 | |
Scott James Remnant | a5efa6c | 2009-06-17 14:30:45 +0100 | [diff] [blame] | 1060 | * dbus/com.ubuntu.Upstart.xml, |
| 1061 | * dbus/com.ubuntu.Upstart.Job.xml, |
| 1062 | * dbus/com.ubuntu.Upstart.Instance.xml: Use annotation to mark the |
| 1063 | methods as async, rather than a namespaced attribute. Omit the |
| 1064 | interface symbol. |
| 1065 | * init/Makefile.am (AM_CPPFLAGS): Add builddir to the quoted includes |
| 1066 | (init_SOURCES): Don't distribute the auto-generated outputs |
| 1067 | ($(com_ubuntu_Upstart_OUTPUTS)) |
| 1068 | ($(com_ubuntu_Upstart_Job_OUTPUTS)) |
| 1069 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Generate using the new |
| 1070 | binary tool. |
| 1071 | (BUILT_SOURCES): Remind myself why these are BUILT_SOURCES |
| 1072 | (MAINTAINERCLEANFILES): Change to ordinary CLEANFILES |
| 1073 | (EXTRA_DIST): outputs aren't distributed |
| 1074 | |
Scott James Remnant | 7512302 | 2009-05-22 13:27:56 +0200 | [diff] [blame] | 1075 | 2009-05-22 Scott James Remnant <scott@netsplit.com> |
| 1076 | |
Scott James Remnant | 5c102eb | 2009-05-22 15:18:30 +0200 | [diff] [blame] | 1077 | * init/tests/test_conf.c: Remove nih/inotify.h include |
| 1078 | |
Scott James Remnant | 7512302 | 2009-05-22 13:27:56 +0200 | [diff] [blame] | 1079 | * COPYING: Change licence from GPL-2+ to GPL-3 only. |
| 1080 | |
Scott James Remnant | a6a8253 | 2009-05-17 14:43:54 +0100 | [diff] [blame] | 1081 | 2009-05-17 Scott James Remnant <scott@netsplit.com> |
| 1082 | |
| 1083 | * init/tests/test_job.c, |
| 1084 | * init/tests/test_job_class.c, |
| 1085 | * init/tests/test_control.c: Include nih-dbus/errors.h |
| 1086 | |
Scott James Remnant | dbd3b15 | 2009-05-09 16:30:35 +0100 | [diff] [blame] | 1087 | 2009-05-09 Scott James Remnant <scott@netsplit.com> |
| 1088 | |
Scott James Remnant | 3306e26 | 2009-05-13 11:49:51 +0100 | [diff] [blame] | 1089 | * init/init.supp: setenv on tls/i686/cmov |
| 1090 | |
Scott James Remnant | 0ff734e | 2009-05-09 16:56:08 +0100 | [diff] [blame] | 1091 | * init/job_class.c (job_class_get_instance, job_class_start) |
| 1092 | (job_class_stop, job_class_restart): Clean up the code by using |
| 1093 | nih_error_steal() |
| 1094 | |
Scott James Remnant | 7f590ac | 2009-05-09 16:52:54 +0100 | [diff] [blame] | 1095 | * init/conf.c (conf_source_reload_file, conf_source_reload_dir): |
| 1096 | Steal the error that we stash instead of getting it, otherwise we'll |
| 1097 | fail if another one occurs. |
| 1098 | |
Scott James Remnant | 3d7483b | 2009-05-09 16:36:03 +0100 | [diff] [blame] | 1099 | * init/conf.c (conf_reload_path): Simply return, no need to re-raise |
| 1100 | the error. |
| 1101 | * init/job_class.c (job_class_get_instance, job_class_start) |
| 1102 | (job_class_stop, job_class_restart): If not ENOMEM, we need to |
| 1103 | re-raise the error as a D-Bus one, that means we now have to free |
| 1104 | the old error first (saving the msssage) |
| 1105 | * init/job_process.c (job_process_error_read): Replace call to |
| 1106 | nih_error_raise_again() with nih_error_raise_error() |
| 1107 | |
Scott James Remnant | dbd3b15 | 2009-05-09 16:30:35 +0100 | [diff] [blame] | 1108 | * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): |
| 1109 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): |
| 1110 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Use the Python variant |
| 1111 | of nih-dbus-tool for now |
| 1112 | |
Scott James Remnant | ddee7aa | 2009-03-27 14:28:51 +0000 | [diff] [blame] | 1113 | 2009-03-27 Scott James Remnant <scott@netsplit.com> |
| 1114 | |
Scott James Remnant | 58278d6 | 2009-03-27 15:22:07 +0000 | [diff] [blame] | 1115 | * init/tests/test_process.c (test_from_name): Cast -1 to ProcessType |
| 1116 | * init/tests/test_job_process.c (test_kill, test_handler): Cast -1 |
| 1117 | to ProcessType |
| 1118 | * init/tests/test_job.c (test_new, test_change_state): Cast -1 |
| 1119 | to ProcessType |
| 1120 | (test_goal_from_name): Cast -1 to JobGoal |
| 1121 | (test_state_from_name): Cast -1 to JobState |
| 1122 | * init/tests/test_control.c (test_bus_open): Add braces |
| 1123 | |
Scott James Remnant | 58f873a | 2009-03-27 15:22:00 +0000 | [diff] [blame] | 1124 | * init/Makefile.am (tests): Add rule to build test cases |
| 1125 | * util/Makefile.am (tests): Likewise |
| 1126 | |
Scott James Remnant | 267e61c | 2009-03-27 15:16:06 +0000 | [diff] [blame] | 1127 | * init/job.c (job_interfaces): Put static first |
| 1128 | (job_emit_event): Cast -1 to ProcessType |
| 1129 | (job_emit_event): Cast -1 to ProcessType |
| 1130 | * init/job_class.c (job_class_interfaces): Put static first. |
| 1131 | * init/job_process.c (job_process_kill_timer): Cast -1 to ProcessType |
| 1132 | * init/control.c (manager_interfaces): Put static first |
| 1133 | |
Scott James Remnant | ddee7aa | 2009-03-27 14:28:51 +0000 | [diff] [blame] | 1134 | * init/Makefile.am (AM_CPPFLAGS): Use -iquote$(srcdir) instead of -I |
| 1135 | since we only need it to pick those paths up. |
| 1136 | * util/Makefile.am (AM_CPPFLAGS): Likewise. |
| 1137 | |
Scott James Remnant | 0ad2d9a | 2009-02-20 22:08:20 +0000 | [diff] [blame] | 1138 | 2009-02-20 Scott James Remnant <scott@netsplit.com> |
| 1139 | |
Scott James Remnant | 7d59ed2 | 2009-02-20 22:28:03 +0000 | [diff] [blame] | 1140 | * util/initctl.c (handle_job_instance_end, handle_job_process) |
| 1141 | (handle_job_status_end, handle_event), |
| 1142 | * util/shutdown.c (main): No need for new_* temporary variable when |
| 1143 | looping over nih_realloc with NIH_MUST. |
| 1144 | |
Scott James Remnant | c5d3e1b | 2009-02-20 22:22:48 +0000 | [diff] [blame] | 1145 | * util/initctl.c (job_info_output, output_name, handle_job_list) |
| 1146 | (handle_job_instance, handle_job_instance_end) |
| 1147 | (handle_job_status, handle_job_process, handle_job_status_end) |
| 1148 | (handle_event, env_option), |
| 1149 | * util/telinit.c (main), |
| 1150 | * util/shutdown.c (main, shutdown_now, timer_callback, wall): |
| 1151 | |
Scott James Remnant | 5695411 | 2009-02-20 22:18:57 +0000 | [diff] [blame] | 1152 | * init/event.c (event_init, event_pending_handle_jobs, event_finished), |
| 1153 | * init/event_operator.c (event_operator_events), |
| 1154 | * init/job.c (job_emit_event, job_name), |
| 1155 | * init/job_class.c (job_class_init, job_class_start) |
| 1156 | (job_class_stop, job_class_restart), |
| 1157 | * init/job_process.c (job_process_run, job_process_error_read) |
| 1158 | (job_process_kill), |
| 1159 | * init/conf.c (conf_init, conf_source_reload_file) |
| 1160 | (conf_reload_path), |
| 1161 | * init/control.c (control_init, control_server_connect) |
| 1162 | (control_bus_open): Set variable outside of NIH_MUST macro. |
| 1163 | |
Scott James Remnant | 69132b7 | 2009-02-20 22:10:06 +0000 | [diff] [blame] | 1164 | * init/event.c (event_pending_handle_jobs): Set variable outside |
| 1165 | of NIH_SHOULD macro. |
| 1166 | |
Scott James Remnant | 0ad2d9a | 2009-02-20 22:08:20 +0000 | [diff] [blame] | 1167 | * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): |
| 1168 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): |
| 1169 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Update expected path |
| 1170 | of nih-dbus-tool |
| 1171 | |
| 1172 | * configure.ac: Create nih-dbus-tool Makefile |
| 1173 | * Makefile.am (SUBDIRS): Build in nih-dbus-tool |
| 1174 | |
Scott James Remnant | da7d2d4 | 2009-01-29 01:55:15 +0000 | [diff] [blame] | 1175 | 2009-01-29 Scott James Remnant <scott@netsplit.com> |
| 1176 | |
Scott James Remnant | 619905b | 2009-01-29 06:23:08 +0000 | [diff] [blame] | 1177 | * configure.ac: Bump version to 0.5.2 |
| 1178 | * NEWS: Begin 0.5.2 |
| 1179 | |
| 1180 | * NEWS: Copy in news from 0.5.1; that release doesn't appear in |
| 1181 | this ChangeLog since it was made on a separate branch. |
| 1182 | |
Scott James Remnant | 593c8ea | 2009-01-29 05:29:17 +0000 | [diff] [blame] | 1183 | * init/tests/test_blocked.c (test_new), |
| 1184 | * init/tests/test_control.c (test_get_job_by_name) |
| 1185 | (test_get_all_jobs, test_emit_event), |
| 1186 | * init/tests/test_event.c (test_finished), |
| 1187 | * init/tests/test_job.c (test_change_state), |
| 1188 | * init/tests/test_job_class.c (test_get_instance) |
| 1189 | (test_get_instance_by_name, test_get_all_instances): Continue the |
| 1190 | battle with the gcc optimiser which declares variables first used |
| 1191 | inside TEST_ALLOC_FAIL as used uninitialized. |
| 1192 | |
Scott James Remnant | 88abb65 | 2009-01-29 04:23:21 +0000 | [diff] [blame] | 1193 | * init/parse_job.c (parse_exec, parse_script, stanza_instance) |
| 1194 | (stanza_description, stanza_author, stanza_version) |
| 1195 | (stanza_start, stanza_stop, stanza_chroot, stanza_chdir): |
| 1196 | Unreference members when replacing them instead of freeing; not |
| 1197 | strictly necessary but the style is the thing. |
| 1198 | |
Scott James Remnant | 57a64d3 | 2009-01-29 04:21:07 +0000 | [diff] [blame] | 1199 | * init/job_process.c (job_process_terminated): Unreference the |
| 1200 | kill timer instead of freeing |
| 1201 | |
Scott James Remnant | d3df7ee | 2009-01-29 04:20:42 +0000 | [diff] [blame] | 1202 | * init/job_class.c (job_class_get_instance): Use nih_local for |
| 1203 | instance environment and name |
| 1204 | (job_class_start, job_class_stop, job_class_restart): |
| 1205 | Unreference job environment instead of freeing |
| 1206 | |
Scott James Remnant | 636d37f | 2009-01-29 04:18:35 +0000 | [diff] [blame] | 1207 | * init/job.c (job_change_state, job_start, job_stop, job_restart): |
| 1208 | Unreference job environment instead of freeing |
| 1209 | (job_name): Discard job name in case a reference was taken. |
| 1210 | |
Scott James Remnant | 248b40e | 2009-01-29 04:16:14 +0000 | [diff] [blame] | 1211 | * init/event.c (event_pending_handle_jobs): Unreference the job |
| 1212 | environment instead of freeing |
| 1213 | |
Scott James Remnant | 06d95a1 | 2009-01-29 04:15:05 +0000 | [diff] [blame] | 1214 | * init/environ.c (environ_add): should unreference the old environment |
| 1215 | string in case anyone took a ref elsewhere |
| 1216 | (environ_set): use nih_local for str |
| 1217 | (environ_expand_until): Should set *str to NULL if we free it, |
| 1218 | just in case. |
| 1219 | |
Scott James Remnant | d3667ed | 2009-01-29 04:11:24 +0000 | [diff] [blame] | 1220 | * init/conf.c (conf_source_reload): File should be unreferenced, |
| 1221 | not freed. |
| 1222 | (conf_source_reload_file): Use nih_local for dpath |
| 1223 | (conf_delete_handler): Watch and file should be unreferenced, |
| 1224 | not freed. |
| 1225 | (conf_reload_path): File should be unreferenced, not freed; |
| 1226 | use nih_local for file buffer |
| 1227 | |
Scott James Remnant | 750c0b1 | 2009-01-29 02:24:21 +0000 | [diff] [blame] | 1228 | * init/blocked.c (blocked_new), |
| 1229 | * init/conf.c (conf_source_new, conf_file_new), |
| 1230 | * init/event.c (event_new), |
| 1231 | * init/event_operator.c (event_operator_new), |
| 1232 | * init/job.c (job_new), |
| 1233 | * init/job_class.c (job_class_new): No need to cast function |
| 1234 | argument to nih_alloc_set_destructor() |
| 1235 | |
Scott James Remnant | 85ef535 | 2009-01-29 02:15:34 +0000 | [diff] [blame] | 1236 | * init/tests/test_job_process.c (test_handler): We can't just |
| 1237 | assume that our child is sitting at the signal otherwise we might |
| 1238 | end up sending the CONT signal before it's even stopped. Use |
| 1239 | waitid() to wait for the child to stop first. |
| 1240 | |
Scott James Remnant | 79bd861 | 2009-01-29 02:02:36 +0000 | [diff] [blame] | 1241 | * init/init.supp: More expressions for environment memory which |
| 1242 | valgrind can't deal with |
| 1243 | |
Scott James Remnant | da7d2d4 | 2009-01-29 01:55:15 +0000 | [diff] [blame] | 1244 | * init/conf.c (conf_source_reload): The ConfFile destructor has |
| 1245 | side-effects that involve the iteration of the sources and their |
| 1246 | files, so we can't simply call it while iterating because of the |
| 1247 | cursor. Move the sources into a deleted list first, and delete |
| 1248 | them from there. |
| 1249 | * init/conf.h: Fix prototype. |
| 1250 | * init/tests/test_conf.c (test_source_reload_job_dir): Test pointers |
| 1251 | with TEST_EQ_P not TEST_EQ |
| 1252 | |
Scott James Remnant | 5798222 | 2009-01-28 01:22:31 +0000 | [diff] [blame] | 1253 | 2009-01-28 Scott James Remnant <scott@netsplit.com> |
| 1254 | |
Scott James Remnant | 75fb838 | 2009-01-29 00:01:08 +0000 | [diff] [blame] | 1255 | * init/job_class.c (job_class_start): We can't create the blocked |
| 1256 | until we know we're going to block, otherwise we could ref and unref |
| 1257 | the message (freeing it). Wait until the job is created, which |
| 1258 | means we can't fail to create the blocked item (we'll already have |
| 1259 | announced the new instance). |
| 1260 | (job_class_stop, job_class_restart): For consistency, don't fail |
| 1261 | if OOM when making blocked. |
| 1262 | |
Scott James Remnant | 78a9bb0 | 2009-01-28 23:42:24 +0000 | [diff] [blame] | 1263 | * init/tests/test_job.c (test_new): Initialise a bunch of subsystems |
| 1264 | outside of TEST_ALLOC_FAIL |
| 1265 | |
Scott James Remnant | 10cb701 | 2009-01-28 23:39:29 +0000 | [diff] [blame] | 1266 | * init/environ.c (environ_add): We can't allocate nih_local with |
| 1267 | a context, it won't be freed; so don't, but then remember to |
| 1268 | reference it when we do just use it. |
| 1269 | |
Scott James Remnant | 6edea72 | 2009-01-28 23:32:32 +0000 | [diff] [blame] | 1270 | * init/event.c (event_pending_handle_jobs): Must reset the start_on |
| 1271 | operator in case of error. |
| 1272 | |
Scott James Remnant | 64b9b7a | 2009-01-28 22:00:12 +0000 | [diff] [blame] | 1273 | * init/job_process.c (job_process_kill_timer): Oops, move the |
| 1274 | assert that we have a process pid to after we know which process |
| 1275 | we have. |
| 1276 | * init/tests/test_job_process.c (test_run): Initialise the |
| 1277 | error context and NihIo outside of TEST_ALLOC_FAIL |
| 1278 | (test_kill): Initialise timers and the event system. |
| 1279 | * init/init.supp: Reference from the jobs hash to the bins is |
| 1280 | still reachable, obviously; as is the string inside job_name() |
| 1281 | either way it is allocated |
| 1282 | |
Scott James Remnant | 5eac8f1 | 2009-01-28 21:33:13 +0000 | [diff] [blame] | 1283 | * init/tests/test_parse_job.c (test_parse_job): Initialise the |
| 1284 | error context outside of TEST_ALLOC_FAIL |
| 1285 | |
Scott James Remnant | 514f1d0 | 2009-01-28 21:32:16 +0000 | [diff] [blame] | 1286 | * init/init.supp: Update suppressions for new nih_alloc() |
| 1287 | |
Scott James Remnant | 4f1e0b7 | 2009-01-28 08:30:50 +0000 | [diff] [blame] | 1288 | * init/job_process.c (job_process_run): Had the shell variable |
| 1289 | setting round the wrong way, now it should be ok. |
| 1290 | |
Scott James Remnant | 01830df | 2009-01-28 08:30:23 +0000 | [diff] [blame] | 1291 | * init/tests/test_blocked.c (test_new): in the case of allocation |
| 1292 | failure, the message should not be referenced; which we test by |
| 1293 | trying to discard it and seeing whether that works. |
| 1294 | |
Scott James Remnant | 44f6095 | 2009-01-28 04:04:15 +0000 | [diff] [blame] | 1295 | * init/job.c (job_emit_event): event_new() only references the |
| 1296 | environment now, so use nih_local to make sure we clean it up |
| 1297 | if that doesn't happen |
| 1298 | |
Scott James Remnant | 885879b | 2009-01-28 04:01:55 +0000 | [diff] [blame] | 1299 | * init/job.h (Job): Add kill_process member |
| 1300 | * init/job.c (job_new): Initialise to -1 |
| 1301 | * init/job_process.c (job_process_kill): Store the process to be |
| 1302 | killed in the kill_process member for the timer, since we can't |
| 1303 | pass two sets of data. Assert that it's not set to anything, this |
| 1304 | all needs fixing, obviously. |
| 1305 | (job_process_kill_timer): Take the job as the data argument, |
| 1306 | eliminating the need for nih_alloc_parent(). Sanity check the job |
| 1307 | and reset kill_timer and kill_process when done. |
| 1308 | (job_process_terminated): Clear the kill_process field too. |
| 1309 | * init/tests/test_job.c (test_new): Check it's -1 |
| 1310 | (test_change_state): Check kill_process is set to PROCESS_MAIN |
| 1311 | when active, or -1 when not. |
| 1312 | * init/tests/test_job_process.c (test_kill): Make sure the |
| 1313 | kill_process member is set and cleared. |
| 1314 | (test_handler): Set the kill_process member for the timer and make |
| 1315 | sure it's cleared when appropriate. |
| 1316 | |
Scott James Remnant | 5064337 | 2009-01-28 03:49:56 +0000 | [diff] [blame] | 1317 | * init/job_class.c (job_class_start, job_class_stop) |
| 1318 | (job_class_restart): Use nih_local to eliminate nih_alloc_reparent, |
| 1319 | and to clean up some of the code too. |
| 1320 | |
Scott James Remnant | 041e7cd | 2009-01-28 03:41:47 +0000 | [diff] [blame] | 1321 | * init/job_class.c: Update documentation to match new nih_alloc() |
| 1322 | |
Scott James Remnant | da7839b | 2009-01-28 03:40:23 +0000 | [diff] [blame] | 1323 | * init/parse_job.c (parse_on_operator, parse_on_collect): |
| 1324 | Use an nih_ref/nih_unref pair instead of nih_alloc_reparent; this |
| 1325 | is not ideal, but then this code is rather messy and leaves a lot |
| 1326 | of allocated data attached to the object on the assumption that |
| 1327 | it will be thrown away. |
| 1328 | |
Scott James Remnant | ee5b420 | 2009-01-28 03:34:42 +0000 | [diff] [blame] | 1329 | * init/event_operator.c: Update documentation to match new nih_alloc() |
| 1330 | (event_operator_match): Use nih_local on expanded value. |
| 1331 | (event_operator_environment): Make evlist nih_local, it will be |
| 1332 | referenced by the environment array on success |
| 1333 | |
Scott James Remnant | ad9468a | 2009-01-28 03:27:51 +0000 | [diff] [blame] | 1334 | * init/event_operator.c (event_operator_new): Reference the |
| 1335 | event instead of reparenting it. |
| 1336 | |
Scott James Remnant | cf14eeb | 2009-01-28 03:26:36 +0000 | [diff] [blame] | 1337 | * init/event.c: Update documentation to match new nih_alloc() |
| 1338 | (event_finished): Use nih_local to tidy up a slight bit. |
| 1339 | |
Scott James Remnant | dec386b | 2009-01-28 03:24:22 +0000 | [diff] [blame] | 1340 | * init/event.c (event_new): Reference the event, don't reparent |
| 1341 | (event_pending_handle_jobs): Use nih_local for environment array |
| 1342 | and for the job name, damn I love this thing. Reference the array |
| 1343 | into the job to avoid freeing. |
| 1344 | |
Scott James Remnant | 5c54005 | 2009-01-28 03:17:04 +0000 | [diff] [blame] | 1345 | * init/parse_job.c (parse_job): Update documentation to match |
| 1346 | new nih_alloc() |
| 1347 | (parse_process, parse_on_operator, stanza_start, stanza_stop) |
| 1348 | (stanza_expect, stanza_kill, stanza_respawn, stanza_normal) |
| 1349 | (stanza_session, stanza_console, stanza_nice, stanza_umask) |
| 1350 | (stanza_oom, stanza_limit): Use nih_local for all the temporary |
| 1351 | arguments where we can. |
| 1352 | |
Scott James Remnant | 1bff7d6 | 2009-01-28 03:00:00 +0000 | [diff] [blame] | 1353 | * init/parse_job.c (parse_on_operand, stanza_env, stanza_export) |
| 1354 | (stanza_emits): Make temporary string variables use nih_local, |
| 1355 | this gives us a massive code clean-up and makes nih_str_array_addp |
| 1356 | safe to take a reference. |
| 1357 | |
Scott James Remnant | c54150c | 2009-01-28 02:50:06 +0000 | [diff] [blame] | 1358 | * init/job_process.c (job_process_run): Make argv, env, script and |
| 1359 | cmd all use nih_local, this cleans up the code a little and makes |
| 1360 | nih_str_array_addp safe to take a reference. |
| 1361 | |
Scott James Remnant | c4c2af9 | 2009-01-28 02:45:04 +0000 | [diff] [blame] | 1362 | * init/environ.c: Update documentation to match new nih_alloc() |
| 1363 | |
Scott James Remnant | 07a9348 | 2009-01-28 02:30:00 +0000 | [diff] [blame] | 1364 | * init/tests/test_job_process.c (test_run): Check that trailing |
| 1365 | newlines are ignored when running a script (can verify r1025 is |
| 1366 | fixed with gdb) |
| 1367 | |
Scott James Remnant | bfc9851 | 2009-01-28 02:13:23 +0000 | [diff] [blame] | 1368 | * init/tests/test_environ.c (test_expand): Add a test case for the |
| 1369 | bug fixed in r1027, the implicit case of the gap in the environment |
| 1370 | string being the same size as the value replacing it. |
| 1371 | |
Scott James Remnant | 23b5982 | 2009-01-28 02:09:12 +0000 | [diff] [blame] | 1372 | * init/environ.c (environ_add): Use nih_local for new_str, making |
| 1373 | the code paths a little simpler and ensuring we pass something that |
| 1374 | can be referenced to nih_str_array_addp() |
| 1375 | |
Scott James Remnant | 4d34eb2 | 2009-01-28 02:07:32 +0000 | [diff] [blame] | 1376 | * init/tests/test_event.c (test_new): Make sure that env is an |
| 1377 | orphan with TEST_ALLOC_ORPHAN. |
| 1378 | * init/tests/test_event_operator.c (test_operator_new): Make sure |
| 1379 | that env is an orphan with TEST_ALLOC_ORPHAN. |
| 1380 | (test_operator_copy): Drop pointless NULL parent check. |
| 1381 | |
Scott James Remnant | f6becd4 | 2009-01-28 02:02:06 +0000 | [diff] [blame] | 1382 | * init/tests/test_control.c: Include limits.h |
| 1383 | |
Scott James Remnant | 754a875 | 2009-01-28 02:00:35 +0000 | [diff] [blame] | 1384 | * init/blocked.c (blocked_new): Take a reference to the message, |
| 1385 | otherwise it will be freed; we free the Blocked structure when we're |
| 1386 | done, so will automatically unref the message. |
| 1387 | * init/tests/test_blocked.c (test_new): Add tests to make sure the |
| 1388 | reference is taken. |
| 1389 | * init/tests/test_job.c (test_start, test_stop, test_restart): |
| 1390 | Make sure the message is referenced when an error is not returned |
| 1391 | but not referenced when one is. |
| 1392 | * init/tests/test_job_class.c (test_start, test_stop) |
| 1393 | (test_restart): Make sure the message is referenced when an error |
| 1394 | is not returned but not referenced when one is. |
| 1395 | * init/tests/test_control.c (test_emit_event): Make sure that |
| 1396 | the message is referenced. |
| 1397 | |
Scott James Remnant | 4cccfff | 2009-01-28 01:35:25 +0000 | [diff] [blame] | 1398 | * init/tests/test_blocked.c: Change nih/dbus.h include to |
| 1399 | nih-dbus/dbus_message.h |
| 1400 | * init/tests/test_control.c: Change nih/dbus.h include to error, |
| 1401 | connection and object; include D-Bus test macros. |
| 1402 | * init/tests/test_job.c: Change nih/dbus.h include to error, message |
| 1403 | and object; include D-Bus test macros |
| 1404 | * init/tests/test_job_class.c: Change nih/dbus.h include to error, |
| 1405 | message and object; include D-Bus test macros |
| 1406 | |
Scott James Remnant | 8269cac | 2009-01-28 01:31:02 +0000 | [diff] [blame] | 1407 | * init/job_class.h: Change nih/dbus.h include to |
| 1408 | nih-dbus/dbus_message.h and include the actual D-Bus header |
| 1409 | * init/job_class.c: Change nih/dbus.h include to error, message, |
| 1410 | object and util. |
| 1411 | |
Scott James Remnant | 1e78bc2 | 2009-01-28 01:30:56 +0000 | [diff] [blame] | 1412 | * init/job.h: Change nih/dbus.h include to nih-dbus/dbus_message.h |
| 1413 | and include the actual D-Bus header |
| 1414 | * init/job.c: Change nih/dbus.h include to error, message, object |
| 1415 | and util. |
| 1416 | |
Scott James Remnant | e8c0386 | 2009-01-28 01:25:44 +0000 | [diff] [blame] | 1417 | * init/control.h: Change nih/dbus.h include to nih-dbus/dbus_message.h |
| 1418 | and include the actual D-Bus header |
| 1419 | * init/control.c: Change nih/dbus.h include to error, connection, |
| 1420 | message and object includes. |
| 1421 | |
Scott James Remnant | 5798222 | 2009-01-28 01:22:31 +0000 | [diff] [blame] | 1422 | * init/blocked.h: Change nih/dbus.h include to nih-dbus/dbus_message.h |
| 1423 | * init/blocked.c: Change nih/dbus.h include to nih-dbus/dbus_message.h |
| 1424 | |
Scott James Remnant | 961ad21 | 2009-01-27 00:54:13 +0000 | [diff] [blame] | 1425 | 2009-01-27 Scott James Remnant <scott@netsplit.com> |
| 1426 | |
| 1427 | * init/Makefile.am: Update paths to libnih-dbus dependencies. |
| 1428 | |
Scott James Remnant | 2e8760b | 2009-01-26 01:15:21 +0000 | [diff] [blame] | 1429 | 2009-01-26 Scott James Remnant <scott@netsplit.com> |
| 1430 | |
Scott James Remnant | 9b25c8d | 2009-01-26 15:35:51 +0000 | [diff] [blame] | 1431 | * configure.ac (AC_CONFIG_FILES): Add nih-dbus sub-directory |
| 1432 | * Makefile.am (SUBDIRS): Add nih-dbus sub-directory |
| 1433 | |
Scott James Remnant | fcb81e6 | 2009-01-26 15:26:29 +0000 | [diff] [blame] | 1434 | * configure.ac: Bump copyright to 2009 |
| 1435 | |
Scott James Remnant | 32804e8 | 2009-01-26 15:25:57 +0000 | [diff] [blame] | 1436 | * configure.ac: Matching libnih, we now mandate libtool 2.2.x |
| 1437 | * HACKING: Update dependency requirement to 2.2.4 |
| 1438 | |
Scott James Remnant | fc2b4f4 | 2009-01-26 01:18:12 +0000 | [diff] [blame] | 1439 | * init/init.supp: Adjust suppression for glibc 2.8 |
| 1440 | |
Scott James Remnant | 4b2dcc6 | 2009-01-26 01:17:59 +0000 | [diff] [blame] | 1441 | * init/tests/test_event.c (test_finished): Remove erroneous test |
| 1442 | of free'd memory. |
| 1443 | |
Scott James Remnant | e32ab4f | 2009-01-26 01:17:21 +0000 | [diff] [blame] | 1444 | * configure.ac: Bump version to 0.5.1 |
| 1445 | |
Scott James Remnant | de22f42 | 2009-01-26 01:16:17 +0000 | [diff] [blame] | 1446 | * init/tests/test_event_operator.c (test_operator_handle): Add a |
| 1447 | test for duplicate events when already matched. |
| 1448 | * init/event_operator.c (event_operator_handle): Skip if already |
| 1449 | matched. |
| 1450 | |
Scott James Remnant | 2e8760b | 2009-01-26 01:15:21 +0000 | [diff] [blame] | 1451 | * README: Update features and requirements. |
| 1452 | * NEWS: Copy in news from 0.5.0; that release doesn't appear in |
| 1453 | this ChangeLog since it was made on a separate branch. |
| 1454 | |
Scott James Remnant | e4bbac0 | 2009-01-26 01:12:16 +0000 | [diff] [blame] | 1455 | 2009-01-26 Casey Dahlin <cdahlin@redhat.com> |
| 1456 | |
| 1457 | * init/environ.c (environ_expand_until): Handle the implicit case |
| 1458 | of the gap in the string being the same size of the value. |
Scott James Remnant | 571b070 | 2009-01-26 01:05:50 +0000 | [diff] [blame] | 1459 | |
| 1460 | * init/job_process.c (job_process_handler): Handle the case of a |
| 1461 | child being continued by a signal, otherwise we'll assert. |
Scott James Remnant | 07b2bc7 | 2009-01-26 01:03:35 +0000 | [diff] [blame] | 1462 | |
| 1463 | * init/job_process.c (job_process_run): Double-check that the |
| 1464 | newline(s) we see are at the end of the script before stripping, |
| 1465 | since we can fall through if the newline is mid-script but /dev/fd |
| 1466 | isn't mounted. |
| 1467 | |
Scott James Remnant | fd8a043 | 2008-07-05 17:30:04 +0100 | [diff] [blame] | 1468 | 2008-07-05 Scott James Remnant <scott@netsplit.com> |
| 1469 | |
| 1470 | * TODO: Update. |
| 1471 | |
Scott James Remnant | dd8abca | 2008-07-01 19:36:44 +0100 | [diff] [blame] | 1472 | 2008-07-01 Scott James Remnant <scott@netsplit.com> |
| 1473 | |
| 1474 | * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): |
| 1475 | ($(com_ubuntu_Upstart_Job_OUTPUTS)): |
| 1476 | ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Must be newer than the |
| 1477 | source for the dbus tool, and ensure the dbus tool is built |
| 1478 | |
Scott James Remnant | 55f3c7c | 2008-06-30 17:37:27 +0100 | [diff] [blame] | 1479 | 2008-06-30 Scott James Remnant <scott@netsplit.com> |
| 1480 | |
| 1481 | * init/Makefile.am: Update along with libnih so that we leave the |
| 1482 | D-Bus bindings in the dist tarball, meaning Python is no longer a |
| 1483 | build-dependency. |
| 1484 | |
Scott James Remnant | ce2b3b2 | 2008-06-11 08:21:35 +0100 | [diff] [blame] | 1485 | 2008-06-11 Scott James Remnant <scott@netsplit.com> |
| 1486 | |
Scott James Remnant | 9a14095 | 2008-06-11 08:22:03 +0100 | [diff] [blame] | 1487 | * Makefile.am (SUBDIRS): List dbus before init in case we need to |
| 1488 | generate anything in that directory later on. |
| 1489 | |
Scott James Remnant | ce2b3b2 | 2008-06-11 08:21:35 +0100 | [diff] [blame] | 1490 | * Makefile.am (SUBDIRS): List po last so that update-po is run after |
| 1491 | generating any sources. |
| 1492 | |
Scott James Remnant | 3fb4838 | 2008-06-08 02:03:40 +0100 | [diff] [blame] | 1493 | 2008-06-08 Scott James Remnant <scott@netsplit.com> |
| 1494 | |
Scott James Remnant | 94d75a1 | 2008-06-08 04:08:56 +0100 | [diff] [blame] | 1495 | * init/Makefile.am (EXTRA_DIST): Ship the built sources, don't |
| 1496 | clean them. |
| 1497 | (maintainer-clean-local): Well, not unless maintainer-clean anyway |
| 1498 | |
| 1499 | * init/job.c, init/job_class.c: Add missing errno.h include |
| 1500 | |
Scott James Remnant | b40e4dd | 2008-06-08 03:26:36 +0100 | [diff] [blame] | 1501 | * dbus/com.ubuntu.Upstart.Job.xml (GetInstance): Add method to get |
| 1502 | an instance name in the same basic manner as start and stop would, |
| 1503 | though this one's synchronous. |
| 1504 | * init/job_class.c (job_class_get_instance): Implementing by copying |
| 1505 | the relevant bit of Stop. |
| 1506 | * init/job_class.h: Add prototype. |
| 1507 | * init/tests/test_job_class.c (test_get_instance): Add tests. |
| 1508 | * TODO: Continue to document the C&P madness. |
| 1509 | |
Scott James Remnant | 39a8a0c | 2008-06-08 03:08:55 +0100 | [diff] [blame] | 1510 | * init/conf.c (conf_reload_path): Read file directly into memory, |
| 1511 | not using mmap. |
| 1512 | |
Scott James Remnant | 6591fef | 2008-06-08 03:08:39 +0100 | [diff] [blame] | 1513 | * compat/sysv/reboot.c, compat/sysv/runlevel.c, compat/sysv/shutdown.c, |
| 1514 | * compat/sysv/telinit.c: Move into the util directory; we're going |
| 1515 | to support limited SysV-a-like commands without full compatibility |
| 1516 | which is what we always did, and I'm not going to worry about adding |
| 1517 | others. |
| 1518 | * compat/sysv/man/reboot.8, compat/sysv/runlevel.8, |
| 1519 | * compat/sysv/man/shutdown.8, compat/sysv/telinit.8: Move as well. |
| 1520 | * compat/sysv/Makefile.am, util/Makefile.am: Merge. |
| 1521 | * configure.ac: Remove the (commented out) compat/sysv and logd |
| 1522 | Remove the --enable-compat option. |
| 1523 | * Makefile.am (SUBDIRS): Remove (commented out) compat/sysv and logd |
| 1524 | |
Scott James Remnant | 3e205a4 | 2008-06-08 02:13:33 +0100 | [diff] [blame] | 1525 | * logd/Makefile.am, logd/main.c, logd/man/logd.8, logd/jobs.d/logd.in: |
| 1526 | Consign logd to oblivion. We haven't supported it for ages, it has |
| 1527 | non-working issues, and there's got to be a better way to do this. |
| 1528 | |
Scott James Remnant | d25ffae | 2008-06-08 02:12:10 +0100 | [diff] [blame] | 1529 | * TODO: Update. |
| 1530 | |
Scott James Remnant | b3a1e7b | 2008-06-08 02:09:31 +0100 | [diff] [blame] | 1531 | * init/job.c (job_change_goal): Adjust the documentation. After |
| 1532 | careful thought, there's no way this can return after freeing the |
| 1533 | job, since it'll either block on an event, a process or do nothing. |
| 1534 | |
Scott James Remnant | 1d0a1e7 | 2008-06-08 02:05:49 +0100 | [diff] [blame] | 1535 | * init/job.c (job_start, job_stop, job_restart): Clear the start |
| 1536 | and stop environment, shouldn't necessarily make a difference, but |
| 1537 | it pays to be consistent. |
| 1538 | |
Scott James Remnant | 3fb4838 | 2008-06-08 02:03:40 +0100 | [diff] [blame] | 1539 | * dbus/com.ubuntu.Upstart.Job.xml (Start, Stop, Restart): Add methods |
| 1540 | to control jobs, all take an environment array and both Start and |
| 1541 | Restart return an instance path so properties, etc. can be obtained |
| 1542 | afterwards. |
| 1543 | * init/job_class.c (job_class_start, job_class_stop) |
| 1544 | (job_class_restart): Add the code for the top halves of the methods |
| 1545 | * init/job_class.h: Add prototypes for the new methods. |
| 1546 | * init/job.c (job_finished): And the bottom halves go here. |
| 1547 | * init/tests/test_job_class.c (test_start, test_stop) |
| 1548 | (test_restart): Add test cases for the methods. |
| 1549 | * init/blocked.h (blocked_type): Add enums for the new methods. |
| 1550 | * init/blocked.c (blocked_new): Handle the new methods here. |
| 1551 | * init/tests/test_blocked.c (test_new): Add add tests for handling. |
| 1552 | |
Scott James Remnant | b7673b0 | 2008-06-07 01:28:39 +0100 | [diff] [blame] | 1553 | 2008-06-07 Scott James Remnant <scott@netsplit.com> |
| 1554 | |
Scott James Remnant | a4d8314 | 2008-06-07 22:59:56 +0100 | [diff] [blame] | 1555 | * init/job_process.c (job_process_terminated): Don't check the goal |
| 1556 | to see whether the main process was allowed to terminate, check the |
| 1557 | state. A termination is only not a failure if we're on the KILLED |
| 1558 | state (ie. we killed it), otherwise it can still be a failure even |
| 1559 | if it was going to stop anyway. |
| 1560 | * init/tests/test_job_process.c (test_handler): Add a test case. |
| 1561 | |
Scott James Remnant | e8762cb | 2008-06-07 21:11:20 +0100 | [diff] [blame] | 1562 | * init/control.c (control_emit_event): Use environ_all_valid here(), |
| 1563 | also reorder the blocking stuff to be less strange, it's ok to free |
| 1564 | environment. |
| 1565 | * init/tests/test_control.c (test_emit_event): The event array should |
| 1566 | be a child of message, which means it doesn't matter if the function |
| 1567 | we call frees it. |
| 1568 | |
Scott James Remnant | a5e8e94 | 2008-06-07 21:06:56 +0100 | [diff] [blame] | 1569 | * init/environ.c (environ_all_valid): Add a validation function for |
| 1570 | external input. |
| 1571 | * init/environ.h: Add prototype. |
| 1572 | * init/tests/test_environ.c (test_all_valid): Test function. |
| 1573 | |
Scott James Remnant | 1a12992 | 2008-06-07 20:56:13 +0100 | [diff] [blame] | 1574 | * init/environ.c: Note that we can call this in a loop with OOM, |
| 1575 | since the resulting table will always be the same. |
| 1576 | |
Scott James Remnant | 44978b6 | 2008-06-07 20:54:49 +0100 | [diff] [blame] | 1577 | * init/event_operator.c (event_operator_environment): Use |
| 1578 | environ_append(), and while we're at it, there's no reason this should |
| 1579 | use NIH_MUST. |
| 1580 | * init/event_operator.h: Adjust prototype. |
| 1581 | * init/tests/test_event_operator.c (test_operator_environment): Allow |
| 1582 | for failure. |
| 1583 | * init/event.c (event_pending_handle_jobs): Call with NIH_MUST, |
| 1584 | which is actually safe. |
| 1585 | |
Scott James Remnant | a175f3b | 2008-06-07 20:20:11 +0100 | [diff] [blame] | 1586 | * init/job_class.c (job_class_environment): Use environ_append() |
| 1587 | |
Scott James Remnant | 90b6f3f | 2008-06-07 20:17:29 +0100 | [diff] [blame] | 1588 | * init/environ.c (environ_append): There are multiple cases where we |
| 1589 | append one environment table onto another, so we should have a |
| 1590 | function to do that. |
| 1591 | * init/environ.h: Prototype for it. |
| 1592 | * init/tests/test_environ.c (test_append): Test the new function. |
| 1593 | |
Scott James Remnant | fd36498 | 2008-06-07 03:40:29 +0100 | [diff] [blame] | 1594 | * init/job_process.c (job_process_run): Invert the logic; we nearly |
| 1595 | always want to pass the script with /dev/fd/NNN. The only times we |
| 1596 | don't are if it doesn't exist, or if we're dealing with a single-line |
| 1597 | shell script. |
| 1598 | * init/tests/test_job_process.c (test_run): Update test cases to |
| 1599 | only expect an argv-execution for single-line scripts. |
| 1600 | |
Scott James Remnant | 345fc02 | 2008-06-07 01:40:32 +0100 | [diff] [blame] | 1601 | * init/job.c (job_restart): Wrote the blocking bit slightly weirdly |
| 1602 | without neededing to, so leave it as it should be. |
| 1603 | |
Scott James Remnant | e22f7a2 | 2008-06-07 01:36:43 +0100 | [diff] [blame] | 1604 | * TODO: Update. |
| 1605 | |
Scott James Remnant | b7673b0 | 2008-06-07 01:28:39 +0100 | [diff] [blame] | 1606 | * dbus/com.ubuntu.Upstart.Instance.xml (Start, Stop, Restart): Add |
| 1607 | simple instance control methods, these only change the goal of an |
| 1608 | existing instance - thus cannot pass environment. |
| 1609 | * init/job.c (job_start, job_stop, job_restart): Add methods, which |
| 1610 | look spookily similar to each other, except for the subtle yet |
| 1611 | important differences. |
| 1612 | (job_finished): Implement bottom halves. |
| 1613 | * init/job.h: Add prototypes. |
| 1614 | * init/tests/test_job.c (test_start, test_stop, test_restart): Add |
| 1615 | tests for the new methods. |
| 1616 | * init/blocked.h (blocked_type): Add enums for methods. |
| 1617 | * init/blocked.c (blocked_new): Handle methods here too |
| 1618 | * init/tests/test_blocked.c (test_new): Add tests for them. |
| 1619 | |
Scott James Remnant | d0258e0 | 2008-06-06 02:09:38 +0100 | [diff] [blame] | 1620 | 2008-06-06 Scott James Remnant <scott@netsplit.com> |
| 1621 | |
Scott James Remnant | 088f59a | 2008-06-06 23:00:35 +0100 | [diff] [blame] | 1622 | * init/blocked.h (blocked_type): Having a single message type won't |
| 1623 | work for the job cases, so expand to have many. |
| 1624 | * init/blocked.c (blocked_new): We'll just have to list them all here. |
| 1625 | * init/control.c (control_emit_event): Happily we create them |
| 1626 | individually anyway. |
| 1627 | * init/event.c (event_finished): And since we have to handle them |
| 1628 | individually, it'll actually protect us replying to the wrong one. |
| 1629 | |
Scott James Remnant | a78145a | 2008-06-06 03:57:54 +0100 | [diff] [blame] | 1630 | * init/tests/test_conf.c (test_source_reload): Clean up the temporary |
| 1631 | directory. |
| 1632 | * init/tests/test_control.c (test_reload_configuration): That goes |
| 1633 | for this one too. |
| 1634 | |
Scott James Remnant | 6921caa | 2008-06-06 03:52:15 +0100 | [diff] [blame] | 1635 | * init/tests/test_control.c (my_connect_handler): Use TEST_DBUS_MESSAGE |
| 1636 | instead of a pop/read/write loop. |
| 1637 | (test_emit_event): Renamed TEST_DBUS_CONN to TEST_DBUS_OPEN. |
| 1638 | * init/tests/test_job.c (test_new, test_register) |
| 1639 | (test_change_state): Use TEST_DBUS_OPEN and TEST_DBUS_CLOSE to setup |
| 1640 | and tear down D-Bus connections and TEST_DBUS_MESSAGE instead of |
| 1641 | a loop. |
| 1642 | * init/tests/test_job_class.c (test_consider, test_reconsider) |
| 1643 | (test_register, test_unregister): Likewise. |
| 1644 | |
Scott James Remnant | df8435e | 2008-06-06 03:39:17 +0100 | [diff] [blame] | 1645 | * init/control.c (control_get_job_by_name): Sanity check the name |
| 1646 | of a job in the same way; we don't need to sanity check the instance |
| 1647 | name because "" is valid (and the default for singletons). |
| 1648 | * init/tests/test_control.c (test_get_job_by_name): Test. |
| 1649 | |
Scott James Remnant | b36155b | 2008-06-06 03:34:16 +0100 | [diff] [blame] | 1650 | * dbus/com.ubuntu.Upstart.xml (EmitEvent): Add an asynchronous |
| 1651 | method to emit an event, providing the name and accompanying |
| 1652 | environment. No return value, it either works or you get an |
| 1653 | error. |
| 1654 | * init/control.c (control_emit_event): Implement top half of the |
| 1655 | method, blocking the message in the event. |
| 1656 | * init/control.h: Add prototype. |
| 1657 | * init/event.c (event_finished): Implement the bottom half which |
| 1658 | sends the reply or error, these are actually tested along with |
| 1659 | the top for sanity reasons. |
| 1660 | * init/tests/test_control.c (test_emit_event): Test the various |
| 1661 | ways the method may be used and abused; the async nature means |
| 1662 | we actually need a real D-Bus server to do this. |
| 1663 | * TODO: Update. |
| 1664 | |
Scott James Remnant | d0258e0 | 2008-06-06 02:09:38 +0100 | [diff] [blame] | 1665 | * init/event.c (event_new): There's no reason this shouldn't be |
| 1666 | allowed to return insufficient memory, so do so. |
| 1667 | (event_finished): Wrap call. |
| 1668 | * init/tests/test_event.c (test_new): Add alloc failed test. |
| 1669 | * init/job.c (job_emit_event): Must create the event. |
| 1670 | * init/main.c (main, cad_handler, kbd_handler, pwr_handler): Wrap |
| 1671 | with NIH_MUST |
| 1672 | |
Scott James Remnant | 01735c0 | 2008-06-05 00:38:56 +0100 | [diff] [blame] | 1673 | 2008-06-05 Scott James Remnant <scott@netsplit.com> |
| 1674 | |
Scott James Remnant | 02ee200 | 2008-06-05 22:07:43 +0100 | [diff] [blame] | 1675 | * TODO: Update. |
| 1676 | |
Scott James Remnant | ad4afe2 | 2008-06-05 22:05:21 +0100 | [diff] [blame] | 1677 | * init/job.c (job_unblock): Rename to job_finished, since this |
| 1678 | does not behave like event_unblock but more like event_finished |
| 1679 | (job_change_state, job_failed): Change name in call. |
| 1680 | * init/job.h: Update prototype. |
| 1681 | * init/tests/test_job.c (test_unblock): Rename to test_finished |
| 1682 | * init/event.c (event_pending_handle_jobs): Update calls here. |
| 1683 | |
Scott James Remnant | 81e74e0 | 2008-06-05 22:00:56 +0100 | [diff] [blame] | 1684 | * init/job.h (Job): Rename blocked to blocker to match event, since |
| 1685 | it has the same use as event->blockers except it's a toggle |
| 1686 | * init/job.c (job_new, job_change_state): Rename where used |
| 1687 | * init/event.c (event_finished): Rename here also since its reset |
| 1688 | * init/tests/test_job.c, init/tests/test_job_process.c, |
| 1689 | * init/tests/test_event.c: Rename in test cases too. |
| 1690 | |
Scott James Remnant | 4ff5c7c | 2008-06-05 21:57:44 +0100 | [diff] [blame] | 1691 | * init/job.c (job_emit_event): Add a Blocked record to the event's |
| 1692 | blocking list for the starting and stopping events. |
| 1693 | * init/tests/test_job.c (test_emit_event): Add tests for the record |
| 1694 | being added to the list with the right details. |
| 1695 | (test_change_goal): Make sure that a Blocked record is added |
| 1696 | (test_change_state): Make sure that Blocked records are added |
| 1697 | * init/tests/test_job_process.c (test_handler): Also make sure |
| 1698 | that Blocked records are added. |
| 1699 | |
Scott James Remnant | 2ef01a9 | 2008-06-05 21:31:25 +0100 | [diff] [blame] | 1700 | * init/event.c (event_finished): Clear jobs referenced in the |
| 1701 | blocking list, rather than iterating the entire jobs hash. |
| 1702 | (event_finished_handle_jobs): Drop this function. |
| 1703 | * init/tests/test_event.c (test_finished, test_finished_handle_jobs): |
| 1704 | Merge tests again and test using both the blocking list and job's |
| 1705 | blocked member. |
| 1706 | |
Scott James Remnant | db7e92b | 2008-06-05 21:15:54 +0100 | [diff] [blame] | 1707 | * init/event.h (event): Add blocking member. |
| 1708 | * init/event.c (event_new): Initialising blocking list. |
| 1709 | * init/tests/test_event.c (test_new): Make sure it's initialised |
| 1710 | to an empty list. |
| 1711 | |
Scott James Remnant | 9e919ba | 2008-06-05 21:01:42 +0100 | [diff] [blame] | 1712 | * init/tests/test_job_process.c (test_handler): Update tests to use |
| 1713 | Blocked. |
| 1714 | |
Scott James Remnant | ea48928 | 2008-06-05 20:52:45 +0100 | [diff] [blame] | 1715 | * init/event.c (event_pending_handle_jobs): Collect environment |
| 1716 | and events independantly, which means we don't have to worry about |
| 1717 | the list contents or freeing them up in case of error. |
| 1718 | * init/event_operator.c (event_operator_events): Fix parent. |
| 1719 | * init/tests/test_event.c (test_pending_handle_jobs): Update tests. |
| 1720 | * init/init.supp: Update collect suppression. |
| 1721 | |
Scott James Remnant | 3aa31c8 | 2008-06-05 20:18:17 +0100 | [diff] [blame] | 1722 | * init/event_operator.c (event_operator_collect): Break in two. |
| 1723 | (event_operator_environment): Collect the environment from the event, |
| 1724 | appending the list of event names if necessary. |
| 1725 | (event_operator_events): Block events and pass them to the |
| 1726 | given list. |
| 1727 | * init/event_operator.h: Update prototypes. |
| 1728 | * init/tests/test_event_operator.c (test_operator_collect): Also |
| 1729 | split into two new functions |
| 1730 | (test_operator_environment, test_operator_events): Adjust |
| 1731 | |
Scott James Remnant | 56a1da6 | 2008-06-05 19:47:45 +0100 | [diff] [blame] | 1732 | * init/event_operator.c (event_operator_collect): Placed Blocked |
| 1733 | structures in the list, rather than ordinary entries; I strongly |
| 1734 | suspect that while it's nice to iterate the operator tree only once, |
| 1735 | this needs to be three functions really. |
| 1736 | * init/tests/test_event_operator.c (test_operator_collect): Update |
| 1737 | test suite. |
| 1738 | |
Scott James Remnant | c33e133 | 2008-06-05 19:33:17 +0100 | [diff] [blame] | 1739 | * init/job.h (Job): Make blocking a statically defined list. |
| 1740 | * init/job.c (job_new): Initialise rather than setting to NULL. |
| 1741 | (job_unblock): Assume that blocking members are Blocked structures |
| 1742 | and that the list itself is always iterable. |
| 1743 | * init/tests/test_job.c (test_new): Check the list is empty, rather |
| 1744 | than NULL. |
| 1745 | (test_change_state, test_failed, test_unblock): Change tests cases |
| 1746 | to expect blocking to always be present, and create members as Blocked |
| 1747 | structures. |
| 1748 | |
Scott James Remnant | fa5ccfe | 2008-06-05 19:32:14 +0100 | [diff] [blame] | 1749 | * init/blocked.c (blocked_new): Set destructor (forgotten) |
| 1750 | |
Scott James Remnant | 5b2115f | 2008-06-05 19:31:58 +0100 | [diff] [blame] | 1751 | * init/init.supp: Add setenv, which has crept in |
| 1752 | |
Scott James Remnant | 0fb7dac | 2008-06-05 18:39:21 +0100 | [diff] [blame] | 1753 | * init/blocked.h: Header containing enum, struct and prototype. |
| 1754 | * init/blocked.c (blocked_new): Function to allocate the structure |
| 1755 | with the right details. |
| 1756 | * init/tests/test_blocked.c (test_new): Tests for the new function. |
| 1757 | * init/Makefile.am (init_SOURCES): Compile using blocked.c and header |
| 1758 | (TESTS): Build blocked test suite |
| 1759 | (test_process_LDADD, test_job_class_LDADD) |
| 1760 | (test_job_process_LDADD, test_job_LDADD, test_event_LDADD) |
| 1761 | (test_event_operator_LDADD, test_parse_job_LDADD) |
| 1762 | (test_parse_conf_LDADD, test_conf_LDADD, test_control_LDADD): |
| 1763 | Link blocked.o to most test suites. |
| 1764 | (test_blocked_SOURCES, test_blocked_LDFLAGS, test_blocked_LDADD): |
| 1765 | Details for test suite. |
| 1766 | |
Scott James Remnant | f3ef511 | 2008-06-05 01:26:10 +0100 | [diff] [blame] | 1767 | * init/main.c: Also remove SIGTERM handling, we don't re-exec |
| 1768 | properly and this is a dangerous signal to use anyway. |
| 1769 | (term_handler): Drop function. |
| 1770 | |
Scott James Remnant | 6d271af | 2008-06-05 01:22:53 +0100 | [diff] [blame] | 1771 | * init/main.c: Remove handling for stop/cont; there's no reason |
| 1772 | a user should be able to pause the event queue. |
| 1773 | (stop_handler): Drop function. |
| 1774 | * init/event.c (event_poll): Remove paused handling. |
| 1775 | |
Scott James Remnant | 3d70379 | 2008-06-05 01:20:35 +0100 | [diff] [blame] | 1776 | * init/control.c: Fix doc string. |
| 1777 | |
Scott James Remnant | 8523ba7 | 2008-06-05 01:14:33 +0100 | [diff] [blame] | 1778 | * dbus/com.ubuntu.Upstart.xml (ReloadConfiguration): Add method |
| 1779 | that's effectively the same as the HUP signal. |
| 1780 | * init/control.c (control_reload_configuration): Unsurprisingly, |
| 1781 | the implementation is identical. |
| 1782 | * init/control.h: Add prototype. |
| 1783 | * init/tests/test_control.c (test_reload_configuration): Make sure |
| 1784 | the method works as expected. |
| 1785 | (test_get_job_by_name, test_get_all_jobs): Add missing free calls for |
| 1786 | message in cases of out of memory. |
| 1787 | |
Scott James Remnant | 01735c0 | 2008-06-05 00:38:56 +0100 | [diff] [blame] | 1788 | * dbus/com.ubuntu.Upstart.xml (JobAdded, JobRemoved): Add signals |
| 1789 | for when new jobs are added to the known list and when existing jobs |
| 1790 | are removed, this allows GUIs to always show an up-to-date list. |
| 1791 | * dbus/com.ubuntu.Upstart.Job.xml (InstanceAdded, InstanceRemoved): |
| 1792 | Also add matching signals for when instances are added to the list |
| 1793 | for a job and when they're removed again. |
| 1794 | * init/job_class.c (job_class_register): Emit the JobAdded signal |
| 1795 | for this job when registering if the new signal argument is TRUE; |
| 1796 | pass on the signal argument to job_register() |
| 1797 | (job_class_add): Emit signals when registering jobs with existing |
| 1798 | connections. |
| 1799 | (job_class_unregister): Emit signals when unregistering a job. |
| 1800 | * init/job.c (job_register): Likewise, emit the InstanceAdded signal |
| 1801 | for the job class if the new signal argument is TRUE. |
| 1802 | (job_new): Emit signals when registering instances with existing |
| 1803 | connections. |
| 1804 | (job_change_state): Emit the instance removed signal when destroying |
| 1805 | an inactive instance. |
| 1806 | * init/job_class.h, init/job.h: Add signal argument to prototypes |
| 1807 | * init/control.c (control_register_all): When registering job classes |
| 1808 | on a new connection, do not emit a signal since they will already |
| 1809 | exist at the point when the name appears on the bus or the connection |
| 1810 | is complete. |
| 1811 | * init/tests/test_control.c (test_bus_open): Add comment that we |
| 1812 | are testing for signal non-emission already with the fake server, |
| 1813 | since it was this test that actually made me realise we had to |
| 1814 | not emit them :p |
| 1815 | * init/tests/test_job_class.c (test_register): Test that the signal |
| 1816 | is emitted when signal is TRUE and not emitted when signal is FALSE |
| 1817 | (test_unregister): Test that the JobRemoved signal is emitted |
| 1818 | (test_get_instance_by_name, test_get_all_instances): Free message |
| 1819 | if allocation failed. |
| 1820 | (test_consider, test_reconsider): Test that the JobAdded and |
| 1821 | JobRemoved signals are emitted (or not) when appropriate. |
| 1822 | * init/tests/test_job.c (test_register): Make sure that the |
| 1823 | InstanceAdded signal is emitted when TRUE is passed, and not when |
| 1824 | FALSE is passed. |
| 1825 | (test_new): Make sure the InstanceAdded signal is emitted when the |
| 1826 | job is registered on the bus. |
| 1827 | (test_change_state): Make sure the InstanceRemoved signal is sent |
| 1828 | when deleting an instance. |
| 1829 | |
Scott James Remnant | bd3504a | 2008-06-02 16:00:27 +0100 | [diff] [blame] | 1830 | 2008-06-02 Scott James Remnant <scott@netsplit.com> |
| 1831 | |
Scott James Remnant | e49832c | 2008-06-02 16:12:22 +0100 | [diff] [blame] | 1832 | * init/tests/test_job.c (test_new, test_register): Also use a private |
| 1833 | dbus server to avoid session bus problems. |
| 1834 | |
Scott James Remnant | f18c5ae | 2008-06-02 16:10:23 +0100 | [diff] [blame] | 1835 | * init/tests/test_job_class.c (test_consider, test_reconsider) |
| 1836 | (test_register, test_unregister): Use a private dbus server instead |
| 1837 | of connecting to the session bus, which might not be there. |
| 1838 | |
Scott James Remnant | 77446ca | 2008-06-02 16:05:28 +0100 | [diff] [blame] | 1839 | * init/tests/test_control.c (test_disconnected): Simplify using a |
| 1840 | private dbus server rather than faking one. |
| 1841 | |
Scott James Remnant | bd3504a | 2008-06-02 16:00:27 +0100 | [diff] [blame] | 1842 | * init/tests/test_control.c (test_bus_close): Don't rely on being |
| 1843 | able to connect to the various buses, instead use a special private |
| 1844 | one. |
| 1845 | |
Scott James Remnant | 51980bc | 2008-06-01 19:22:11 +0100 | [diff] [blame] | 1846 | 2008-06-01 Scott James Remnant <scott@netsplit.com> |
| 1847 | |
Scott James Remnant | 92f2cc4 | 2008-06-01 20:42:30 +0100 | [diff] [blame] | 1848 | * dbus/com.ubuntu.Upstart.Job.xml (GetAllInstances): And also add |
| 1849 | a similar method to return the object path of all instances of a |
| 1850 | particular job. |
| 1851 | * init/job_class.c (job_class_get_all_instances): Implement the |
| 1852 | method, pretty much the same as the other. |
| 1853 | * init/job_class.h: Add prototype. |
| 1854 | * init/control.c: Fix comment. |
| 1855 | * init/tests/test_control.c (test_get_all_jobs): Ensure that the |
| 1856 | individual paths are children of the array. |
| 1857 | |
Scott James Remnant | 30abe7c | 2008-06-01 20:31:09 +0100 | [diff] [blame] | 1858 | * dbus/com.ubuntu.Upstart.xml (GetAllJobs): Add method to return |
| 1859 | the object path of all known jobs. |
| 1860 | * init/control.c (control_get_all_jobs): Implement the method, |
| 1861 | somewhat simple happily. |
| 1862 | * init/control.h: Add prototype for the method. |
| 1863 | * init/tests/test_control.c (test_get_all_jobs): Test that the |
| 1864 | right data is returned. |
| 1865 | |
Scott James Remnant | e9876b7 | 2008-06-01 19:49:39 +0100 | [diff] [blame] | 1866 | * dbus/com.ubuntu.Upstart.xml, dbus/com.ubuntu.Upstart.Job.xml, |
| 1867 | * dbus/com.ubuntu.Upstart.Instance.xml: Add libnih XML NS to the |
| 1868 | files so that we can tag methods as sync or async later. |
| 1869 | |
Scott James Remnant | 9c22138 | 2008-06-01 19:43:48 +0100 | [diff] [blame] | 1870 | * init/control.c (control_get_job_by_name): Remove const from |
| 1871 | return parameter. |
| 1872 | * init/control.h: Update prototype. |
| 1873 | * init/tests/test_control.c (test_get_job_by_name): Remove const |
| 1874 | from path type. |
| 1875 | |
Scott James Remnant | 8c69f7b | 2008-06-01 19:40:33 +0100 | [diff] [blame] | 1876 | * init/job_class.c (job_class_get_instance_by_name): Remove wrong |
| 1877 | const from parameter now that we've fixed the bindings generator. |
| 1878 | * init/job_class.h: Update prototype to match. |
| 1879 | * init/tests/test_job_class.c (test_get_instance_by_name): Change |
| 1880 | type of path to match. |
| 1881 | |
Scott James Remnant | 00c8b99 | 2008-06-01 19:27:04 +0100 | [diff] [blame] | 1882 | * HACKING (Dependencies): clarify that autoreconf and configure need |
| 1883 | to be run for libnih first. |
| 1884 | |
Scott James Remnant | 51980bc | 2008-06-01 19:22:11 +0100 | [diff] [blame] | 1885 | * init/Makefile.am (test_process_LDADD, test_job_class_LDADD) |
| 1886 | (test_job_process_LDADD, test_job_LDADD, test_event_LDADD) |
| 1887 | (test_event_operator_LDADD, test_parse_job_LDADD) |
| 1888 | (test_parse_conf_LDADD, test_conf_LDADD, test_control_LDADD): Link |
| 1889 | the auto-generated D-Bus code in, otherwise the tests won't be |
| 1890 | complete. |
| 1891 | |
Scott James Remnant | 50677e0 | 2008-05-24 13:09:50 +0200 | [diff] [blame] | 1892 | 2008-05-24 Scott James Remnant <scott@netsplit.com> |
| 1893 | |
| 1894 | * HACKING: Changed branch location again, of both upstart and |
| 1895 | libnih. |
| 1896 | |
Scott James Remnant | 9a7282e | 2008-05-16 00:04:52 +0200 | [diff] [blame] | 1897 | 2008-05-16 Scott James Remnant <scott@netsplit.com> |
| 1898 | |
| 1899 | * init/job_class.c (job_class_consider, job_class_reconsider): Find |
| 1900 | the best class first and compare against the current class before |
| 1901 | acting, this avoids the re-register jump every time a job stops. |
| 1902 | (job_class_select): Rename to job_class_add() since this is takes |
| 1903 | a class and is the direct opposite to job_class_remove(). |
| 1904 | |
Scott James Remnant | 88345b8 | 2008-05-15 23:58:05 +0200 | [diff] [blame] | 1905 | 2008-05-15 Scott James Remnant <scott@netsplit.com> |
| 1906 | |
| 1907 | * init/event.c (event_new): We can't rely on the event poll function |
| 1908 | being the last in the main loop, it's often the first, so after |
| 1909 | adding an event to the queue ensure the loop is iterated at least |
| 1910 | once so that the event poll occurs for it. |
| 1911 | |
Scott James Remnant | a645a99 | 2008-05-09 00:15:49 +0100 | [diff] [blame] | 1912 | 2008-05-09 Scott James Remnant <scott@netsplit.com> |
| 1913 | |
Scott James Remnant | 6308bb1 | 2008-05-09 03:05:47 +0100 | [diff] [blame] | 1914 | * TODO (Anytime): Update. |
| 1915 | |
Scott James Remnant | 54ef751 | 2008-05-09 03:04:49 +0100 | [diff] [blame] | 1916 | * dbus/com.ubuntu.Upstart.Instance.xml: format to match others |
| 1917 | |
Scott James Remnant | b0ce81e | 2008-05-09 03:04:29 +0100 | [diff] [blame] | 1918 | * dbus/com.ubuntu.Upstart.Job.xml (GetInstanceByName): Add method |
| 1919 | * init/job_class.c (job_class_get_instance_by_name): Implementation. |
| 1920 | * init/job_class.h: Add prototype. |
| 1921 | * init/tests/test_job_class.c (test_get_instance_by_name): Tests |
| 1922 | for new method. |
| 1923 | |
Scott James Remnant | 6fa0b49 | 2008-05-09 02:58:41 +0100 | [diff] [blame] | 1924 | * init/job_class.h (JobClass): Make instances a hash table. |
| 1925 | * init/job_class.c (job_class_new): Initialise instances as a hash |
| 1926 | table now. |
| 1927 | (job_class_register): Iterate instances as hash table. |
| 1928 | (job_class_remove): Slightly odd construct needed to return FALSE |
| 1929 | if there's anything in the hash table. |
| 1930 | (job_class_unregister): Likewise to assert on no instances. |
| 1931 | * init/tests/test_job_class.c (test_new): Check that instances is |
| 1932 | now a hash table. |
| 1933 | * init/job.h (Job): Make name the first member. |
| 1934 | * init/job.c (job_new): Add to instances as hash table. |
| 1935 | (job_instance): Drop entirely, replaced by a hash lookup. |
| 1936 | * init/tests/test_job.c (test_instance): Drop. |
| 1937 | * init/job_process.c (job_process_find): Iterate instances as a |
| 1938 | hash table. |
| 1939 | * init/event.c (event_pending_handle_jobs) |
| 1940 | (event_finished_handle_jobs): Iterate instances as hash table. |
| 1941 | (event_pending_handle_jobs): Replace job_instance call with an |
| 1942 | ordinary hash lookup. |
| 1943 | * init/tests/test_event.c: Update to use hash table. |
| 1944 | * init/tests/test_conf.c: Update instances stealing for hash table |
| 1945 | |
Scott James Remnant | 27d71f1 | 2008-05-09 02:35:26 +0100 | [diff] [blame] | 1946 | * init/job_class.c (job_class_new): initialise instance to the |
| 1947 | empty string. |
| 1948 | * init/tests/test_job_class.c: Update job_new() calls. |
| 1949 | (test_new): Check instance against the empty string. |
| 1950 | * init/job.c (job_new): name may no longer be NULL. |
| 1951 | * init/tests/test_job.c: Update job_new() calls. |
| 1952 | (test_instance): Reset back to "" when done. |
| 1953 | * init/event.c (event_pending_handle_jobs): Always expand the |
| 1954 | name, since the class->instance is always non-NULL. |
| 1955 | * init/tests/test_event.c: Update job_new calls. |
| 1956 | * init/tests/test_conf.c: Update job_new calls. |
| 1957 | * init/tests/test_job_process.c: Update job_new calls. |
| 1958 | |
Scott James Remnant | 07bdd4c | 2008-05-09 02:26:15 +0100 | [diff] [blame] | 1959 | * init/job.c (job_new): Singleton jobs have a fixed name of "", |
| 1960 | rather than a NULL name, and a D-Bus name of "_". |
| 1961 | (job_instance): Which rather simplifies this function (in fact, |
| 1962 | it makes this function look like a common one). |
| 1963 | (job_emit_event): Always set INSTANCE variable. |
| 1964 | (job_name): Still distinguish in output, to avoid ugly "()" but |
| 1965 | check character rather than NULL. |
| 1966 | * init/tests/test_job.c (test_new): Check name is set to "" |
| 1967 | and path to ".../_" |
| 1968 | (test_change_state, test_emit_event): Update test cases to assume |
| 1969 | an empty INSTANCE variable |
| 1970 | (test_instance): Update to pass "" instead of NULL. |
| 1971 | * init/job_process.c (job_process_run): Always set UPSTART_INSTANCE |
| 1972 | * init/tests/test_job_process.c (test_run): Always assume an |
| 1973 | UPSTART_INSTANCE variable, it may just be empty. |
| 1974 | * init/tests/test_event.c (test_pending_handle_jobs): Expect |
| 1975 | the name to be set to the empty string. |
| 1976 | |
Scott James Remnant | a1fb686 | 2008-05-09 00:30:14 +0100 | [diff] [blame] | 1977 | * init/Makefile.am (com.ubuntu.Upstart.c com.ubuntu.Upstart.h) |
| 1978 | (com.ubuntu.Upstart.Job.c com.ubuntu.Upstart.Job.h) |
| 1979 | (com.ubuntu.Upstart.Instance.c com.ubuntu.Upstart.Instance.h): |
| 1980 | Drop setting of data-type, turns out it doesn't work anyway. |
| 1981 | |
Scott James Remnant | 31253ca | 2008-05-09 00:19:07 +0100 | [diff] [blame] | 1982 | * dbus/Upstart.conf: Add configuration file. |
| 1983 | * dbus/Makefile.am (dbussystemdir, dist_dbussystem_DATA): Install |
| 1984 | the configuration file into the right place. |
| 1985 | |
Scott James Remnant | a645a99 | 2008-05-09 00:15:49 +0100 | [diff] [blame] | 1986 | * dbus/com.ubuntu.Upstart.xml (GetJobByName): Add method |
| 1987 | * init/control.c (control_get_job_by_name): Implementation. |
| 1988 | * init/control.h: Prototype. |
| 1989 | * init/tests/test_control.c (test_get_job_by_name): Test the |
| 1990 | method using a fake message. |
| 1991 | |
Scott James Remnant | 327c7df | 2008-05-08 10:18:27 +0100 | [diff] [blame] | 1992 | 2008-05-08 Scott James Remnant <scott@netsplit.com> |
| 1993 | |
Scott James Remnant | 8eb8dd2 | 2008-05-08 23:35:31 +0100 | [diff] [blame] | 1994 | * dbus/com.ubuntu.Upstart.xml, dbus/com.ubuntu.Upstart.Job.xml, |
| 1995 | * dbus/com.ubuntu.Upstart.Instance.xml: Add DTDs. |
| 1996 | |
Scott James Remnant | 8877f44 | 2008-05-08 23:30:40 +0100 | [diff] [blame] | 1997 | * init/control.c (manager_interfaces): Export the general |
| 1998 | com.ubuntu.Upstart interface |
| 1999 | * init/job_class.c (job_class_interfaces): Export the |
| 2000 | com.ubuntu.Upstart.Job interface |
| 2001 | * init/job.c (job_interfaces): Export the |
| 2002 | com.ubuntu.Upstart.Instance interface |
| 2003 | |
Scott James Remnant | e164061 | 2008-05-08 23:27:51 +0100 | [diff] [blame] | 2004 | * init/Makefile.am (BUILT_SOURCES) |
| 2005 | (com.ubuntu.Upstart.c com.ubuntu.Upstart.h) |
| 2006 | (com.ubuntu.Upstart.Job.c com.ubuntu.Upstart.Job.h) |
| 2007 | (com.ubuntu.Upstart.Instance.c com.ubuntu.Upstart.Instance.h): |
| 2008 | Generate C code and header files from the XML files which produce |
| 2009 | object bindings. |
| 2010 | (init_SOURCES): Link the built sources. |
| 2011 | (CLEANFILES): Clean them up afterwards |
| 2012 | |
Scott James Remnant | 08169c1 | 2008-05-08 23:14:22 +0100 | [diff] [blame] | 2013 | * dbus/com.ubuntu.Upstart.xml: Initially empty description for |
| 2014 | manager object interface(s). |
| 2015 | * dbus/com.ubuntu.Upstart.Job.xml: Initially empty description |
| 2016 | for job class object interface(s). |
| 2017 | * dbus/com.ubuntu.Upstart.Instance.xml: Initially empty |
| 2018 | description for job instance object interface(s). |
| 2019 | * dbus/Makefile.am: Distribute the three interface files, |
| 2020 | they're used as sources elsewhere. |
| 2021 | * configure.ac (AC_CONFIG_FILES): Generate dbus/Makefile |
| 2022 | * Makefile.am (SUBDIRS): Descend into the dbus sub-directory. |
| 2023 | |
Scott James Remnant | 0464dc1 | 2008-05-08 19:21:54 +0100 | [diff] [blame] | 2024 | * init/job_class.c (job_class_consider, job_class_reconsider): |
| 2025 | Separate out the actual meat of the functions, since it's largely |
| 2026 | duplicated between the two. This makes the difference between |
| 2027 | the two functions clearer, consider always stages an election |
| 2028 | no matter which is registered, reconsider only stages an election |
| 2029 | if the current class is registered. |
| 2030 | (job_class_select, job_class_remove): Functions containing the |
| 2031 | common code, which now also handle registering and unregistering |
| 2032 | the class with D-Bus. Here is the right place, not in new, since |
| 2033 | we only export the current best class of a given name. |
| 2034 | (job_class_register, job_class_unregister): Function to register |
| 2035 | a job and its instances, and to unregister a job (we assert that |
| 2036 | there must be no instances for us to do this). |
| 2037 | * init/job_class.h: Add prototypes. |
| 2038 | * init/tests/test_job_class.c (test_consider, test_reconsider): |
| 2039 | Check that D-Bus registration and unregistration happens as |
| 2040 | expected. |
| 2041 | (test_register, test_unregister): test on their own. |
| 2042 | * init/job.c (job_new): Register instances with D-Bus, since |
| 2043 | instances can only ever exist for active classes, all instances |
| 2044 | are always registered on the bus. |
| 2045 | (job_register): Function to register an instance on the bus. |
| 2046 | * init/job.h: Add prototype. |
| 2047 | * init/tests/test_job.c (test_new): Test creating a job with an |
| 2048 | active d-bus connection, which should have it registered. |
| 2049 | (test_register): Test registration on its own. |
| 2050 | * init/control.c (control_register_all): Make this always succeed, |
| 2051 | and register existing jobs on the new connection. |
| 2052 | (control_server_connect, control_bus_open): registration is |
| 2053 | always successful. |
| 2054 | * init/tests/test_control.c (test_server_connect, test_bus_open): |
| 2055 | Test with existing jobs when we get a connection or create the |
| 2056 | bus connection, ensure that the jobs and instances are registered. |
| 2057 | |
Scott James Remnant | 327c7df | 2008-05-08 10:18:27 +0100 | [diff] [blame] | 2058 | * init/tests/test_job.c (test_change_state): Check for a bug where |
| 2059 | a job with multiple instances will be freed when one instance is |
| 2060 | deleted rather than the last instance. |
| 2061 | * init/job.c (job_change_state): Add debugging messages when we |
| 2062 | destroy a job that's no longer the current one or an instance |
| 2063 | that's no longer active; also ensure that we never destroy a job |
| 2064 | that's the current one. |
| 2065 | * init/event.c (event_pending_handle_jobs): Add a debugging message |
| 2066 | when we create a new instance of a job. |
| 2067 | * init/conf.c (conf_file_destroy): Add a debugging message when |
| 2068 | we destroy a job that's no longer the current one. |
| 2069 | |
Scott James Remnant | 8e0fe4d | 2008-05-07 23:48:04 +0100 | [diff] [blame] | 2070 | 2008-05-07 Scott James Remnant <scott@netsplit.com> |
| 2071 | |
Scott James Remnant | 1ba7f7a | 2008-05-07 23:52:11 +0100 | [diff] [blame] | 2072 | * init/control.c (control_server_open, control_server_close) |
| 2073 | (control_server_connect): Create and manage a listening d-bus server |
| 2074 | that is used for private direct connections to Upstart for when the |
| 2075 | d-bus daemon is not available. Each new connection has the same |
| 2076 | objects as the d-bus system bus, they only differ in their method. |
| 2077 | (control_conns, control_init): Cache the open connections, including |
| 2078 | the bus daemon and any private connections; we'll iterate this list |
| 2079 | when sending signals. |
| 2080 | (control_bus_open): Store connection in the list, don't worry about |
| 2081 | setting close-on-exec, we check that by test case and rely on d-bus |
| 2082 | to do it. |
| 2083 | (control_bus_disconnected): Rename to control_disconnected |
| 2084 | (control_disconnected): Work for system bus and private connections, |
| 2085 | remove from the connections list. |
| 2086 | * init/control.h: Add prototypes, remove global definition of bus |
| 2087 | name to just being private again. |
| 2088 | * init/tests/test_control.c (test_server_open, test_server_close) |
| 2089 | (test_server_connect): Test the new functions. |
| 2090 | (test_bus_open): add check for list entry |
| 2091 | (test_bus_disconnected): rename to test_disconnected |
| 2092 | * init/main.c: Open the listening server, warning if we're unable |
| 2093 | to do so (but we won't treat it as a hard error since there's the |
| 2094 | d-bus daemon as the default anyway). |
| 2095 | * init/init.supp: suppress the fact that the control connections |
| 2096 | list stays around. |
| 2097 | |
Scott James Remnant | 8e0fe4d | 2008-05-07 23:48:04 +0100 | [diff] [blame] | 2098 | * init/job_process.c (job_process_run): Use NIH_ZERO instead of |
| 2099 | NIH_MUST and == 0 |
| 2100 | |
Scott James Remnant | 5635e07 | 2008-05-06 23:22:58 +0100 | [diff] [blame] | 2101 | 2008-05-06 Scott James Remnant <scott@netsplit.com> |
| 2102 | |
Scott James Remnant | d1799d2 | 2008-05-06 23:34:56 +0100 | [diff] [blame] | 2103 | * init/environ.c (environ_expand_until): Odd gcc optimiser warning, |
| 2104 | it reckons arg_start and end may be used uninitialised, but I don't |
| 2105 | see how they can be. |
| 2106 | |
Scott James Remnant | 5635e07 | 2008-05-06 23:22:58 +0100 | [diff] [blame] | 2107 | * init/main.c (main): Warn if we can't set the root directory. |
| 2108 | * init/job_process.c (job_process_spawn) |
| 2109 | (job_process_error_abort): loop on the return of write() |
| 2110 | * init/tests/test_job_process.c (child, main): assert getcwd() works |
| 2111 | (test_handler): initialise list and entry for gcc's blind spot. |
| 2112 | (test_run): initialise ret for gcc's blind spot |
| 2113 | * init/tests/test_job.c (test_name): jump through hoops for gcc |
| 2114 | (test_change_state): list and entry. |
| 2115 | * init/tests/test_event.c (test_finished_handle_jobs, test_finished) |
| 2116 | (test_pending_handle_jobs, test_poll, test_pending): initialise to |
| 2117 | NULL and buy gcc glasses |
| 2118 | * init/tests/test_event_operator.c (test_operator_collect): another |
| 2119 | NULL to make gcc happy. |
| 2120 | |
Scott James Remnant | 70a8c8a | 2008-05-01 01:06:22 +0100 | [diff] [blame] | 2121 | 2008-05-01 Scott James Remnant <scott@netsplit.com> |
| 2122 | |
Scott James Remnant | 75f6fae | 2008-05-01 01:39:27 +0100 | [diff] [blame] | 2123 | * TODO: Update. |
| 2124 | |
Scott James Remnant | 8d68b13 | 2008-05-01 01:21:07 +0100 | [diff] [blame] | 2125 | * init/init.supp: Suppress a few test case artefacts caused by |
| 2126 | valgrind hating reachable memory at exec() time. |
| 2127 | |
Scott James Remnant | 41f44aa | 2008-05-01 01:20:33 +0100 | [diff] [blame] | 2128 | * init/tests/test_job_process.c: Fix a few cases where we were |
| 2129 | still dup'ing the name argument to job_new(). |
| 2130 | * init/tests/test_parse_job.c: Include missing signal.h |
| 2131 | |
Scott James Remnant | 70a8c8a | 2008-05-01 01:06:22 +0100 | [diff] [blame] | 2132 | * init/event.c (event_pending_handle_jobs) |
| 2133 | (event_finished_handle_jobs): Land the old job event handling |
| 2134 | functions here as static functions, right now they're immense but |
| 2135 | we'll actually move much of the code back out again as we go. |
| 2136 | * init/tests/test_event.c (test_pending_handle_jobs) |
| 2137 | (test_finished_handle_jobs): Also land the test cases in renamed |
| 2138 | and somewhat restructued functions, since we now have to do the |
| 2139 | testing through event_poll(). |
| 2140 | (test_poll, test_pending, test_finished): It never hurts to improve |
| 2141 | test cases while you're in there. |
| 2142 | |
Scott James Remnant | b98ac99 | 2008-04-30 00:03:00 +0100 | [diff] [blame] | 2143 | 2008-04-30 Scott James Remnant <scott@netsplit.com> |
| 2144 | |
Scott James Remnant | 63fd5c7 | 2008-04-30 21:34:31 +0100 | [diff] [blame] | 2145 | * init/job.c (job_change_state): Change calls to job_process_run |
| 2146 | and job_process_kill. |
| 2147 | * init/main.c: Change to job_process_handler |
| 2148 | |
Scott James Remnant | f2d78e6 | 2008-04-30 21:33:38 +0100 | [diff] [blame] | 2149 | * init/job_process.c, init/job_process.h: Land the code from job.c |
| 2150 | and defs from job.h that deal specifically with a job's processes, |
| 2151 | rename the functions to job_process_*() in the process. |
| 2152 | * init/tests/test_job_process.c: And land the test cases as well. |
| 2153 | |
Scott James Remnant | ed25591 | 2008-04-30 21:09:48 +0100 | [diff] [blame] | 2154 | * init/job.c: Strip of everything not related to creation and finding |
| 2155 | of instances and the core state machine; process stuff will move to |
| 2156 | job_process.c and event handling to event.c, class (nee config) stuff |
| 2157 | is already moved to job_class.c |
| 2158 | (job_new): Don't reparent the name, it doesn't help anything, just |
| 2159 | take a copy. |
| 2160 | (job_name, job_failed, job_unblock, job_emit_event): Make extern since |
| 2161 | we need to use these outside or just want to test them. |
| 2162 | * init/job.h: Clean out also. |
| 2163 | * init/tests/test_job.c: Also clean out. |
| 2164 | (test_name, test_failed, test_unblock, test_emit_event): Add test cases |
| 2165 | for newly extern functions. |
| 2166 | |
Scott James Remnant | 5d82d90 | 2008-04-30 00:03:29 +0100 | [diff] [blame] | 2167 | * init/main.c: Include events.h to get the ones we need. |
| 2168 | |
Scott James Remnant | b98ac99 | 2008-04-30 00:03:00 +0100 | [diff] [blame] | 2169 | * init/control.c (control_job_config_path, control_job_path) |
| 2170 | (control_path_append): Drop these functions (replaced by the more |
| 2171 | generic nih_dbus_path() function) |
| 2172 | * init/control.h: Make CONTROL_ROOT public, and drop other prototypes. |
| 2173 | * init/tests/test_control.c (test_job_config_path) |
| 2174 | (test_job_path): Drop tests. |
| 2175 | |
Scott James Remnant | 0733653 | 2008-04-29 19:45:51 +0100 | [diff] [blame] | 2176 | 2008-04-29 Scott James Remnant <scott@netsplit.com> |
| 2177 | |
Scott James Remnant | e1725e8 | 2008-04-29 23:59:51 +0100 | [diff] [blame] | 2178 | * init/event.c, init/event.h, init/tests/test_event.c: Strip out the |
| 2179 | event operator code and events list. |
| 2180 | |
Scott James Remnant | 6f02f54 | 2008-04-29 23:59:12 +0100 | [diff] [blame] | 2181 | * init/job_class.c, init/job_class.h: We only need the event operator |
| 2182 | code here now. |
| 2183 | |
Scott James Remnant | ddbbaa6 | 2008-04-29 23:58:36 +0100 | [diff] [blame] | 2184 | * init/events.h, init/event_operator.c, init/event_operator.h, |
| 2185 | init/tests/test_event_operator.c: Separate out the event operator |
| 2186 | code and the list of events into separate source files. |
| 2187 | * init/Makefile.am (init_SOURCES): Build and link event operator code |
| 2188 | and use the lists of events. |
| 2189 | (TESTS): Build and run the event operator test suite. |
| 2190 | (test_event_operator_SOURCES, test_event_operator_LDFLAGS) |
| 2191 | (test_event_operator_LDADD): Details for the event operator test |
| 2192 | suite. |
| 2193 | (test_process_LDADD, test_job_class_LDADD) |
| 2194 | (test_job_process_LDADD, test_job_LDADD, test_event_LDADD) |
| 2195 | (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD) |
| 2196 | (test_control_LDADD): Link the event operator code. |
| 2197 | |
Scott James Remnant | f2f69d0 | 2008-04-29 23:38:23 +0100 | [diff] [blame] | 2198 | * init/job_class.c, init/main.c: Correct includes and some function |
| 2199 | names. |
| 2200 | |
Scott James Remnant | 9de968e | 2008-04-29 23:37:25 +0100 | [diff] [blame] | 2201 | * init/process.c, init/process.h, init/tests/test_process.c: Land |
| 2202 | original Process code (used by job class and similar). |
| 2203 | |
Scott James Remnant | 8092e79 | 2008-04-29 23:36:16 +0100 | [diff] [blame] | 2204 | * init/process.c, init/process.h, init/tests/test_process.c: Break |
| 2205 | into two pieces, one part becomes job_process which requires both |
| 2206 | job information and process information, the other becomes system |
| 2207 | which requires no job information. |
| 2208 | * init/errors.h: Update error name. |
| 2209 | * init/Makefile.am (init_SOURCES): Build and link job process code |
| 2210 | and header along with system code and header. |
| 2211 | (TESTS): Build and run job process and system test suites. |
| 2212 | (test_job_process_SOURCES, test_job_process_LDFLAGS) |
| 2213 | (test_job_process_LDADD): Details for job process test suite. |
| 2214 | (test_system_SOURCES, test_system_LDFLAGS, test_system_LDADD): |
| 2215 | Details for system test suite. |
| 2216 | (test_process_LDADD, test_job_class_LDADD, test_job_LDADD) |
| 2217 | (test_event_LDADD, test_parse_job_LDADD, test_parse_conf_LDADD) |
| 2218 | (test_conf_LDADD, test_control_LDADD): Link job process and system |
| 2219 | code. |
| 2220 | |
Scott James Remnant | 783a79d | 2008-04-29 20:00:52 +0100 | [diff] [blame] | 2221 | * init/parse_conf.c: Remove parse_job include. |
| 2222 | |
Scott James Remnant | c2791dd | 2008-04-29 19:59:41 +0100 | [diff] [blame] | 2223 | * init/init.supp: Update leak check for class init; remove |
| 2224 | valgrind workaround since it's gone away with the change of that |
| 2225 | function. |
| 2226 | |
Scott James Remnant | 710c515 | 2008-04-29 19:58:44 +0100 | [diff] [blame] | 2227 | * init/conf.h (ConfFile): Change type of job member, but leave name. |
| 2228 | Add prototype for new function. |
| 2229 | * init/conf.c (conf_reload_path): Somewhat simplify the case of |
| 2230 | having parsed a job, we only need to call job_class_consider() now |
| 2231 | to have it dealt with. |
| 2232 | (conf_file_destroy): Likewise after removing the ConfFile from the |
| 2233 | source (so it won't get considered) and marking the job class as |
| 2234 | deleted, we only need to call job_class_reconsider() and check the |
| 2235 | return value to see whether we've been replaced. |
| 2236 | (conf_select_job): In return we provide the function to decide which |
| 2237 | of the available job sources is the best one. |
| 2238 | * init/tests/test_conf.c: Update types in tests. |
| 2239 | (test_select_job): Test the new function. |
| 2240 | |
Scott James Remnant | 11168f3 | 2008-04-29 19:46:03 +0100 | [diff] [blame] | 2241 | * init/parse_job.h: Update to include job_class.h and update prototype |
| 2242 | to return JobClass, we'll keep the name though since we'll never |
| 2243 | parse jobs and otherwise things get annoying. |
| 2244 | * init/parse_job.c: Update to work on job classes. |
| 2245 | * init/tests/test_parse_job.c: Update to match. |
| 2246 | |
Scott James Remnant | 0733653 | 2008-04-29 19:45:51 +0100 | [diff] [blame] | 2247 | * init/job_class.h (JobClass): Factor out old JobConfig object into |
| 2248 | a new JobClass object with the same properties, but in its own source |
| 2249 | file. |
| 2250 | (ExpectType): Rename old JobExpect to this to match other enums. |
| 2251 | (ConsoleType): Move along with the object that uses it. |
| 2252 | * init/job_class.c (job_class_init, job_class_new) |
| 2253 | (job_class_environment): Bring along methods that only operate on |
| 2254 | a JobClass, cleaning them up in the process. |
| 2255 | (job_class_consider, job_class_reconsider): Replace job_config_replace |
| 2256 | with these two functions that may be used for a new job class and |
| 2257 | when discarding or finishing with an old one respectively. |
| 2258 | * init/tests/test_job_class.c: Tests for the functions. |
| 2259 | * init/Makefile.am (init_SOURCES): Build and link job class source |
| 2260 | and header. |
| 2261 | (TESTS): Build and run job class test suite. |
| 2262 | (test_job_class_SOURCES, test_job_class_LDFLAGS) |
| 2263 | (test_job_class_LDADD): Details for job class test suite. |
| 2264 | (test_process_LDADD, test_job_LDADD, test_event_LDADD) |
| 2265 | (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD) |
| 2266 | (test_control_LDADD): Link job class code to other tests too. |
| 2267 | |
Scott James Remnant | f92d483 | 2008-04-28 20:32:35 +0100 | [diff] [blame] | 2268 | 2008-04-28 Scott James Remnant <scott@netsplit.com> |
| 2269 | |
Scott James Remnant | bee70f5 | 2008-04-28 22:09:23 +0100 | [diff] [blame] | 2270 | * init/control.c (control_job_config_path, control_job_path): Add |
| 2271 | functions to generate D-Bus object paths for jobs and instances |
| 2272 | (control_path_append): and a static function used by both to append |
| 2273 | escaped path elements. |
| 2274 | * init/control.h: Add prototypes. |
| 2275 | * init/tests/test_control.c (test_job_config_path) |
| 2276 | (test_job_path): Add test cases for the new functions. |
| 2277 | * init/job.h (JobConfig, Job): Add path member to both structures. |
| 2278 | * init/job.c (job_config_new, job_new): Initialise the path members. |
| 2279 | * init/tests/test_job.c (test_config_new, test_new): Make sure |
| 2280 | the path members are initialised to something sensible. |
| 2281 | * init/init.supp: Valgrind whines, I do not know why. |
| 2282 | |
Scott James Remnant | f92d483 | 2008-04-28 20:32:35 +0100 | [diff] [blame] | 2283 | * init/control.c (control_bus_open): Call out to register objects |
| 2284 | on the new bus connection. |
| 2285 | (control_register_all): Start off by registering the connection |
| 2286 | manager object, no methods/signals for now. |
| 2287 | * init/tests/test_control.c (test_bus_open): Make sure the manager |
| 2288 | object is registered. |
| 2289 | |
Scott James Remnant | 00c71a0 | 2008-04-27 23:04:17 +0100 | [diff] [blame] | 2290 | 2008-04-27 Scott James Remnant <scott@netsplit.com> |
| 2291 | |
Scott James Remnant | a6cb354 | 2008-04-27 23:10:55 +0100 | [diff] [blame] | 2292 | * init/tests/test_control.c (test_bus_open): Correct name of |
| 2293 | error macro. |
| 2294 | |
Scott James Remnant | 00c71a0 | 2008-04-27 23:04:17 +0100 | [diff] [blame] | 2295 | * init/job.c (job_emit_event): Make INSTANCE the second variable. |
| 2296 | * init/tests/test_job.c (test_next_state): Update tests. |
| 2297 | |
Scott James Remnant | 7fbefc1 | 2008-04-25 00:51:18 +0100 | [diff] [blame] | 2298 | 2008-04-25 Scott James Remnant <scott@netsplit.com> |
| 2299 | |
| 2300 | * init/tests/test_control.c (test_bus_open): Use D-bus macros for |
| 2301 | error strings instead of naming them by hand. |
| 2302 | |
Scott James Remnant | aec4869 | 2008-04-22 07:44:48 +0100 | [diff] [blame] | 2303 | 2008-04-22 Scott James Remnant <scott@netsplit.com> |
| 2304 | |
| 2305 | * init/tests/test_control.c (test_bus_close): Add another missing |
| 2306 | call to dbus_shutdown. |
| 2307 | |
Scott James Remnant | 7e96582 | 2008-04-21 22:41:11 +0100 | [diff] [blame] | 2308 | 2008-04-21 Scott James Remnant <scott@netsplit.com> |
| 2309 | |
| 2310 | * init/tests/test_control.c (test_bus_open): Under valgrind we seem |
| 2311 | to get NoReply instead of Disconnected which is a wee bit odd. |
| 2312 | Add missing call |
| 2313 | (test_bus_disconnected): Add missing call to dbus_shutdown. |
| 2314 | |
Scott James Remnant | 30555d5 | 2008-04-19 11:52:04 +0100 | [diff] [blame] | 2315 | 2008-04-19 Scott James Remnant <scott@netsplit.com> |
| 2316 | |
Scott James Remnant | fbdd3cd | 2008-04-19 19:42:31 +0100 | [diff] [blame] | 2317 | * init/process.c: Add missing limits.h include |
| 2318 | |
Scott James Remnant | 15a1eea | 2008-04-19 16:47:32 +0100 | [diff] [blame] | 2319 | * init/job.h (JobConfig): Merge instance and instance_name; if |
| 2320 | instance is set, the job is multi-instance with the name derived |
| 2321 | from that; if unset the job is singleton. We will not support |
| 2322 | unlimited instances. |
| 2323 | * init/job.c (job_config_new): Initialise instance to NULL. |
| 2324 | (job_new): Assert that name is set for instance jobs. |
| 2325 | (job_instance): Alter to only deal with singleton and instance |
| 2326 | jobs, the unlimited instances case is gone. |
| 2327 | (job_handle_event): Use instance instead of instance_name |
| 2328 | * init/tests/test_job.c (test_config_new): Check instance is NULL |
| 2329 | (test_find_by_pid): Adjust the way instance jobs are made, which |
| 2330 | means we have to pass a name to job_config_new now. |
| 2331 | (test_instance): Adjust tests to remove unlmited-instance tests |
| 2332 | and pass name to job_config_new |
| 2333 | (test_change_state, test_run_process): Pass instance name to |
| 2334 | job_new as an allocated argument rather than waiting to set it |
| 2335 | until afterwards. |
| 2336 | (test_handle_event): Set instance instead of instance_name |
| 2337 | * init/parse_job.c (stanza_instance): Make the argument mandatory. |
| 2338 | * init/tests/test_parse_job.c (test_stanza_instance): Remove the |
| 2339 | checks for without argument, and make sure that without argument |
| 2340 | is an error. |
| 2341 | |
Scott James Remnant | c75e824 | 2008-04-19 13:01:43 +0100 | [diff] [blame] | 2342 | * init/parse_job.c (stanza_oom): Oops, forgot to free never arg. |
| 2343 | |
Scott James Remnant | 4e3365d | 2008-04-19 13:00:42 +0100 | [diff] [blame] | 2344 | * init/job.h (JobConfig): NihList is rather overkill for emits, |
| 2345 | which is static configuration; turn into a NULL-terminated array |
| 2346 | which'll make it easier to turn into a D-Bus property later. |
| 2347 | * init/job.c (job_config_new): Initialise to NULL now. |
| 2348 | * init/tests/test_job.c (test_config_new): Make sure it's NULL. |
| 2349 | * init/parse_job.c (stanza_emits): Store in an array instead. |
| 2350 | * init/tests/test_parse_job.c (test_stanza_emits): Redo tests. |
| 2351 | |
Scott James Remnant | 264f7e9 | 2008-04-19 12:55:58 +0100 | [diff] [blame] | 2352 | * init/job.c (job_emit_event): Append exported variables to the |
| 2353 | job event without overwriting the builtins. |
| 2354 | * init/tests/test_job.c (test_change_state): Check that exported |
| 2355 | environment is added to the job events. |
| 2356 | |
Scott James Remnant | 4b7b9d7 | 2008-04-19 12:39:52 +0100 | [diff] [blame] | 2357 | * init/parse_job.c (stanza_export): Parse a new export stanza, |
| 2358 | which takes one or more environment variable names. |
| 2359 | * init/tests/test_parse_job.c (test_stanza_export): Test the new |
| 2360 | stanza. |
| 2361 | |
Scott James Remnant | 65da866 | 2008-04-19 12:28:44 +0100 | [diff] [blame] | 2362 | * init/job.h (JobConfig): Add new export member. |
| 2363 | * init/job.c (job_config_new): Initialise to NULL. |
| 2364 | * init/tests/test_job.c (test_config_new): Make sure it's NULL. |
| 2365 | |
Scott James Remnant | f2f5365 | 2008-04-19 12:15:47 +0100 | [diff] [blame] | 2366 | * init/environ.c (environ_add, environ_set): Add a replace argument |
| 2367 | which when FALSE does not replace existing entries in the environment |
| 2368 | table. |
| 2369 | * init/environ.h: Adjust prototypes. |
| 2370 | * init/tests/test_environ.c (test_add): Add tests for non-replacement |
| 2371 | mode, including corner cases. |
| 2372 | (test_set): Replace should be TRUE in this test. |
| 2373 | * init/event.c (event_operator_collect): Always replace existing |
| 2374 | environment members. |
| 2375 | * init/job.c (job_config_environment, job_run_process): Always replace |
| 2376 | existing environment members. |
| 2377 | (job_emit_event): Always replace existing environment members, and |
| 2378 | rework this function to get rid of the confusing gotos. |
| 2379 | |
Scott James Remnant | 30555d5 | 2008-04-19 11:52:04 +0100 | [diff] [blame] | 2380 | * init/tests/test_job.c (test_change_state): Add tests to make sure |
| 2381 | we include the INSTANCE variable in the event environment. |
| 2382 | |
Scott James Remnant | 9fab4e9 | 2008-04-18 13:19:06 +0100 | [diff] [blame] | 2383 | 2008-04-18 Scott James Remnant <scott@netsplit.com> |
| 2384 | |
Scott James Remnant | d8fe702 | 2008-04-18 18:24:43 +0100 | [diff] [blame] | 2385 | * init/process.c (process_kill): Make sure we do send the signal to |
| 2386 | the process group; in practice this makes no difference, but it pays |
| 2387 | to be explicit in such things. |
| 2388 | * init/tests/test_process.c (test_kill): Add a test case for when |
| 2389 | the session leader is no more. |
| 2390 | |
Scott James Remnant | ac3d4ea | 2008-04-18 18:11:47 +0100 | [diff] [blame] | 2391 | * init/job.h (JobConfig): Another day, another obscure job config |
| 2392 | detail. This one is for adjusting how likely you are to be killed |
| 2393 | by the OOM Killer. |
| 2394 | * init/job.c (job_config_new): Set to zero by default. |
| 2395 | * init/tests/test_job.c (test_config_new): And make sure it is zero. |
| 2396 | * init/parse_job.c (stanza_oom): And it helps to have a function |
| 2397 | to set that one. |
| 2398 | * init/tests/test_parse_job.c (test_stanza_oom): Test it. |
| 2399 | * init/errors.h: And we need an error if its out of bounds. |
| 2400 | * init/conf.c (conf_reload_path): Which also needs to be caught. |
| 2401 | * init/process.c (process_spawn): Of course, we have to do something |
| 2402 | with the oom adjustment. |
| 2403 | (process_error_read): message for failure error. |
| 2404 | * init/process.h (processErrorType): And need an error if it fails |
| 2405 | |
Scott James Remnant | 7c1accf | 2008-04-18 13:32:01 +0100 | [diff] [blame] | 2406 | * init/main.c: Drop the legacy configuration directory, the format |
| 2407 | of jobs has changed sufficiently to not support it. |
| 2408 | * init/Makefile.am (AM_CPPFLAGS): Remove LEGACY_CONFDIR definition. |
| 2409 | (install-data-local): Don't create it, either. |
| 2410 | |
Scott James Remnant | aaa5958 | 2008-04-18 13:30:05 +0100 | [diff] [blame] | 2411 | * init/enum.c, init/enum.h, init/tests/test_enum.c: Remove these |
| 2412 | source files, a hold-over from when we had them in a separate |
| 2413 | library and passed around the integer values. |
| 2414 | * init/job.c, init/job.h, init/tests/test_job.c: Restore in their |
| 2415 | proper place. |
| 2416 | * init/Makefile.am: Remove enum.* from build instructions. |
| 2417 | |
Scott James Remnant | f849144 | 2008-04-18 13:19:24 +0100 | [diff] [blame] | 2418 | * init/main.c: Attempt to connect to the system bus on startup, |
| 2419 | but don't expect it to work. |
| 2420 | |
Scott James Remnant | 9fab4e9 | 2008-04-18 13:19:06 +0100 | [diff] [blame] | 2421 | * init/control.c (control_bus_open, control_bus_disconnected) |
| 2422 | (control_bus_close): Functions to open a connection to the D-Bus |
| 2423 | system bus, clean up if disconnected or disconnect ourselves |
| 2424 | explicitly. |
| 2425 | * init/control.h: Prototypes. |
| 2426 | * init/tests/test_control.c (test_bus_open) |
| 2427 | (test_bus_disconnected, test_bus_close): Test the functions using |
| 2428 | a fake D-Bus system bus daemon. |
| 2429 | * init/errors.h: Add error for "name taken". |
| 2430 | * init/Makefile.am (init_SOURCES): Build and link control.c and |
| 2431 | control.h |
| 2432 | (TESTS): Build and run control test suite. |
| 2433 | (test_control_SOURCES, test_control_LDFLAGS, test_control_LDADD): |
| 2434 | Details for control test suite. |
| 2435 | (test_process_LDADD, test_job_LDADD, test_event_LDADD) |
| 2436 | (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD): |
| 2437 | Link control.o |
| 2438 | |
Scott James Remnant | f8db589 | 2008-04-16 14:39:59 +0100 | [diff] [blame] | 2439 | 2008-04-16 Scott James Remnant <scott@netsplit.com> |
| 2440 | |
| 2441 | * init/job.h (JobConfig): Add leader member. |
| 2442 | * init/job.c (job_config_new): Initialise leader to FALSE. |
| 2443 | * init/tests/test_job.c (test_config_new): Make sure leader is FALSE. |
| 2444 | (test_change_goal, test_change_state, test_run_process) |
| 2445 | (test_kill_process, test_child_handler, test_handle_event) |
| 2446 | (test_handle_event_finished): Jobs have to be leaders now to allow |
| 2447 | waitpid() to work in test cases. |
| 2448 | * init/parse_job.c (stanza_session): Parse "session leader" stanza |
| 2449 | to set to TRUE. |
| 2450 | * init/tests/test_parse_job.c (test_stanza_session): Test new |
| 2451 | stanza parsing. |
| 2452 | (test_stanza_console): Add missing "missing argument" test. |
| 2453 | * init/process.c (process_error_read): Deal with new fork error. |
| 2454 | (process_spawn): If we're not to be a session leader, fork again and |
| 2455 | write the pid back on the open socket. |
| 2456 | * init/process.h (ProcessErrorType): Introduce new fork error. |
| 2457 | * init/tests/test_process.c (test_spawn): Test that we can't start |
| 2458 | a non-session-leader and still have process details. |
| 2459 | (test_spawn, test_kill): Other jobs have to be leaders now to |
| 2460 | allow waitpid() to work. |
| 2461 | * init/tests/test_event.c (test_poll): Jobs have to be leaders now |
| 2462 | to allow waitpid() to work. |
| 2463 | |
Scott James Remnant | 048c79a | 2008-04-12 11:11:22 +0100 | [diff] [blame] | 2464 | 2008-04-12 Scott James Remnant <scott@netsplit.com> |
| 2465 | |
Scott James Remnant | 477d9d4 | 2008-04-12 14:07:48 +0100 | [diff] [blame] | 2466 | * configure.ac (NIH_INIT): Require that libnih build D-Bus support, |
| 2467 | failing configure if we can't get it. |
| 2468 | * init/Makefile.am (AM_CFLAGS): Build with D-Bus CFLAGS, |
| 2469 | (init_LDADD, test_process_LDADD, test_job_LDADD, test_event_LDADD) |
| 2470 | (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD): and |
| 2471 | link with libnih-dbus.la and D-Bus LIBS. |
| 2472 | (init_LDFLAGS): No need for -static now since libnih will only exist |
| 2473 | statically anyway. |
| 2474 | |
Scott James Remnant | 2c0bd59 | 2008-04-12 12:31:49 +0100 | [diff] [blame] | 2475 | * init/main.c: Use a better name for kbdrequest |
| 2476 | * init/event.h (KBDREQUEST_EVENT): Rename event to keyboard-request |
| 2477 | |
Scott James Remnant | 4b56d6f | 2008-04-12 12:23:15 +0100 | [diff] [blame] | 2478 | * init/main.c: Drop the attempt to rescue a crashed system by |
| 2479 | carrying on with no state |
| 2480 | (crash_handler): After the child has core dumped, the parent will |
| 2481 | die and the kernel will panic. That's the best we can do, I think. |
| 2482 | |
Scott James Remnant | 6fd5acc | 2008-04-12 12:10:27 +0100 | [diff] [blame] | 2483 | * init/job.c (job_change_state): Don't generate the stalled event; |
| 2484 | there's nothing useful you can do with it other than start a root |
| 2485 | shell and that's just a security hole waiting to happen. |
| 2486 | (job_new): Don't increment the instances counter. |
| 2487 | * init/job.h: Remove extern for instances counter. |
| 2488 | * init/tests/test_job.c (test_new): Remove the check that the |
| 2489 | instance counter is incremented. |
| 2490 | (test_change_state): Remove the test for the stalled event. |
| 2491 | * init/event.h (STALLED): Remove stalled event definition, |
| 2492 | * TODO: Update. |
| 2493 | |
Scott James Remnant | 830370a | 2008-04-12 11:51:45 +0100 | [diff] [blame] | 2494 | * init/job.h (Job): And while we're at it, the instance name is |
| 2495 | guaranteed unique for a given job name, which is also guaranteed |
| 2496 | to be unique - so don't bother with job ids either, since they |
| 2497 | also get reused in bad cases. |
| 2498 | * init/job.c (job_next_id): Drop this function. |
| 2499 | (job_new): Don't assign an id anymore. |
| 2500 | (job_find_by_id): Drop this function. |
| 2501 | (job_run_process): Set UPSTART_INSTANCE to the instance name if set. |
| 2502 | (job_name): Function to create the string used in messages. |
| 2503 | (job_change_goal, job_change_state, job_run_process) |
| 2504 | (job_kill_process, job_kill_timer, job_child_handler) |
| 2505 | (job_process_terminated, job_process_trace_new) |
| 2506 | (job_process_trace_new_child, job_process_trace_signal) |
| 2507 | (job_process_trace_fork, job_process_trace_exec): Use the instance |
| 2508 | name in messages (if set) in place of the job id. |
| 2509 | * init/tests/test_job.c (test_new): Drop checks on the id field. |
| 2510 | (test_find_by_id): Drop test. |
| 2511 | (test_run_process): Check that UPSTART_INSTANCE is set only for |
| 2512 | named job instances, and contains the instance name. |
| 2513 | (test_change_state, test_run_process, test_child_handler): Remove |
| 2514 | id setting and update error message checks. |
| 2515 | * TODO: Update. |
| 2516 | |
Scott James Remnant | 048c79a | 2008-04-12 11:11:22 +0100 | [diff] [blame] | 2517 | * init/event.h (Event): We don't use the id field for anything; |
| 2518 | and it can't be guaranteed to be unique since it can wrap over |
| 2519 | and get reused. Drop it. |
| 2520 | * init/event.c (event_next_id): Drop this function. |
| 2521 | (event_new): Don't assign an id anymore. |
| 2522 | (event_find_by_id): Drop this function. |
| 2523 | * init/tests/test_event.c (test_new): Drop checks on the id field |
| 2524 | (test_find_by_id): Drop test. |
| 2525 | (test_poll): Drop id setting which was needless anyway. |
| 2526 | |
Scott James Remnant | 4dce7b3 | 2008-04-11 10:47:08 +0100 | [diff] [blame] | 2527 | 2008-04-11 Scott James Remnant <scott@netsplit.com> |
| 2528 | |
Scott James Remnant | f2874b8 | 2008-04-11 14:55:27 +0100 | [diff] [blame] | 2529 | * init/tests/test_job.c (test_child_handler): Add tests to make |
| 2530 | sure that respawn works for both services and tasks; the only |
| 2531 | difference we want for tasks is that zero is a normal exit code. |
| 2532 | * init/job.c (job_process_terminated): Status need not be non-zero |
| 2533 | if the job is not a task. |
| 2534 | |
Scott James Remnant | 2c1c57f | 2008-04-11 14:41:55 +0100 | [diff] [blame] | 2535 | Change the default job type from task to service, which will |
| 2536 | finally match people's expectations. |
| 2537 | |
| 2538 | * init/job.h (JobConfig): Replace service member with task |
| 2539 | * init/job.c (job_config_new): Initialise task to FALSE |
| 2540 | (job_change_state): Unblock if not a task instead of if a service |
| 2541 | * init/tests/test_job.c (test_config_new): Make sure task is FALSE |
| 2542 | (test_change_state): Check service by default, task with flag; |
| 2543 | this also means we expect blockers to be cleared if we end up in |
| 2544 | running for the other checks |
| 2545 | (test_child_handler): Expect blockers to be cleared if we end up |
| 2546 | in running now that service is the default. |
| 2547 | * init/tests/test_event.c (test_poll): Test with a task since |
| 2548 | we want to remain blocked for longer. |
| 2549 | * init/parse_job.c (stanza_respawn): Don't set service to TRUE |
| 2550 | (stanza_service): Rename to stanza_task and set task flag instead |
| 2551 | * init/tests/test_parse_job.c (test_stanza_respawn): Remove checks |
| 2552 | for setting of service flag |
| 2553 | (test_stanza_service): Rename to test_stanza_task and test task |
| 2554 | |
Scott James Remnant | 4dce7b3 | 2008-04-11 10:47:08 +0100 | [diff] [blame] | 2555 | * init/job.c (job_init): Create hash using nih_hash_string_new() |
| 2556 | * init/conf.c (conf_source_new): Likewise. |
| 2557 | |
Scott James Remnant | f8f19e9 | 2008-03-08 01:41:51 +0000 | [diff] [blame] | 2558 | 2008-03-08 Scott James Remnant <scott@netsplit.com> |
| 2559 | |
Scott James Remnant | b598eba | 2008-03-08 18:17:38 +0000 | [diff] [blame] | 2560 | * HACKING: Terminology changes: Bazaar-NG is now just Bazaar; |
Scott James Remnant | f6466b4 | 2008-04-11 10:38:04 +0100 | [diff] [blame] | 2561 | Malone is now just Launchpad's bug tracking system. Update bugs |
Scott James Remnant | b598eba | 2008-03-08 18:17:38 +0000 | [diff] [blame] | 2562 | URL to match modern form. |
| 2563 | |
Scott James Remnant | 76e3bc9 | 2008-03-08 16:12:12 +0000 | [diff] [blame] | 2564 | * init/enum.h (JobWaitType): Rename to JobExpect |
| 2565 | * init/job.h (JobConfig): Rename wait_for to expect |
| 2566 | * init/job.c (job_config_new, job_change_state, job_run_process) |
| 2567 | (job_process_stopped, job_process_trace_new_child): Rename wait_for |
| 2568 | to expect in all occurances. |
| 2569 | * init/tests/test_job.c: Likewise rename all occurances. |
| 2570 | * init/parse_job.c (stanza_wait): Rename to stanza_expect and drop |
| 2571 | the intermediate argument. |
| 2572 | * init/tests/test_parse_job.c (test_stanza_wait): Rename to |
| 2573 | test_stanza_expect and adjust tests to match new syntax. |
| 2574 | * init/tests/test_process.c (test_spawn): Remove set of wait_for. |
| 2575 | |
Scott James Remnant | da69530 | 2008-03-08 01:50:56 +0000 | [diff] [blame] | 2576 | * doc/states.dot: Remove the state transition from starting to |
| 2577 | waiting ("emit_stopped" in the graph); we don't have a "respawning |
| 2578 | too fast" exit here anymore, so always go to stopping. |
| 2579 | * doc/states.png: Regenerate. |
| 2580 | |
Scott James Remnant | f8f19e9 | 2008-03-08 01:41:51 +0000 | [diff] [blame] | 2581 | * TODO: Document the problems with overflowing ids and instance |
| 2582 | counter before I forget about them. |
| 2583 | |
Scott James Remnant | 7b6c16c | 2008-03-07 15:16:29 +0000 | [diff] [blame] | 2584 | 2008-03-07 Scott James Remnant <scott@netsplit.com> |
| 2585 | |
Scott James Remnant | d62ef89 | 2008-03-07 23:20:50 +0000 | [diff] [blame] | 2586 | * TODO: Update. |
| 2587 | |
Scott James Remnant | debbdc9 | 2008-03-07 23:20:34 +0000 | [diff] [blame] | 2588 | * init/job.h (JobConfig): Add instance_name member. |
| 2589 | (Job): Add name member. |
| 2590 | * init/job.c (job_config_new): Initialise instance name to NULL. |
| 2591 | (job_new): Accept the name as an argument, reparenting and stealing |
| 2592 | (job_handle_event): Expand the instance name and pass to job_new |
| 2593 | (job_instance): Accept a name and look that up in the list of current |
| 2594 | instances returning the instance if found. |
| 2595 | * init/tests/test_job.c: Add extra argument to all job_new calls |
| 2596 | (test_config_new): Make sure instance name is initialised to NULL. |
| 2597 | (test_handle_event): Make sure the job name is set from the instance, |
| 2598 | and make sure an existing instance is reused if we can. |
| 2599 | (test_instance): Make sure that the existing instance is returned. |
| 2600 | * init/parse_job.c (stanza_instance): Check for an optional argument |
| 2601 | and store it in the instance_name member if it exists, otherwise |
| 2602 | free and reset the instance_name member. |
| 2603 | * init/tests/test_parse_job.c (test_stanza_instance): Check the new |
| 2604 | argument is handled properly and stored in the right place. |
| 2605 | * init/tests/test_conf.c (test_source_reload_job_dir) |
| 2606 | (test_file_destroy): Add extra NULL to job_new |
| 2607 | * init/tests/test_event.c (test_poll): Add extra NULL to job_new |
| 2608 | |
Scott James Remnant | 6f85758 | 2008-03-07 21:32:53 +0000 | [diff] [blame] | 2609 | * init/event.c (event_operator_match): Accept an environment array |
| 2610 | and expand the operator value against it before attempting to match. |
| 2611 | (event_operator_handle): Also accept the environment array and pass |
| 2612 | through to calls to event_operator_match(). |
| 2613 | * init/event.h: Update prototypes. |
| 2614 | * init/tests/test_event.c (test_operator_match): Add extra NULL |
| 2615 | argument to most tests, and add tests for known and unknown variable |
| 2616 | references. |
| 2617 | (test_operator_handle): Add extra NULL arguments to most tests, and |
| 2618 | add test for passing of environment through. |
| 2619 | (test_operator_reset): Add extra NULL argument to call. |
| 2620 | * init/job.c (job_handle_event): Pass the job environment for the |
| 2621 | stop event handling, but NULL for the start event. |
| 2622 | * init/tests/test_job.c (test_handle_event): Make sure that a stop |
| 2623 | operator is expanded from the job environment before being matched |
| 2624 | against the stop event. |
| 2625 | |
Scott James Remnant | 7d4ffbb | 2008-03-07 20:56:15 +0000 | [diff] [blame] | 2626 | * init/event.c, init/event.h, init/environ.c: Documentation tweaks. |
| 2627 | |
Scott James Remnant | b605dfc | 2008-03-07 19:24:52 +0000 | [diff] [blame] | 2628 | * init/job.c (job_change_state): Remove the code to check for runaway |
| 2629 | jobs from here, we'll always let people explicitly start an instance. |
| 2630 | (job_process_terminated): Call job_catch_runaway when actually doing |
| 2631 | the respawn instead. |
| 2632 | * init/tests/test_job.c (test_change_state): Remove "too fast" checks, |
| 2633 | we're going to allow start/stop requests to restart jobs as much as |
| 2634 | they like since this is an external request. |
| 2635 | (test_handle_event, test_handle_event_finished): No need to remove |
| 2636 | a respawn limit with this behaviour. |
| 2637 | (test_child_handler): Instead check that the respawn counter is |
| 2638 | dealt with by the child handler. |
| 2639 | |
Scott James Remnant | 67e86ff | 2008-03-07 18:38:12 +0000 | [diff] [blame] | 2640 | * TODO: Update, I found a bug with the current model. |
| 2641 | |
Scott James Remnant | 7b6c16c | 2008-03-07 15:16:29 +0000 | [diff] [blame] | 2642 | * init/tests/test_environ.c (test_expand): Check that a string |
| 2643 | without an expansion still works ok. |
| 2644 | |
Scott James Remnant | 46ba8e9 | 2008-03-06 20:24:08 +0000 | [diff] [blame] | 2645 | 2008-03-06 Scott James Remnant <scott@netsplit.com> |
| 2646 | |
| 2647 | * init/event.c (event_operator_collect): Just use strcat functions. |
| 2648 | |
Scott James Remnant | a843055 | 2008-03-03 00:28:51 +0000 | [diff] [blame] | 2649 | 2008-03-03 Scott James Remnant <scott@netsplit.com> |
| 2650 | |
Scott James Remnant | 7d2c9fb | 2008-03-03 17:29:13 +0000 | [diff] [blame] | 2651 | * init/environ.c (environ_valid): New function to check the validity |
| 2652 | of an environment variable name, should call before accepting any. |
| 2653 | (environ_expand_until): New function to expand variable references |
| 2654 | in a string using an environment table; supports a few common |
| 2655 | shell-like expressions. |
| 2656 | (environ_getn): Change to return the value of the string, not the |
| 2657 | entire environment string. |
| 2658 | * init/environ.h: Add prototypes. |
| 2659 | * init/errors.h: Add errors raised by new functions. |
| 2660 | * init/tests/test_environ.c (test_valid, test_expand): Add test |
| 2661 | cases for the new functions. |
| 2662 | (test_get, test_getn): Change test case to check for the variable |
| 2663 | value instead of returning the whole string. |
| 2664 | |
Scott James Remnant | 2c342d9 | 2008-03-03 10:52:29 +0000 | [diff] [blame] | 2665 | * TODO: Add thoughts on blocking commands. |
| 2666 | |
Scott James Remnant | 62f2d86 | 2008-03-03 02:13:19 +0000 | [diff] [blame] | 2667 | * TODO: Update. |
| 2668 | |
Scott James Remnant | 089298d | 2008-03-03 01:48:34 +0000 | [diff] [blame] | 2669 | * init/event.h (Event): Remove the refs member; we now never hold |
| 2670 | a reference to an event we're blocking since we always copy the |
| 2671 | environment out if we want to keep it. |
| 2672 | (EventOperator): Events are always blocked while we hold them, |
| 2673 | so drop the blocked member. |
| 2674 | (EventProgress): The done state is no longer needed, we can free |
| 2675 | in finished now. |
| 2676 | * init/event.c (event_ref, event_unref): Drop these functions. |
| 2677 | (event_new): Don't ininitialise the refs member since it's gone. |
| 2678 | (event_poll): Remove the done state since it's directly freed |
| 2679 | in event_finished again |
| 2680 | (event_finished): No done state, event is freed before return. |
| 2681 | (event_operator_new): No blocked member. |
| 2682 | (event_operator_copy): Always block the event after copying. |
| 2683 | (event_operator_destroy): Simply unblock. |
| 2684 | (event_operator_handle): Simply block the event on match. |
| 2685 | (event_operator_collect): Always block the copied event |
| 2686 | (event_operator_unblock): This function is no longer required, since |
| 2687 | it has an identical effect to reset. |
| 2688 | (event_operator_reset): Simply unblock the event. |
| 2689 | * init/tests/test_event.c (test_new): Drop the check for refs |
| 2690 | being initialised to zero. |
| 2691 | (test_ref, test_unref, test_operator_collect): Drop test for |
| 2692 | functions that have been dropped in the code. |
| 2693 | (test_operator_new): Drop the check for blocked being initialised |
| 2694 | to FALSE. |
| 2695 | (test_block, test_unblock, test_operator_destroy): Drop any references |
| 2696 | to the refs member. |
| 2697 | (test_operator_destroy): Actually fix the function to test things. |
| 2698 | (test_poll): Drop the check for remaining in the done state. |
| 2699 | (test_operator_new, test_operator_copy): Drop the checks for blocked. |
| 2700 | (test_operator_handle, test_operator_collect, test_opreator_reset): |
| 2701 | Drop references to refs and blocked. |
| 2702 | * init/job.c (job_unblock, job_handle_event): Drop the call to |
| 2703 | event_unref() since the next call was always event_unblock() and |
| 2704 | that's the one that we didn't delete. |
| 2705 | * init/tests/test_job.c (test_change_state, test_child_handler) |
| 2706 | (test_handle_event, test_handle_event_finished): Events don't |
| 2707 | have references anymore, so remove calls to reference, unreference |
| 2708 | and checks for the reference count - it's all done with blocks now. |
| 2709 | (test_new): Remove check that the operator is not blocked for a |
| 2710 | new job since there's no such thing now. |
| 2711 | (test_handle_event): Operators don't have a blocked member anymore, |
| 2712 | if there's an event, it's blocked. |
| 2713 | |
Scott James Remnant | 00ad000 | 2008-03-03 01:15:39 +0000 | [diff] [blame] | 2714 | * init/job.c (job_change_state): Don't reference the event we're |
| 2715 | blocked on, we'll always know when it's finished. |
| 2716 | (job_handle_event_finished): Likewise no reason to unreference it. |
| 2717 | * init/tests/test_job.c (test_change_goal, test_child_handler) |
| 2718 | (test_handle_event, test_change_state) |
| 2719 | (test_handle_event_finished): Remove the expectation that the blocked |
| 2720 | event is referenced by the job. |
| 2721 | * init/tests/test_event.c (test_poll): Don't reference the event, |
| 2722 | since the job would not have. |
| 2723 | |
Scott James Remnant | 66fe4e2 | 2008-03-03 01:07:16 +0000 | [diff] [blame] | 2724 | * init/job.c (job_emit_event): Use environ_add/set for style |
| 2725 | reasons. |
| 2726 | |
Scott James Remnant | d719fdc | 2008-03-03 00:52:52 +0000 | [diff] [blame] | 2727 | * init/job.c (job_handle_event): Reset the stop_on operator after |
| 2728 | processing the event, thus the expression needs to be completely |
| 2729 | reevaluated before the job can be stopped again by it. At last, |
| 2730 | correct behaviour! |
| 2731 | (job_change_state): No reason to reset the stop_on operator when |
| 2732 | starting since it's always reset after evaluating to TRUE now; |
| 2733 | likewise no reason to reset on re-entering running or waiting, |
| 2734 | job_unblock() is sufficient. |
| 2735 | (job_failed): No reason to iterate stop_on to set failed, it's |
| 2736 | empty - job_unblock() does what we want. |
| 2737 | * init/tests/test_job.c (test_handle_event): Check that the operator |
| 2738 | is actually reset and the event not referenced when handling from |
| 2739 | the event. |
| 2740 | (test_change_state, test_child_handler): Don't put anything in stop_on |
| 2741 | and thus don't expect anything to come out of it -- event environment |
| 2742 | is all done in stop_env and blocking done in blocking. |
| 2743 | |
Scott James Remnant | a843055 | 2008-03-03 00:28:51 +0000 | [diff] [blame] | 2744 | * init/job.c (job_handle_event): Collect the stop events and store |
| 2745 | them in the blocking list, unblocking any that were there before |
| 2746 | such as the start events. |
| 2747 | (job_change_state): Unblock blocking events when returning to running |
| 2748 | from pre-stop. |
| 2749 | * init/tests/test_job.c (test_handle_event): Make sure the stop |
| 2750 | events are collected and replace any previously blocking events. |
| 2751 | (test_change_state, test_child_handler): Test that stop events in |
| 2752 | the blocking list are kept and unblocked when necessary. |
| 2753 | |
Scott James Remnant | e4be2c5 | 2008-03-02 00:05:47 +0000 | [diff] [blame] | 2754 | 2008-03-02 Scott James Remnant <scott@netsplit.com> |
| 2755 | |
Scott James Remnant | 8e40268 | 2008-03-02 23:45:31 +0000 | [diff] [blame] | 2756 | * init/job.c (job_change_state): Shouldn't emit the started event |
| 2757 | on pre-stop cancellation, and shouldn't unblock the job because |
| 2758 | it's a service. |
Scott James Remnant | a843055 | 2008-03-03 00:28:51 +0000 | [diff] [blame] | 2759 | |
Scott James Remnant | 56ec560 | 2008-03-02 22:42:21 +0000 | [diff] [blame] | 2760 | * init/job.c (job_change_state): Throw away the stop environment |
| 2761 | when starting and returning to running. |
| 2762 | * init/tests/test_job.c (test_change_state): Make sure the stop |
| 2763 | environment is actually thrown away. |
| 2764 | |
Scott James Remnant | 3a06f5c | 2008-03-02 22:30:17 +0000 | [diff] [blame] | 2765 | * init/job.c (job_run_process): Append the environment from the |
| 2766 | stop events if given the pre-stop process to run; do this before |
| 2767 | the special events so they can never be overriden. |
| 2768 | * init/tests/test_job.c (test_run_process): Check that the stop event |
| 2769 | environment is included for pre-stop and not for other jobs. |
| 2770 | |
Scott James Remnant | 562a4f1 | 2008-03-02 22:20:27 +0000 | [diff] [blame] | 2771 | * init/job.c (job_handle_event): Remove setting of UPSTART_JOB |
| 2772 | and UPSTART_JOB_ID, we set that when we run the process. |
| 2773 | * init/tests/test_job.c (test_handle_event): Don't check for |
| 2774 | UPSTART_JOB and UPSTART_JOB_ID since we no longer copy it in here. |
| 2775 | |
Scott James Remnant | 99c6e4a | 2008-03-02 22:18:14 +0000 | [diff] [blame] | 2776 | * init/job.c (job_run_process): Copy the environment to pass it to |
| 2777 | the job, appending the UPSTART_JOB and UPSTART_JOB_ID variables here; |
| 2778 | we never want to be able to match these, etc. |
| 2779 | * init/tests/test_job.c (test_run_process): Add tests to make sure |
| 2780 | that the environment is actually set in the processes we run. |
| 2781 | |
Scott James Remnant | 9698683 | 2008-03-02 21:52:50 +0000 | [diff] [blame] | 2782 | * init/job.h (Job): Add stop_env member to store environment from |
| 2783 | stop events for the stop script. |
| 2784 | * init/job.c (job_new): Initialise stop_env to NULL. |
| 2785 | (job_handle_event): Copy environment from the stop_on operator into |
| 2786 | the stop_env member. |
| 2787 | * init/tests/test_job.c (test_new): Check that stop_env is NULL. |
| 2788 | (test_handle_event): Add lots of tests to make sure that the |
| 2789 | environment is collected from the events and stored in stop_env |
| 2790 | properly, overwriting what was there already if necessary. |
| 2791 | |
Scott James Remnant | f1755ad | 2008-03-02 20:42:00 +0000 | [diff] [blame] | 2792 | * init/init.supp (job-run-process-args): Add a suppression for the |
| 2793 | fact that job_run_process will leak its arguments to a new process |
| 2794 | assuming that it will call exec() or exit() |
| 2795 | |
Scott James Remnant | 5f68a52 | 2008-03-02 20:41:19 +0000 | [diff] [blame] | 2796 | * init/tests/test_job.c (test_child_handler): Remove bogus free tag |
| 2797 | of the list, which we don't use in this test (valgrind failure) |
| 2798 | |
Scott James Remnant | dd6e942 | 2008-03-02 20:40:45 +0000 | [diff] [blame] | 2799 | * init/job.h (Job): Remove the start_on member. |
| 2800 | * init/job.c (job_new): Don't initialise start_on since it's gone. |
| 2801 | (job_change_state): Drop call to unblock the start_on operator since |
| 2802 | the events are already unblocked by job_unblock. |
| 2803 | (job_failed): Drop setting of start_on events to failed since this |
| 2804 | is already done by job_unblock. This results in a slight change in |
| 2805 | behaviour, now when a job fails to start - the event or command will |
| 2806 | be immediately unblocked since there's no point waiting until it |
| 2807 | stops again - it was waiting for it to start. |
| 2808 | * init/tests/test_job.c (test_new): Remove start_on checks |
| 2809 | (test_change_state, test_child_handler, test_handle_event): Remove |
| 2810 | all references to start_on, instead relying on the blocking checks |
| 2811 | instead. |
| 2812 | * init/tests/test_event.c (test_poll): Remove solitary reference |
| 2813 | to job's start_on, this wasn't necessary anyway - we proved that it |
| 2814 | was the right event by affecting the job. Revert previous commit |
| 2815 | that temporarily increased the number of references, they should be |
| 2816 | one again now only the blocking list holds them. |
| 2817 | |
Scott James Remnant | 3730508 | 2008-03-02 20:08:07 +0000 | [diff] [blame] | 2818 | * init/job.h (job): Add blocking member, a list of events that we're |
| 2819 | blocking from finishing. |
| 2820 | * init/job.c (job_new): Initialise blocking member to NULL. |
| 2821 | (job_handle_event): Collect the list of events from the operator |
| 2822 | and store them in the job's blocking list (unblocking any existing |
| 2823 | first); if the job is already running, unblock unref and discard. |
| 2824 | (job_unblock): New function to deal with unblocking the events we're |
| 2825 | holding onto and resetting the blocking list; this will be extended |
| 2826 | later to also unblock any command. |
| 2827 | (job_change_state): Unblock events in running for services and in |
| 2828 | waiting for everything. |
| 2829 | (job_failed): Unblock events and mark them as failed. |
| 2830 | * init/tests/test_job.c (test_new): Check that it's initialised to NULL |
| 2831 | (test_handle_event): Extend the test cases to check the value of the |
| 2832 | blocking list, and to make sure that the previous blocking list is |
| 2833 | overwritten when necessary. |
| 2834 | (test_change_state, test_child_handler): Extend test cases so that |
| 2835 | wherever we're had a blocked event in start_on, we also have that in |
| 2836 | the blocking list. |
| 2837 | * init/tests/test_event.c (test_poll): Temporarily increase the |
| 2838 | expected number of references/blockers to the event in the poll |
| 2839 | test. |
| 2840 | |
Scott James Remnant | eec6b10 | 2008-03-02 12:24:22 +0000 | [diff] [blame] | 2841 | * init/job.h (Job): Add start_env member, this stores the environment |
| 2842 | to use when starting the event so it doesn't overwrite the current |
| 2843 | environment of a restarting job. |
| 2844 | * init/job.c (job_handle_event): Do the heavy lifting of starting a |
| 2845 | new job instance here; construct the environment from the built-ins |
| 2846 | and configured, append that collected from the start events, locate |
| 2847 | or create a new instance, add the job name and id then copy into |
| 2848 | the new start_env member before starting the job. At some point |
| 2849 | this will probably all become a function since it'll be similar for |
| 2850 | the control functions. |
| 2851 | (job_change_state): Copy the start_env member into the env member |
| 2852 | when in the starting state; thus the job environment remains the same |
| 2853 | until restarted. |
| 2854 | (job_new): Remove code to initialise the environment, we now do that |
| 2855 | when actually starting the instance. |
| 2856 | * init/tests/test_job.c (test_handle_event): Add test cases for |
| 2857 | starting the job, making sure that the environment is correctly |
| 2858 | copied into the right field and also checking what happens if it's |
| 2859 | already stopping or running. |
| 2860 | (test_change_state): Make sure that start_env is correctly copied |
| 2861 | over into env, overwriting what is there if non-NULL or keeping it |
| 2862 | if NULL. |
| 2863 | (test_new): Remove checks for environment setup, since we don't do |
| 2864 | that anymore here; replace with checking for NULL and restore the |
| 2865 | alloc fail tests. |
| 2866 | * TODO: Update. |
| 2867 | |
Scott James Remnant | 377f616 | 2008-03-02 02:23:52 +0000 | [diff] [blame] | 2868 | * init/environ.c (environ_add): Allow it to accept NULL length, since |
| 2869 | we can't always keep that around. |
| 2870 | |
Scott James Remnant | f83e4cf | 2008-03-02 01:33:06 +0000 | [diff] [blame] | 2871 | * init/process.c (process_spawn): Accept the environment list as |
| 2872 | a parameter, then finally we can change this function to take a |
| 2873 | JobConfig as the first argument. |
| 2874 | (process_error_read): Remove the associated error handler. |
| 2875 | * init/process.h: Change prototype. |
| 2876 | (ProcessErrorType): Remove error enum for environment. |
| 2877 | * init/tests/test_process.c (test_spawn): Update calls in test to |
| 2878 | just pass in an environment array (direct testing). |
| 2879 | * init/job.c (job_run_process): Pass configuration and environment |
| 2880 | to process_spawn. |
| 2881 | |
Scott James Remnant | af44bfe | 2008-03-02 01:22:29 +0000 | [diff] [blame] | 2882 | * init/process.c (process_spawn): Take the environment directly out |
| 2883 | the job structure, rather than recreating it. |
| 2884 | (process_environment): Drop function, absorbed elsewhere. |
| 2885 | * init/process.h: Remove prototype. |
| 2886 | * init/tests/test_process.c (test_spawn): Set the job_id variable |
| 2887 | before calling job_new and set config->start_on instead of |
| 2888 | job->start_on so that job_new can pick up both. |
| 2889 | (test_environment): Remove test cases. |
| 2890 | |
Scott James Remnant | 01c0ba7 | 2008-03-02 01:16:10 +0000 | [diff] [blame] | 2891 | * init/job.h (Job): finally gains env pointer of its own. |
| 2892 | * init/job.c (job_new): Initialise the environment, moving the last |
| 2893 | of the code from process_environment -- this is only temporary |
| 2894 | though in the interests of refactoring, it'll move out of here again |
| 2895 | soon enough. |
| 2896 | * init/tests/test_job.c (test_new): Make sure that the environment is |
| 2897 | set in a manner which tests the overriding of things by other things; |
| 2898 | we have to temporarily comment out the alloc fail stuff though :-( |
| 2899 | |
Scott James Remnant | 61b11fc | 2008-03-02 01:16:03 +0000 | [diff] [blame] | 2900 | * init/event.c (event_operator_collect): Make list the last argument |
| 2901 | for consistency with future functions. |
| 2902 | * init/event.h: Update prototype. |
| 2903 | * init/tests/test_event.c (test_operator_collect): Swap arguments. |
| 2904 | * init/process.c (process_environment): Update. |
| 2905 | |
Scott James Remnant | a6ce129 | 2008-03-02 00:24:08 +0000 | [diff] [blame] | 2906 | * init/job.c (job_config_environment): Function to generate an |
| 2907 | environment table from a JobConfig, code largely moved from process.c |
| 2908 | * init/job.h: Add protoyype. |
| 2909 | (JOB_DEFAULT_ENVIRONMENT): List of environment variables to always |
| 2910 | copy from the environment (moved from process.h) |
| 2911 | * init/tests/test_job.c (test_config_environment): Add test case, |
| 2912 | again largely copied from test_process.c |
| 2913 | * init/process.c (process_environment): Call job_config_environment |
| 2914 | instead of the code moved out. |
| 2915 | * init/process.h (PROCESS_ENVIRONMENT): Move to job.h |
| 2916 | * TODO: Update. |
| 2917 | |
Scott James Remnant | e4be2c5 | 2008-03-02 00:05:47 +0000 | [diff] [blame] | 2918 | * TODO: Update. |
| 2919 | |
Scott James Remnant | ec8ea0e | 2008-03-01 17:58:15 +0000 | [diff] [blame] | 2920 | 2008-03-01 Scott James Remnant <scott@netsplit.com> |
| 2921 | |
Scott James Remnant | 9fd2542 | 2008-03-01 23:56:31 +0000 | [diff] [blame] | 2922 | * init/event.c (event_operator_collect): Create a mega-function to |
| 2923 | iterate an EventOperator tree (filtering out those bits that aren't |
| 2924 | TRUE) and collect the events, adding them to a linked list, adding |
| 2925 | their environment to a table and making a string list for another |
| 2926 | environment variable. Fundamentally this function marshals data |
| 2927 | out of the Event subsystem into the right format for the Job subsystem. |
| 2928 | * init/event.h: Add prototype. |
| 2929 | * init/tests/test_event.c (test_operator_collect): Tests for the |
| 2930 | collector function; some bits may seem similar to test_process.c |
| 2931 | * init/process.c (process_environment): Use event_operator_collect |
| 2932 | to gather the environment, instead of its own code (which pretty |
| 2933 | much got pasted into event_operator_collect anyway). Force everything |
| 2934 | else to allocate matching the caller. |
| 2935 | * init/tests/test_process.c (test_spawn, test_environment): Had |
| 2936 | forgotten to set the value of the intermediate AND operator to TRUE, |
| 2937 | necessary now. |
| 2938 | |
Scott James Remnant | 8e69550 | 2008-03-01 21:34:12 +0000 | [diff] [blame] | 2939 | * init/process.c (process_environment_add): Move and rename this |
| 2940 | function, since it's not really process associated |
| 2941 | (process_environment): Change to use environ_add or environ_setf |
| 2942 | instead. |
| 2943 | * init/process.h: Remove prototype. |
| 2944 | * init/environ.c (environ_add): New name/location of |
| 2945 | process_environment_add, modified to not take a copy of the string |
| 2946 | (environ_set): Wrapper for the above for common dealing with |
| 2947 | environment we want to set from a format string. |
| 2948 | (environ_get, environ_getn, environ_lookup): Functions to get an |
| 2949 | environment variable entry; largely cripped from event.c but |
| 2950 | bug-fixed at the same time. |
| 2951 | * init/environ.h: Function prototypes. |
| 2952 | * init/event.c (event_operator_match): Change to use environ_lookup |
| 2953 | * init/tests/test_process.c (test_environment_add): Move the tests. |
| 2954 | * init/tests/test_environ.c: Test suite for environment handling |
| 2955 | * init/Makefile.am (init_SOURCES): Build environ.c and environ.h |
| 2956 | (TESTS): Build environment test suite |
| 2957 | (test_environ_SOURCES, test_environ_LDFLAGS, test_environ_LDADD): |
| 2958 | Details for environment test suite |
| 2959 | (test_process_LDADD, test_job_LDADD, test_event_LDADD) |
| 2960 | (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD): |
| 2961 | Link environ.o to other test suites |
| 2962 | |
Scott James Remnant | ec8ea0e | 2008-03-01 17:58:15 +0000 | [diff] [blame] | 2963 | * init/job.c (job_new): Increment the number of instances. |
| 2964 | (job_instance): Simplify the function, it now only returns the |
| 2965 | existing instance or NULL. This makes it easier to extend when |
| 2966 | we have env-limited instances later on. |
| 2967 | (job_handle_event): If job_instance returns NULL, create |
| 2968 | a new instance with job_new() and always reset the operator afterwards. |
| 2969 | * init/tests/test_job.c (test_new): Check that the instances variable |
| 2970 | is incremented when a new job is created. |
| 2971 | (test_instance): Change to check that it returns NULL when there is |
| 2972 | no active instance, or for multi-instance jobs, instead of creating |
| 2973 | a new one itself. |
| 2974 | (test_config_replace, test_find_by_pid) |
| 2975 | (test_find_by_id, test_change_goal, test_change_state) |
| 2976 | (test_next_state, test_run_process, test_kill_process) |
| 2977 | (test_child_handler, test_handle_event) |
| 2978 | (test_handle_event_finished): Call job_new to create a new instance |
| 2979 | from a config, instead of job_instance. |
| 2980 | |
| 2981 | * init/tests/test_conf.c (test_source_reload_job_dir) |
| 2982 | (test_file_destroy): Call job_new to create a new instance from a |
| 2983 | config, instead of job_instance. |
| 2984 | * init/tests/test_event.c (test_poll): Call job_new to create a new |
| 2985 | instance from a config, instead of job_instance. |
| 2986 | * init/tests/test_process.c (test_spawn, test_environment): Call |
| 2987 | job_new to create a new instance from a config, instead of job_instance |
| 2988 | |
Scott James Remnant | 9f468de | 2008-02-29 16:17:17 +0000 | [diff] [blame] | 2989 | 2008-02-29 Scott James Remnant <scott@netsplit.com> |
| 2990 | |
Scott James Remnant | 680d2fd | 2008-02-29 17:41:38 +0000 | [diff] [blame] | 2991 | * configure.ac: Compare the evaluated $sbindir against the common |
| 2992 | things we put in PATH, if it doesn't match, define EXTRA_PATH to |
| 2993 | contain it. |
| 2994 | * init/paths.h: Append EXTRA_PATH to PATH if defined. |
| 2995 | |
Scott James Remnant | 9f468de | 2008-02-29 16:17:17 +0000 | [diff] [blame] | 2996 | * init/Makefile.am (AM_CPPFLAGS): Replace TELINIT definition with |
| 2997 | SBINDIR, pointing at the common directory. |
| 2998 | * compat/sysv/Makefile.am (AM_CPPFLAGS): Replace SHUTDOWN definition |
| 2999 | with SBINDIR, pointing at the common directory. |
| 3000 | * init/paths.h (TELINIT): Redefine to be SBINDIR with "/telinit" |
| 3001 | on the end; define SBINDIR if necessary. |
| 3002 | * compat/sysv/reboot.c (SHUTDOWN): Redefine to be SBINDIR with |
| 3003 | "/shutdown" on the end; define SBINDIR if necessary. |
| 3004 | |
Scott James Remnant | c3c78b0 | 2008-02-22 14:55:12 +0000 | [diff] [blame] | 3005 | 2008-02-22 Scott James Remnant <scott@netsplit.com> |
| 3006 | |
Scott James Remnant | 72da2fe | 2008-02-22 20:10:53 +0000 | [diff] [blame] | 3007 | * init/event.c (event_operator_match): Rewrite to match both |
| 3008 | positionally and by name. |
| 3009 | * init/tests/test_event.c (test_operator_match): Update tests to |
| 3010 | check the new behaviour works. |
| 3011 | |
Scott James Remnant | ff48a24 | 2008-02-22 15:46:30 +0000 | [diff] [blame] | 3012 | * init/parse_job.c (parse_on_operand): Add arguments to env list |
Scott James Remnant | 7e96c7b | 2008-02-22 17:23:18 +0000 | [diff] [blame] | 3013 | rather than args; sanity check afterwards to ensure that positional |
| 3014 | doesn't follow name-based -- when parsing the job is the right place |
| 3015 | to catch this. |
Scott James Remnant | ff48a24 | 2008-02-22 15:46:30 +0000 | [diff] [blame] | 3016 | * init/tests/test_parse_job.c (test_stanza_start) |
| 3017 | (test_stanza_stop): Change args to env when checking operators. |
Scott James Remnant | 7e96c7b | 2008-02-22 17:23:18 +0000 | [diff] [blame] | 3018 | Check that arguments may be quoted in manners that we expect to be |
| 3019 | sane. Check that positional arguments cannot follow name-based ones. |
| 3020 | * init/errors.h: Add new error. |
| 3021 | * init/conf.c (conf_reload_path): Treat expected variable as a |
| 3022 | permanent error. |
Scott James Remnant | ff48a24 | 2008-02-22 15:46:30 +0000 | [diff] [blame] | 3023 | |
Scott James Remnant | d816fbd | 2008-02-22 15:13:07 +0000 | [diff] [blame] | 3024 | * init/tests/test_process.c (test_spawn, test_environment): |
| 3025 | Update event_new() calls to remove extra argument. |
| 3026 | |
Scott James Remnant | 36eea46 | 2008-02-22 15:11:05 +0000 | [diff] [blame] | 3027 | * init/main.c (main, cad_handler, kbd_handler, pwr_handler): |
| 3028 | Update event_new() calls to remove extra argument. |
| 3029 | |
Scott James Remnant | c398d78 | 2008-02-22 15:07:54 +0000 | [diff] [blame] | 3030 | * init/job.c (job_change_state): Update event_new () call. |
| 3031 | (job_emit_event): Update to put failure information in environment. |
| 3032 | * init/tests/test_job.c (test_new, test_instance) |
| 3033 | (test_child_handler, test_handle_event) |
| 3034 | (test_handle_event_finished): Remove extra argument to event_new, |
| 3035 | rename args to env in operator where necessary. |
| 3036 | (test_change_state): Update to check emitted event by full environment. |
| 3037 | |
Scott James Remnant | 53cb001 | 2008-02-22 14:55:53 +0000 | [diff] [blame] | 3038 | * init/event.h (Event): Remove args member. |
| 3039 | (EventOperator): Rename args member to env. |
| 3040 | Update prototypes to match. |
| 3041 | * init/event.c (event_new): Remove args member. |
| 3042 | (event_finished): Remove copying of args member to failed event. |
| 3043 | (event_operator_new): Rename args member to env. |
| 3044 | (event_operator_copy): Rename args copying to env. |
| 3045 | (event_operator_match): ?? |
| 3046 | * init/tests/test_event.c (test_new): Update test to remove args. |
| 3047 | (test_operator_new): Update test to rename args to env. |
| 3048 | (test_operator_copy): Update test to rename args to env. |
| 3049 | (test_operator_match): ??? |
| 3050 | |
Scott James Remnant | c3c78b0 | 2008-02-22 14:55:12 +0000 | [diff] [blame] | 3051 | * TODO: Update with job atomicity notes. |
| 3052 | |
Scott James Remnant | c488ddb | 2008-02-20 16:35:24 +0000 | [diff] [blame] | 3053 | 2008-02-20 Scott James Remnant <scott@netsplit.com> |
| 3054 | |
Scott James Remnant | 37fb28a | 2008-02-20 16:38:01 +0000 | [diff] [blame] | 3055 | * init/job.c: Switch around job_find_by_pid and job_find_by_id |
| 3056 | * init/job.h: Likewise. |
| 3057 | |
Scott James Remnant | c488ddb | 2008-02-20 16:35:24 +0000 | [diff] [blame] | 3058 | * init/job.h: Update prototypes to match variable names in the |
| 3059 | code. |
| 3060 | |
Scott James Remnant | 676c905 | 2008-02-17 16:08:40 +0000 | [diff] [blame] | 3061 | 2008-02-17 Scott James Remnant <scott@netsplit.com> |
| 3062 | |
Scott James Remnant | 742d466 | 2008-02-17 18:29:26 +0000 | [diff] [blame] | 3063 | * init/process.c (process_kill): Change to accept a JobConfig rather |
| 3064 | than a Job, since in theory this should only ever need that in a |
| 3065 | future where we can specify a kill signal (right now it's not used |
| 3066 | for anything!) |
| 3067 | * init/process.h: Update prototype. |
| 3068 | * init/tests/test_process.c (test_kill): Update test cases. |
| 3069 | * init/job.c (job_kill_process, job_kill_timer): Pass in JobConfig |
| 3070 | instead of Job. |
| 3071 | |
Scott James Remnant | d37dd06 | 2008-02-17 18:25:51 +0000 | [diff] [blame] | 3072 | * init/process.c (process_spawn): Accept trace as an argument instead |
| 3073 | of using a random piece of job state to determine whether to trace |
| 3074 | or not. |
| 3075 | * init/process.h: Update prototype. |
| 3076 | * init/tests/test_process.c (test_spawn): Update tests to pass in |
| 3077 | via argument whether to trace the job or not. |
| 3078 | * init/job.c (job_run_process): Pass in the trace variable rather |
| 3079 | than relying on it working it out for itself; this means we don't |
| 3080 | need to set the state until after, therefore don't need to reset it. |
| 3081 | |
Scott James Remnant | 6b1c7ee | 2008-02-17 18:00:33 +0000 | [diff] [blame] | 3082 | * AUTHORS, logd/jobs.d/logd.in: Update e-mail addresses. |
| 3083 | |
Scott James Remnant | 676c905 | 2008-02-17 16:08:40 +0000 | [diff] [blame] | 3084 | * README: Update kernel recommendation to 2.6.24, since that's |
| 3085 | the oldest version that the test suite will complete under. |
| 3086 | |
Scott James Remnant | a3239f6 | 2008-01-17 03:34:27 +0000 | [diff] [blame] | 3087 | 2008-01-17 Scott James Remnant <scott@netsplit.com> |
| 3088 | |
Scott James Remnant | 85a9650 | 2008-01-17 03:38:44 +0000 | [diff] [blame] | 3089 | * TODO: Update. |
| 3090 | |
Scott James Remnant | dc4162b | 2008-01-17 03:37:02 +0000 | [diff] [blame] | 3091 | * init/job.c (job_run_process): Don't append the list of event |
| 3092 | names, they can be found in $UPSTART_EVENTS now. This is better |
| 3093 | since it's consistent for exec and script. |
| 3094 | * init/tests/test_job.c (test_run_process): Drop test case. |
| 3095 | |
Scott James Remnant | a3239f6 | 2008-01-17 03:34:27 +0000 | [diff] [blame] | 3096 | * init/process.c (process_environment): Function to build an |
| 3097 | environment table for a job containing built-in variables, those |
| 3098 | from the configuration, events and finally the upstart job ones. |
| 3099 | (process_environment_add): Helper function for the above that |
| 3100 | handles adding a variable to the array; dealing with fetching the |
| 3101 | value from init's environment if necessary. |
| 3102 | (process_setup_environment): This function now gets dropped in |
| 3103 | favour of the new ones. |
| 3104 | (process_spawn): Call the new process_environment() function and set |
| 3105 | the environ variable directly. |
| 3106 | * init/process.h (PROCESS_ENVIRONMENT): Define built-in environment |
| 3107 | variables that are always copied from our own environment. |
| 3108 | Add prototypes. |
| 3109 | * init/tests/test_process.c (test_environment): Check that the |
| 3110 | environment is built correctly and that each bit overrides the |
| 3111 | right other bit. |
| 3112 | (test_environment_add): Check that the array is built correctly. |
| 3113 | (test_spawn): Adjust order and values of expected environment |
| 3114 | to match what's now set. |
| 3115 | |
Scott James Remnant | 5c87e6e | 2008-01-16 00:27:22 +0000 | [diff] [blame] | 3116 | 2008-01-16 Scott James Remnant <scott@netsplit.com> |
| 3117 | |
Scott James Remnant | b150df6 | 2008-01-16 03:14:16 +0000 | [diff] [blame] | 3118 | * init/job.c (job_failed): Separate the logic that marks the job |
| 3119 | and its associated events as failed into its own function, since |
| 3120 | it's a large enough amount of code that we were otherwise duplicating |
| 3121 | everywhere else (and in a few places, failing to mark the events as |
| 3122 | failed as well). |
| 3123 | (job_change_state, job_process_terminated): Call job_failed instead |
| 3124 | of doing it ourselves. |
| 3125 | (job_emit_event): De-nest the logic and fix so that we don't add |
| 3126 | environment to the failed respawn event. |
| 3127 | * init/tests/test_job.c (test_change_state): Add checks on whether |
| 3128 | the event was marked as failed or not. |
| 3129 | |
Scott James Remnant | 340083b | 2008-01-16 02:06:51 +0000 | [diff] [blame] | 3130 | * TODO: Update. |
| 3131 | |
Scott James Remnant | 30bc02b | 2008-01-16 01:49:20 +0000 | [diff] [blame] | 3132 | * configure.ac (AC_COPYRIGHT): Update copyright to 2008. |
| 3133 | |
Scott James Remnant | 4ff4a7d | 2008-01-16 01:47:20 +0000 | [diff] [blame] | 3134 | * TODO: Update. |
| 3135 | |
Scott James Remnant | 75e801a | 2008-01-16 00:44:17 +0000 | [diff] [blame] | 3136 | * init/tests/test_job.c (test_child_handler): Don't run the signal |
| 3137 | and ptrace tests while in valgrind, sometimes signals (specifically |
| 3138 | SIGCONT after SIGSTOP) don't behave right and we kinda need that |
| 3139 | reliability. |
| 3140 | |
Scott James Remnant | 798284f | 2008-01-16 00:31:23 +0000 | [diff] [blame] | 3141 | * init/tests/test_job.c (test_child_handler): After adding extra |
| 3142 | processes, make sure we clean up again so each test is roughly |
| 3143 | independant. Fix the final test case to not rely on previous |
| 3144 | setup and work on its own. |
| 3145 | |
Scott James Remnant | 0cfd4e7 | 2008-01-16 00:30:26 +0000 | [diff] [blame] | 3146 | * init/tests/test_job.c (test_change_state): Remove useless check |
| 3147 | of job->start_on from a killed/post-stop check (noticed while |
| 3148 | writing the other). |
| 3149 | |
Scott James Remnant | 5c87e6e | 2008-01-16 00:27:22 +0000 | [diff] [blame] | 3150 | * init/job.c (job_change_state): Check the return value of |
| 3151 | job_run_process() and if particular processes fail, change the |
| 3152 | goal to stop and push the job into the next state; setting the job |
| 3153 | as failed along the way. |
| 3154 | (job_emit_event): If the exit_status is -1 then it means the job |
| 3155 | failed to spawn, so don't place EXIT_SIGNAL or EXIT_STATUS in the |
| 3156 | event environment. |
| 3157 | * init/tests/test_job.c (test_change_state): Check what happens when |
| 3158 | each process type fails, make sure that the job is stopped for |
| 3159 | pre-start, spawned and post-stop and the failure is ignored for |
| 3160 | post-start and pre-stop. |
| 3161 | |
Scott James Remnant | fa73338 | 2008-01-15 15:33:27 +0000 | [diff] [blame] | 3162 | 2008-01-15 Scott James Remnant <scott@netsplit.com> |
| 3163 | |
Scott James Remnant | 9f62a8e | 2008-01-15 19:22:36 +0000 | [diff] [blame] | 3164 | * init/main.c: Selectively compile out certain pieces when make is |
| 3165 | run with CPPFLAGS=-DDEBUG, giving us a build that'll happily run from |
| 3166 | a user terminal. |
| 3167 | * init/event.h: Change the startup event to "debug" when built like |
| 3168 | that, so we don't accidentally do bad things. |
| 3169 | |
Scott James Remnant | b53527f | 2008-01-15 19:15:29 +0000 | [diff] [blame] | 3170 | * init/job.c (job_run_process): Catch PROCESS_ERROR and abort the |
| 3171 | attempt to run the process, returning a non-temporary error condition. |
| 3172 | * init/tests/test_job.c (test_run_process): Add test case for |
| 3173 | attempting to spawn a file that doesn't exist. |
| 3174 | |
Scott James Remnant | 85a2a0e | 2008-01-15 19:09:23 +0000 | [diff] [blame] | 3175 | * init/process.c (process_error_read): Avoid the word process, since |
| 3176 | it's likely included in the higher error message. |
| 3177 | |
Scott James Remnant | faa898c | 2008-01-15 19:05:04 +0000 | [diff] [blame] | 3178 | * init/process.c (process_spawn): Call process_error_abort() on any |
| 3179 | error condition. |
| 3180 | * init/tests/test_process.c (test_spawn): Add a test case for failing |
| 3181 | to spawn a process and receiving ProcessError correctly; fix other |
| 3182 | cases to ensure they return a pid. |
| 3183 | |
Scott James Remnant | c721197 | 2008-01-15 18:55:59 +0000 | [diff] [blame] | 3184 | * init/errors.h: Add PROCESS_ERROR to the enum, but not to the string |
| 3185 | list since there's no specific defined string for this one. |
| 3186 | * init/process.h (ProcessError): Structure that builds on NihError |
| 3187 | to add additional information for a process error. |
| 3188 | (ProcessErrorType): enum of different process error types. |
| 3189 | * init/process.c (process_spawn): After forking read the error in |
| 3190 | the parent, returning if we raise one. |
| 3191 | Ensure we close the pipe if the fork fails. |
| 3192 | Re-order so that we set the environment, umask and priority after the |
| 3193 | resource limits (which should apply to them). |
| 3194 | (process_error_abort): New function to immediately abort with an |
| 3195 | error, writing it on the pipe first. |
| 3196 | (process_error_read): Counterpart function to read the error from |
| 3197 | the pipe and raise it, with appropriate error messages. |
| 3198 | |
Scott James Remnant | 6673878 | 2008-01-15 17:01:19 +0000 | [diff] [blame] | 3199 | * init/process.c (process_spawn): Create a pipe to use for |
| 3200 | communication with the child, ensuring its closed before the parent |
| 3201 | returns and ensuring that the writing end is close-on-exec in the |
| 3202 | child. |
| 3203 | |
Scott James Remnant | 2e23f6b | 2008-01-15 16:38:28 +0000 | [diff] [blame] | 3204 | * init/job.c (job_run_process): Change to return a value indicating |
| 3205 | whether there's been a non-temporary error (always returns zero so |
| 3206 | far). |
| 3207 | * init/job.h: Update prototype. |
| 3208 | * init/tests/test_job.c (test_run_process): Check that job_run_process |
| 3209 | always returns zero. |
| 3210 | |
Scott James Remnant | 5dee92e | 2008-01-15 16:30:23 +0000 | [diff] [blame] | 3211 | * init/job.c (job_change_goal): Document in which states this function |
| 3212 | has unexpected side-effects such as freeing the job, since we do |
| 3213 | attempt to call it from within job_change_state(). |
| 3214 | |
Scott James Remnant | fa73338 | 2008-01-15 15:33:27 +0000 | [diff] [blame] | 3215 | * init/process.c (process_setup_limits): Integrate this function back |
| 3216 | into process_spawn() since there's no reason for it to be separate. |
| 3217 | (process_setup_console): Alter this function so it closes the original |
| 3218 | console descriptors, opens the new ones and can reset them to if |
| 3219 | required -- in particular, this no longer takes a Job parameter. |
| 3220 | (process_spawn): Use the new process_setup_console function and |
| 3221 | integrate code from process_setup_limits(). |
| 3222 | * init/process.h: Update function prototype. |
| 3223 | * init/main.c (main): Use the new process_setup_console() argument |
| 3224 | form. Move syslog opening to the end of the function, rather than |
| 3225 | where it is now where it could be at risk of being closed again |
| 3226 | immediately. Change the root directory in case we're run in some |
| 3227 | weird way. |
| 3228 | (reset_console): Remove function since the code is now in |
| 3229 | process_setup_console() |
| 3230 | * init/enum.h (console_type): Remove CONSOLE_LOGGED and make the |
| 3231 | CONSOLE_NONE constant be zero. |
| 3232 | * init/parse_job.c (stanza_console): Drop parsing of "logged" |
| 3233 | * init/tests/test_parse_job.c (test_stanza_console): Drop testing |
| 3234 | of "logged" parsing. |
| 3235 | |
Scott James Remnant | de581cc | 2008-01-14 21:35:53 +0000 | [diff] [blame] | 3236 | 2008-01-14 Scott James Remnant <scott@netsplit.com> |
| 3237 | |
| 3238 | * HACKING: Correct bzr URLs to trunk. |
| 3239 | |
Scott James Remnant | 20d3a1c | 2007-12-15 14:52:33 +0000 | [diff] [blame] | 3240 | 2007-12-15 Scott James Remnant <scott@netsplit.com> |
| 3241 | |
Scott James Remnant | cc6810d | 2007-12-15 15:39:02 +0000 | [diff] [blame] | 3242 | * init/process.c (process_spawn): Fix some documentation strings. |
| 3243 | |
Scott James Remnant | 206c97a | 2007-12-15 14:55:51 +0000 | [diff] [blame] | 3244 | * init/process.c (process_kill): Move to beneath the process setup |
| 3245 | functions. |
| 3246 | * init/process.h: Adjust ordering here too. |
| 3247 | |
Scott James Remnant | 20d3a1c | 2007-12-15 14:52:33 +0000 | [diff] [blame] | 3248 | * init/process.c (process_spawn): Group console closing and setup |
| 3249 | together, becoming the session and process group leader first. |
| 3250 | |
Scott James Remnant | 6f1e41f | 2007-12-07 00:32:21 +0000 | [diff] [blame] | 3251 | 2007-12-07 Scott James Remnant <scott@netsplit.com> |
| 3252 | |
Scott James Remnant | e417825 | 2007-12-07 13:35:45 +0000 | [diff] [blame] | 3253 | * init/process.c (process_spawn): Drop the debug message since |
| 3254 | it's always repeated by the caller. |
| 3255 | * init/job.c (job_run_process): Drop the word Active which is a |
| 3256 | hold-over from when we had different process states. |
| 3257 | |
Scott James Remnant | 64c8c77 | 2007-12-07 10:20:13 +0000 | [diff] [blame] | 3258 | * TODO: Update. |
| 3259 | |
Scott James Remnant | 0f68867 | 2007-12-07 10:17:25 +0000 | [diff] [blame] | 3260 | * init/job.c (job_child_handler): Add code to handle the trapped |
| 3261 | signal and ptrace event cases, distinguishing between a trapped |
| 3262 | signal and process stopped after exec or fork using our trace |
| 3263 | state member. Call out to other functions to do the work. |
| 3264 | (job_process_trace_new): Called after the first exec to set the |
| 3265 | ptrace options, update the trace state and allow the process to |
| 3266 | continue without delivering the signal. Also called after the |
| 3267 | fork to do the same. |
| 3268 | (job_process_trace_new_child): Called after a fork for the new child; |
| 3269 | increments the fork counter and if it goes over the number we want, |
| 3270 | detaches from the process and allows it to move to running. Otherwise |
| 3271 | calls job_process_trace_new() instead. |
| 3272 | (job_process_trace_signal): Called when a signal is trapped, simply |
| 3273 | delivers it to the process unchanged. |
| 3274 | (job_process_trace_fork): Called before a fork for the parent, obtains |
| 3275 | the new child process id from the event, updating the job structure, |
| 3276 | and detaches from the parent which we're no longer interested in. |
| 3277 | (job_process_trace_exec): Called after an exec other than the first, |
| 3278 | assumed to be the end of forking so detaches from the process and |
| 3279 | allows it to move to running. |
| 3280 | * init/tests/test_job.c (test_child_handler): Add test cases for |
| 3281 | the various ptrace states. |
| 3282 | |
Scott James Remnant | e3c10ae | 2007-12-07 09:18:38 +0000 | [diff] [blame] | 3283 | * init/job.c (job_run_process): Set process trace state to new for |
| 3284 | the main job if we need to wait for the daemon or fork; otherwise |
| 3285 | reset the state. |
| 3286 | * init/tests/test_job.c (test_run_process): Add test cases to make |
| 3287 | sure the trace state is set right and picked up by process_spawn. |
| 3288 | |
Scott James Remnant | 3525ffd | 2007-12-07 09:04:10 +0000 | [diff] [blame] | 3289 | * init/process.c (process_spawn): Set a ptrace before execing the |
| 3290 | binary if the trace state is TRACE_NEW, set by the caller. |
| 3291 | * init/tests/test_process.c (test_spawn): Make sure that a job is |
| 3292 | ptraced if set up properly. |
| 3293 | (child): Add a simple case that just exits immediately for testing |
| 3294 | the above. |
| 3295 | |
Scott James Remnant | d431eea | 2007-12-07 09:01:58 +0000 | [diff] [blame] | 3296 | * init/job.h (Job): Add new trace_forks member to keep count of how |
| 3297 | many forks we've seen and trace_state member to track whether we've |
| 3298 | just started the trace or just forked. |
| 3299 | * init/enum.h (TraceState): Add enumeration to keep track of ptrace |
| 3300 | state to differentiate between a signal and an event. |
| 3301 | * init/job.c (job_new): Initialise new members. |
| 3302 | * init/tests/test_job.c (test_new): Check new members are initialised |
| 3303 | |
Scott James Remnant | 319c7f9 | 2007-12-07 08:57:48 +0000 | [diff] [blame] | 3304 | * init/enum.h (JobWaitType): Add new daemon and fork wait types. |
| 3305 | * init/parse_job.c (stanza_wait): Add parsing for daemon and fork. |
| 3306 | * init/tests/test_parse_job.c (test_stanza_wait): Add tests too. |
| 3307 | |
Scott James Remnant | 58d23f5 | 2007-12-07 00:42:50 +0000 | [diff] [blame] | 3308 | * init/job.h (JobConfig): Remove daemon and pid members. |
| 3309 | (Job): Remove pid_timer member. |
| 3310 | (JOB_DEFAULT_PID_TIMEOUT): Remove this constant. |
| 3311 | * init/job.c (job_config_new, job_new): Remove initialisation of |
| 3312 | removed members. |
| 3313 | (job_change_state): Stay in spawned unless we're not waiting for |
| 3314 | anything -- remove the daemon flag. |
| 3315 | * init/tests/test_job.c (test_config_new, test_new): Remove checks |
| 3316 | for initialisation of removed members. |
| 3317 | (test_change_state): Remove daemon flag stays in spawned check since |
| 3318 | the daemon flag has gone. |
| 3319 | * init/parse_job.c (stanza_daemon, stanza_pid): Remove these |
| 3320 | functions since they have no members to set. |
| 3321 | * init/tests/test_parse_job.c (test_stanza_daemon, test_stanza_pid): |
| 3322 | Remove the tests for the now non-existant functions. |
| 3323 | |
Scott James Remnant | 6f1e41f | 2007-12-07 00:32:21 +0000 | [diff] [blame] | 3324 | * init/process.c (process_spawn): raise the system error before |
| 3325 | calling another syscall, in case we overwrite errno. |
| 3326 | |
Scott James Remnant | 5fdadda | 2007-12-06 11:09:00 +0000 | [diff] [blame] | 3327 | 2007-12-06 Scott James Remnant <scott@netsplit.com> |
| 3328 | |
Scott James Remnant | 5ebc6c6 | 2007-12-06 16:01:13 +0000 | [diff] [blame] | 3329 | * init/job.c (job_child_handler): Implement a combined child event |
| 3330 | handler to replace the multiple separate ones. This handler deals |
| 3331 | with adding appropriate messages to the log and decoding any state |
| 3332 | information before calling specific action functions. |
| 3333 | (job_child_reaper): Remove, moving the bulk of the code into new |
| 3334 | (job_process_terminated): function that handles it cleanly. |
| 3335 | (job_child_minder): Remove, moving the bulk of the code into new |
| 3336 | (job_process_stopped): function that's a lot cleaner. |
| 3337 | * init/job.h: Update prototypes. |
| 3338 | * init/tests/test_job.c (test_child_reaper, test_child_minder): |
| 3339 | Combine unit tests from both functions into single new |
| 3340 | (test_child_handler): function. |
| 3341 | * init/main.c (main): Call the combined function on child events |
| 3342 | instead of separate ones. |
| 3343 | |
Scott James Remnant | 5fdadda | 2007-12-06 11:09:00 +0000 | [diff] [blame] | 3344 | * init/job.c (job_child_minder): Add informational message and |
| 3345 | improve style and documentation. |
| 3346 | |
Scott James Remnant | ab882c2 | 2007-12-02 18:17:09 +0000 | [diff] [blame] | 3347 | 2007-12-02 Scott James Remnant <scott@netsplit.com> |
| 3348 | |
| 3349 | * init/enum.h (JobWaitType): Introduce a new enum that specifies |
| 3350 | how to transition the job from spawned to running; either we don't |
| 3351 | wait, or we wait for it to emit the stopped signal. |
| 3352 | * init/job.h (JobConfig): Add the wait_for member. |
| 3353 | Add protoype for job_child_minder. |
| 3354 | * init/job.c (job_config_new): Initialise to JOB_WAIT_NONE. |
| 3355 | (job_child_minder): New function to catch when a process is stopped |
| 3356 | by a signal, and move it to the next state when it does so. |
| 3357 | * init/tests/test_job.c (test_config_new): Check the initialisation |
| 3358 | of wait_for to JOB_WAIT_NONE. |
| 3359 | (test_child_minder): Tests for the new function. |
| 3360 | (test_change_state): Copy the daemon test case to refer to waiter. |
| 3361 | * init/main.c (main): Call job_child_minder whenever the job is |
| 3362 | stopped by a signal |
| 3363 | * init/parse_job.c (stanza_wait): Parse a new "wait" stanza that |
| 3364 | specifies what to wait for before leaving the spawned state. |
| 3365 | * init/tests/test_parse_job.c (test_stanza_wait): Check the new |
| 3366 | stanza. |
| 3367 | |
Scott James Remnant | 4bef98a | 2007-11-30 01:28:28 +0000 | [diff] [blame] | 3368 | 2007-11-29 Scott James Remnant <scott@netsplit.com> |
| 3369 | |
| 3370 | * init/tests/test_job.c (test_change_state): Add a few sets to NULL |
| 3371 | so gcc is happy. |
| 3372 | |
Scott James Remnant | 0eade49 | 2007-11-15 05:48:07 +0000 | [diff] [blame] | 3373 | 2007-11-15 Scott James Remnant <scott@netsplit.com> |
| 3374 | |
| 3375 | * init/job.c (job_child_reaper): Update argument names and types |
| 3376 | to match new NihChildHandler pattern; switch on event instead, |
| 3377 | which can now have three values not two (it always could, this was |
| 3378 | a bug) to output warning and assume that status is always non-zero |
| 3379 | if killed so no need to check that separately. |
| 3380 | * init/job.h: Update prototype. |
| 3381 | * init/tests/test_job.c (test_child_reaper): Update calls to |
| 3382 | job_child_reaper to pass an NihChildEvents member instead of FALSE |
| 3383 | or TRUE for killed. |
| 3384 | * init/main.c: Adjust call to nih_child_add_watch to indicate which |
| 3385 | events we want to pass to the reaper; we don't use NIH_CHILD_ALL |
| 3386 | since we're going to add ptrace stuff to a different function. |
| 3387 | |
Scott James Remnant | 5c40843 | 2007-11-07 21:42:25 -0500 | [diff] [blame] | 3388 | 2007-11-07 Scott James Remnant <scott@netsplit.com> |
| 3389 | |
| 3390 | * init/main.c (main): Tidy up. |
| 3391 | |
Scott James Remnant | bc9b671 | 2007-11-04 01:49:04 -0400 | [diff] [blame] | 3392 | 2007-11-04 Scott James Remnant <scott@netsplit.com> |
| 3393 | |
| 3394 | Complete the simplification of job config; rather than try and |
| 3395 | precompute job replacements, keeping them all in the same hash table |
| 3396 | and chaining them together, we just work it out when it's actually |
| 3397 | necessary based on what's in the conf_sources list. |
| 3398 | |
| 3399 | * init/job.h (JobConfig): Remove the replacement and replacement_for |
| 3400 | members and put a deleted member in instead. |
| 3401 | * init/job.c (job_config_new): Initialise deleted to FALSE; don't |
| 3402 | replace the job into the hash table, since we only want the current |
| 3403 | one in there now. |
| 3404 | (job_config_find_by_name): Now that there is only ever one job |
| 3405 | config in the hash table, we don't need any special function and |
| 3406 | can just use nih_hash_lookup directly, so drop this function. |
| 3407 | (job_config_should_replace): Rename to job_config_replace |
| 3408 | (job_config_replace): Rework, it now checks to see whether there |
| 3409 | are instances, and if not removes the job from the hash table |
| 3410 | before selecting a new one (which might be the same job). |
| 3411 | * init/tests/test_job.c (test_config_new): Update test to check |
| 3412 | deleted starts off as FALSE and that the job isn't in the hash. |
| 3413 | (test_config_find_by_name): Drop. |
| 3414 | (test_config_should_replace): Rename and rewrite to test replacement |
| 3415 | actually works as we expect. |
| 3416 | (test_change_state): Update tests for entering the waiting mode and |
| 3417 | replacing jobs. |
| 3418 | (test_find_by_pid, test_find_by_id, test_handle_event) |
| 3419 | (test_handle_event_finished): Add jobs to the hash table, otherwise |
| 3420 | we can't find them |
| 3421 | (test_child_reaper): Add job to the hash table, and also create a |
| 3422 | source for it since we end up with it in the waiting state so need |
| 3423 | to be able to keep it. |
| 3424 | * init/Makefile.am (test_process_LDADD, test_job_LDADD) |
| 3425 | (test_event_LDADD): Need the full .o file list now. |
| 3426 | * init/conf.c (conf_file_destroy): Rewrite to mark the job deleted, |
| 3427 | call job_config_replace if it's the current job and free it if |
| 3428 | it isn't the current job either before or after that call. |
| 3429 | (conf_reload_path): Handle job replacement here; look up the |
| 3430 | old job in the hash table, if it exists attempt a replacement |
| 3431 | otherwise add the new job to the hash table. |
| 3432 | * init/tests/test_conf.c (test_source_reload_job_dir) |
| 3433 | (test_source_reload_conf_dir, test_source_reload_file): Update |
| 3434 | tests to check job->deleted and use nih_hash_lookup to see whether |
| 3435 | it's the current job. |
| 3436 | (test_file_destroy): Write tests to check the common cases, we don't |
| 3437 | need to worry about the intermediate now since they can't happen. |
| 3438 | * init/parse_job.c (parse_job): Massively simplify, this only creates |
| 3439 | the config and parses it now. |
| 3440 | * init/tests/test_parse_job.c (test_parse_job): Remove the replacement |
| 3441 | checks. |
| 3442 | * init/tests/test_event.c (test_poll): Add configs to the hash |
| 3443 | table so they can be found. |
| 3444 | * TODO: Update. |
| 3445 | |
Scott James Remnant | 9fa1ce8 | 2007-11-03 02:06:54 -0400 | [diff] [blame] | 3446 | 2007-11-03 Scott James Remnant <scott@netsplit.com> |
| 3447 | |
| 3448 | * init/conf.h (ConfSource): Remove priority, we'll place these |
| 3449 | in a linked list and use that order instead. |
| 3450 | (ConfSourcePriority): Drop accordingly. |
| 3451 | (ConfItem): Drop this structure; permitting jobs and states to be |
| 3452 | defined inside larger conf files made things complicated for no |
| 3453 | benefit; move the item union into |
| 3454 | (ConfFile): here, instead of the items list. |
| 3455 | (ConfItemType): Drop accordingly. |
| 3456 | * init/conf.c (conf_init): Store sources in a linked list, instead |
| 3457 | of a hash table; no idea why it ever was. |
| 3458 | (conf_source_new): Drop priority argument and add to list not hash. |
| 3459 | (conf_file_new): Set data to NULL instead of initialising items, |
| 3460 | set destructor to conf_file_destroy. |
| 3461 | (conf_item_destroy): Rename to conf_file_destroy |
| 3462 | (conf_file_destroy): and adjust to refer to ConfItem instead, |
| 3463 | getting the item type through the source. |
| 3464 | (conf_item_new): Drop. |
| 3465 | (conf_reload): Iterate as linked list not hash table. |
| 3466 | (conf_reload_path): Simplify handling of old files and items a |
| 3467 | little, just look it up and always free if it exists before parsing |
| 3468 | the new file. |
| 3469 | (conf_file_get): No longer any need for this function. |
| 3470 | * init/tests/test_conf.c (test_file_get, test_item_new): Drop |
| 3471 | test functions for those that have been removed. |
| 3472 | (test_item_destroy): Rename to test_file_destroy. |
| 3473 | (test_source_new): Don't pass or check priority, or hash lookup. |
| 3474 | (test_file_new): Check data is set correctly. |
| 3475 | (test_source_reload_job_dir, test_source_reload_conf_dir) |
| 3476 | (test_source_reload_file): Update tests accordingly. |
| 3477 | * init/parse_conf.c (stanza_job): Drop the job stanza, jobs |
| 3478 | may only be defined in dedicated directories. |
| 3479 | * init/tests/test_parse_conf.c (test_parse_conf): Simply check to only |
| 3480 | make sure the file is parsed. |
| 3481 | (test_stanza_job): Drop function. |
| 3482 | * init/main.c: Update calls to conf_source_new. |
| 3483 | * init/init.supp: Update intermediate function in suppression. |
| 3484 | |
Scott James Remnant | b4169fa | 2007-10-26 13:54:41 -0400 | [diff] [blame] | 3485 | 2007-10-26 Scott James Remnant <scott@netsplit.com> |
| 3486 | |
| 3487 | * init/process.c (process_spawn): Mask out all signals across the |
| 3488 | fork() rather than just SIGCHLD; reset the signal handlers to default |
| 3489 | before unmasking again. The original rationale was we needed to |
| 3490 | avoid SIGCHLD occurring before we'd stashed the pid, but that's no |
| 3491 | longer a problem; the new rationale is that we want to avoid the |
| 3492 | signal handlers running in the newly forked child. |
| 3493 | |
Scott James Remnant | d29da6f | 2007-10-20 00:08:52 +0100 | [diff] [blame] | 3494 | 2007-10-20 Scott James Remnant <scott@netsplit.com> |
| 3495 | |
Scott James Remnant | 333ad2d | 2007-10-20 15:30:29 +0100 | [diff] [blame] | 3496 | * init/job.c (job_init): The job's name is the first item in the |
| 3497 | structure again, so we can use nih_hash_string_key. |
| 3498 | (job_config_name): Drop this function, then. |
| 3499 | |
Scott James Remnant | eda2958 | 2007-10-20 14:44:24 +0100 | [diff] [blame] | 3500 | * init/conf.h (ConfSourcePriority): Add a priority enum |
| 3501 | (ConfSource): Add priority member. |
| 3502 | * init/conf.c (conf_source_new): Take priority as an argument and |
| 3503 | set it in the structure. |
| 3504 | * init/tests/test_conf.c (test_source_new): Make sure priority |
| 3505 | is set from the argument. |
| 3506 | (test_file_new, test_file_get, test_item_new) |
| 3507 | (test_source_reload_job_dir, test_source_reload_conf_dir) |
| 3508 | (test_source_reload_file, test_source_reload, test_item_destroy): |
| 3509 | Pass in a priority when creating a ConfSource. |
| 3510 | * init/tests/test_parse_conf.c (test_parse_conf): Likewise. |
| 3511 | * init/main.c (main): Set relative priorities for the configuration |
| 3512 | directories. |
| 3513 | |
Scott James Remnant | 388621b | 2007-10-20 14:29:40 +0100 | [diff] [blame] | 3514 | * init/conf.h (conf_file, conf_item): Add source and file members |
| 3515 | respectively that point to the parent structure. |
| 3516 | * init/conf.c (conf_file_new, conf_item_new): Set the members. |
| 3517 | * init/tests/test_conf.c (test_file_new, test_file_get) |
| 3518 | (test_item_new): Make sure the new members are set properly. |
| 3519 | |
Scott James Remnant | 87145d6 | 2007-10-20 14:02:59 +0100 | [diff] [blame] | 3520 | * util/Makefile.am (install-data-hook, install-exec-hook): Apply |
| 3521 | transform to source and destination of both manpage and program |
| 3522 | symlinks. |
| 3523 | * compat/sysv/Makefile.am (install-data-hook, install-exec-hook): |
| 3524 | Likewise for the compatibility symlinks. |
| 3525 | |
Scott James Remnant | 9f09375 | 2007-10-20 02:16:39 +0100 | [diff] [blame] | 3526 | * TODO: Update. |
| 3527 | |
Scott James Remnant | 1518f6c | 2007-10-20 02:14:29 +0100 | [diff] [blame] | 3528 | * init/tests/test_process.c (test_spawn): Make the event a child |
| 3529 | of the operator so it doesn't get freed first. |
| 3530 | |
Scott James Remnant | 509f791 | 2007-10-20 02:06:23 +0100 | [diff] [blame] | 3531 | * init/job.c (job_instance): Increment an instances counter each |
| 3532 | time we spawn an instance. |
| 3533 | (job_change_state): Decrement the instances counter again. |
| 3534 | (job_detect_stalled): Drop the main loop function, since we perform |
| 3535 | active detection of stall now. |
| 3536 | * init/job.h: Update header. |
| 3537 | * init/tests/test_job.c (test_change_state): Check that we get the |
| 3538 | stalled event for the last instance. |
| 3539 | (test_detect_stalled): Drop the test. |
| 3540 | * init/main.c: Remove job_detect_stalled from the main loop. |
| 3541 | |
Scott James Remnant | 0af4324 | 2007-10-20 01:16:04 +0100 | [diff] [blame] | 3542 | * init/event.c (event_operator_destroy): Destructor for an |
| 3543 | EventOperator that unblocks and unreferences the event first. |
| 3544 | (event_operator_new): Set the operator. |
| 3545 | (event_operator_copy): Remove error handling since it's unnecessary |
| 3546 | with the destructor in place. |
| 3547 | * init/event.h: Add prototype. |
| 3548 | * init/tests/test_event.c (test_operator_destroy): Make sure it |
| 3549 | works properly. |
| 3550 | (test_operator_copy): Don't unblock or unref events before freeing |
| 3551 | them, since that's now taken care of when it's referenced. |
| 3552 | * init/job.c (job_new): Remove unnecessary error handling. |
| 3553 | * init/tests/test_job.c (test_run_process): Reference the event |
| 3554 | when setting it, otherwise we'll assert when we try to free it. |
| 3555 | * TODO: Update. |
| 3556 | |
Scott James Remnant | 2be7d58 | 2007-10-20 00:43:19 +0100 | [diff] [blame] | 3557 | * init/job.c (job_new): Drop the parent argument for consistency. |
| 3558 | (job_instance): Update call to job_new. |
| 3559 | * init/job.h: Update prototype. |
| 3560 | * init/tests/test_job.c (test_new): Adjust call, check the parent |
| 3561 | and make sure that start_on and stop_on are copied over properly. |
| 3562 | * TODO: Update. |
| 3563 | |
Scott James Remnant | e548bc7 | 2007-10-20 00:29:39 +0100 | [diff] [blame] | 3564 | * init/conf.c (conf_file_get): Split out the allocation code from here |
| 3565 | (conf_file_new): into this new function. |
| 3566 | * init/conf.h: Add prototype. |
| 3567 | * init/tests/test_conf.c (test_file_new): New tests. |
| 3568 | * TODO: Update. |
| 3569 | |
Scott James Remnant | d29da6f | 2007-10-20 00:08:52 +0100 | [diff] [blame] | 3570 | * init/job.c (job_change_state): Hardcode the next state when we |
| 3571 | catch a runaway job to be JOB_WAITING. |
| 3572 | (job_next_state): Change next state for JOB_STARTING when goal is |
| 3573 | JOB_STOP to be JOB_STOPPING for consistency with the others; otherwise |
| 3574 | if our goal is stopped during our starting event, we'll never emit |
| 3575 | a stopping event to match it. |
| 3576 | * init/tests/test_job.c (test_next_state): Update test case. |
| 3577 | * doc/states.dot: Adjust the state transitions. |
| 3578 | * doc/states.png: Regenerate. |
| 3579 | * TODO: Update. |
| 3580 | |
Scott James Remnant | 493f5cd | 2007-10-19 22:49:09 +0100 | [diff] [blame] | 3581 | 2007-10-19 Scott James Remnant <scott@netsplit.com> |
| 3582 | |
| 3583 | Dealing with instances has always been tricky since they're copies |
| 3584 | that exist in the hash table; this patch changes that so the job's |
| 3585 | configuration is separated from its state. The only difference |
| 3586 | between instance and non-instance jobs now is that non-instance |
| 3587 | jobs only ever have one entry in their instances list. |
| 3588 | |
| 3589 | * init/job.h (Job): Separate out the members that come from the |
| 3590 | configuration into a new JobConfig structure which can be shared |
| 3591 | amongst all of the instances; this means we can drop instance_of. |
| 3592 | (JobConfig): Add instances list. |
| 3593 | (JobProcess): Remove pid member, replaced by pid list in Job. |
| 3594 | Update prototypes of functions to match. |
| 3595 | * init/job.c (job_new): Split off initialisation of configuration |
| 3596 | pieces into new job_config_new function leaving the state here; |
| 3597 | copy the start_on and stop_on members from JobConfig |
| 3598 | (job_copy): Drop this function, we don't need to copy jobs now. |
| 3599 | (job_name): Rename to job_config_name. |
| 3600 | (job_init): Set key function to job_config_name. |
| 3601 | (job_process_new): Drop initialisation of pid. |
| 3602 | (job_process_copy): Drop this function entirely, we don't need it. |
| 3603 | (job_find_by_name): Rename to job_config_find_by_name; massively |
| 3604 | simplify now we won't find instances or deleted jobs in the list. |
| 3605 | (job_should_replace): Rename to job_config_should_replace; simplify |
| 3606 | now that we can do a simple check to see whether a job exists or not |
| 3607 | (job_find_by_pid, job_find_by_id): Loop through the instances after |
| 3608 | looping through the hash table. |
| 3609 | (job_instance): Simplify, now all it needs to do is call job_new() |
| 3610 | if there isn't anything in the instances list, or it's multi-instance. |
| 3611 | (job_change_goal): Document that job should not be used on return. |
| 3612 | No need to check for instance jobs anymore. Place the job id in |
| 3613 | the output. |
| 3614 | (job_change_state): Document that job should not be used on return. |
| 3615 | Place the job id in the output. Check for information in the job's |
| 3616 | config. Merge the waiting and deleted states, so that a job instance |
| 3617 | is automatically deleted when it finishes. |
| 3618 | (job_next_state): Assert that we never call job_next_state when |
| 3619 | in JOB_WAITING since there's no possible next state. Check config |
| 3620 | for whether a main process exists. |
| 3621 | (job_emit_event): Obtain config-replaced pieces from the job's config |
| 3622 | (job_run_process): Obtain process information from the job's config |
| 3623 | but store the pid in the Job. Put job id in the output. |
| 3624 | (job_kill_process, job_kill_timer): We don't need to obtain the |
| 3625 | JobProcess just the pid from the job. Put job id in the output. |
| 3626 | (job_child_reaper): Put job id in the output. Check job config. |
| 3627 | (job_handle_event): Iterate job instances and process their stop_on |
| 3628 | operators, but process the start_on from the job configs. |
| 3629 | (job_handle_event_finished): Loop through the instances too. |
| 3630 | (job_detect_stalled): Check start_on from the config and just |
| 3631 | check whether there are any instances in the list. |
| 3632 | (job_free_deleted): No deleted state, so drop this function. |
| 3633 | * init/tests/test_job.c (test_new): Split into test_new and |
| 3634 | new test_config_new function. Create JobConfig object and spawn |
| 3635 | Job instances from that. |
| 3636 | (test_copy): Drop the tests. |
| 3637 | (test_process_new): Drop check of pid. |
| 3638 | (test_process_copy): Drop test. |
| 3639 | (test_find_by_name): Rename to test_config_find_by_name. |
| 3640 | (test_should_replace): Rename to test_config_should_replace. |
| 3641 | (test_instance): Create JobConfig object, and adjust tests to ensure |
| 3642 | that we always get a Job object. |
| 3643 | (test_find_by_pid, test_find_by_id, test_change_goal): Create |
| 3644 | JobConfig object and spawn Job instances from that. |
| 3645 | (test_change_state): Create JobConfig object and spawn Job |
| 3646 | instances from that. Adjust tests that previously checked for |
| 3647 | JOB_WAITING to check for job being freed. Drop checks for JOB_DELETED. |
| 3648 | (test_next_state): Create JobConfig object and spawn Job instances |
| 3649 | from that. Drop JOB_DELETED and JOB_WAITING checks. |
| 3650 | (test_run_process, test_kill_process, test_child_reaper) |
| 3651 | (test_handle_event, test_detect_stalled): Create JobConfig object |
| 3652 | and spawn Job instances from that. |
| 3653 | (test_free_deleted): Drop. |
| 3654 | * init/main.c: Don't add job_free_deleted to the main loop. |
| 3655 | * init/enum.h (JobState): Drop JOB_DELETED. |
| 3656 | * init/enum.c (job_state_name, job_state_from_name): Drop JOB_DELETED. |
| 3657 | * init/tests/test_enum.c (test_state_name, test_state_from_name): |
| 3658 | Drop tests that use the JOB_DELETED value. |
| 3659 | * init/process.c (process_spawn, process_setup_limits) |
| 3660 | (process_setup_environment, process_setup_console): Get details |
| 3661 | from the job config. Put job id in the output. |
| 3662 | * init/tests/test_process.c (test_spawn, test_kill): Create |
| 3663 | a JobConfig object and make Job instances from that. |
| 3664 | * init/tests/test_event.c (test_poll): Create a JobConfig object |
| 3665 | and make Job instances from that. |
| 3666 | (test_operator_copy): Set pointers to NULL to avoid gcc complaining. |
| 3667 | * init/conf.h (ConfItem): Make the type for a job be JobConfig. |
| 3668 | * init/conf.c (conf_item_destroy): Don't attempt to replace the |
| 3669 | new middle-man target, if it was due to be replaced it would have |
| 3670 | already been. If we can replace the config, ensure nothing points |
| 3671 | at it and then free it, rather than kicking state. |
| 3672 | * init/tests/test_conf.c (test_source_reload_job_dir) |
| 3673 | (test_source_reload_conf_dir, test_source_reload_file) |
| 3674 | (test_source_reload, test_item_destroy): Call job_config_new to |
| 3675 | create JobConfig objects, track when they are freed rather than |
| 3676 | marked in the deleted state. Create instances with job_instance, |
| 3677 | and fetch from the instances list. Expect the job to be freed |
| 3678 | with the item. |
| 3679 | * init/tests/test_parse_conf.c (test_parse_conf) |
| 3680 | (test_stanza_job): Change expected type from Job to JobConfig. |
| 3681 | * init/parse_job.c: Update prototypes of all functions to refer to |
| 3682 | JobConfig instead of Job. |
| 3683 | (parse_job): If the old job already has a replacement, remove the |
| 3684 | replacement from the hash table -- but don't free it because it's |
| 3685 | linked by a ConfItem -- this is temporary. Likewise for when we |
| 3686 | replace the old job. |
| 3687 | * init/parse_job.h: Update prototype. |
| 3688 | * init/tests/test_parse_job.c: Update all functions to use JobConfig |
| 3689 | instead of Job. |
| 3690 | (test_parse_job): Create an instance. |
| 3691 | * doc/states.dot: Remove the deleted state. |
| 3692 | * doc/states.png: Regenerate. |
| 3693 | * TODO: Update with notes from the conversion. |
| 3694 | |
Scott James Remnant | f9ec829 | 2007-10-16 00:08:33 +0100 | [diff] [blame] | 3695 | 2007-10-16 Scott James Remnant <scott@netsplit.com> |
| 3696 | |
| 3697 | Update to catch up with changes in libnih that make code a little |
| 3698 | bit easier to follow (we hope). |
| 3699 | |
| 3700 | * init/tests/test_process.c (test_spawn, test_kill): Replace calls |
| 3701 | to nih_list_free() with nih_free() |
| 3702 | * init/event.c (event_poll): Replace nih_list_free with nih_free |
| 3703 | since the former function has gone from libnih. |
| 3704 | (event_new): Adjust setting of the destructor. |
| 3705 | (event_operator_new): Set destructor for the tree node. |
| 3706 | * init/tests/test_event.c (test_new, test_find_by_id, test_ref) |
| 3707 | (test_unref, test_block, test_unblock, test_poll) |
| 3708 | (test_operator_match): Replace nih_list_free with nih_free. |
| 3709 | (test_poll): Use TEST_FREE_TAG and TEST_FREE rather than abusing |
| 3710 | destructors. |
| 3711 | * init/job.c (job_new): Set destructor to nih_list_destroy. |
| 3712 | (job_copy, job_free_deleted): Use nih_free instead of nih_list_free |
| 3713 | * init/tests/test_job.c (test_new, test_copy, test_find_by_name) |
| 3714 | (test_find_by_pid, test_find_by_id, test_instance) |
| 3715 | (test_change_goal, test_change_state, test_next_state) |
| 3716 | (test_should_replace, test_run_process, test_kill_process) |
| 3717 | (test_child_reaper, test_handle_event) |
| 3718 | (test_handle_event_finished, test_detect_stalled) |
| 3719 | (test_free_deleted): Replace all uses of nih_list_free with nih_free |
| 3720 | (test_child_reaper, test_free_deleted): Replace destructor abuse |
| 3721 | with TEST_FREE, etc. |
| 3722 | * init/conf.c (conf_reload_path): Use nih_free instead of nih_list_free |
| 3723 | (conf_source_new, conf_file_get, conf_item_new): Set destructor |
| 3724 | (conf_source_reload, conf_delete_handler): Use nih_free not the |
| 3725 | custom conf_file_free() function. |
| 3726 | (conf_reload_path): Use nih_free not the custom conf_item_free() |
| 3727 | function. |
| 3728 | (conf_delete_handler): Use nih_free not nih_watch_free() |
| 3729 | (conf_source_free, conf_file_free): Drop these functions, since |
| 3730 | all the free chaining happens properly with destructors. |
| 3731 | (conf_item_free): Rename to conf_item_destroy and turn into destructor |
| 3732 | * init/conf.h: Update prototypes. |
| 3733 | * init/tests/test_conf.c (test_source_new, test_file_get) |
| 3734 | (test_item_new, test_source_reload_job_dir) |
| 3735 | (test_source_reload_conf_dir, test_source_reload_file) |
| 3736 | (test_item_free): Replace nih_list_free calls with nih_free |
| 3737 | (test_source_reload_job_dir, test_source_reload_conf_dir) |
| 3738 | (test_source_reload_file, test_source_reload, test_item_free): Replace |
| 3739 | calls to conf_source_free with nih_free |
| 3740 | (test_source_free, test_file_free): Drop functions. |
| 3741 | (test_item_free): Rename to test_item_destroy |
| 3742 | (test_item_new): Assign a job before freeing, otherwise the destroy |
| 3743 | function will foul up as it expects one. |
| 3744 | * init/parse_conf.c (stanza_job): Replace nih_list_free with nih_free |
| 3745 | * init/tests/test_parse_conf.c (test_parse_conf) |
| 3746 | (test_stanza_job): Replace conf_source_free() with nih_free() |
| 3747 | (test_parse_conf, test_stanza_job): Replace conf_item_free() |
| 3748 | with nih_free() |
| 3749 | * init/parse_job.c (parse_job, parse_on_paren, parse_on_collect): |
| 3750 | Replace nih_list_free with nih_free |
| 3751 | (parse_on): always cut out the stack head before returning (it won't |
| 3752 | be empty on error) otherwise we end up with a bunch of list entries |
| 3753 | pointing to it -- and it's way out of scope when we try and free them |
| 3754 | (parse_on_operator, parse_on_operand): Use the job as the context |
| 3755 | not the operator for consistency of freeing. |
| 3756 | * init/tests/test_parse_job.c: Replace all instances of nih_list_free |
| 3757 | with nih_free (too many functions to list). |
| 3758 | |
Scott James Remnant | 5d6466d | 2007-10-15 01:40:52 +0100 | [diff] [blame] | 3759 | 2007-10-15 Scott James Remnant <scott@netsplit.com> |
| 3760 | |
Scott James Remnant | 3e32e08 | 2007-10-16 00:08:24 +0100 | [diff] [blame] | 3761 | Strip out all of the IPC code, removing it and consigning it to the |
| 3762 | great revision control history in the sky. We're going to switch |
| 3763 | from home-brew to D-BUS. so all this is somewhat obsolete. Rather |
| 3764 | than maintain this while we carry on developing, we'll strip it out |
| 3765 | now and put the D-BUS code in ater once the rest of the core changes |
| 3766 | are done (otherwise we'd just be dragging those through maintenance |
| 3767 | too). |
| 3768 | |
| 3769 | * Makefile.am (SUBDIRS): Remove the upstart sub-directory entirely; |
| 3770 | comment out util, compat/sysv & logd since we'll fix them up later |
| 3771 | * configure.ac (AC_CONFIG_FILES): Remove from here too. |
| 3772 | * upstart/enum.c, upstart/enum.h, upstart/tests/test_enum.c: Move |
| 3773 | these files into the init/ sub-directory; strictly speaking we'll |
| 3774 | probably need to share them again later in some way, but for now |
| 3775 | they can live with the rest of the daemon code. |
| 3776 | * upstart/: Delete. |
| 3777 | * init/Makefile.am (init_SOURCES): Remove control.c, control.h, |
| 3778 | notify.c and notify.h; add enum.c and enum.h |
| 3779 | (TESTS): Remove test_control and test_notify; add test_enum |
| 3780 | (test_control_SOURCES, test_control_LDFLAGS, test_control_LDADD) |
| 3781 | (test_notify_SOURCES, test_notify_LDADD): Remove. |
| 3782 | (test_enum_SOURCES, test_enum_LDFLAGS, test_enum_LDADD): Add details |
| 3783 | (init_LDADD): Remove libupstart |
| 3784 | (test_process_LDADD, test_job_LDADD, test_event_LDADD) |
| 3785 | (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD): Remove |
| 3786 | libupstart, control.o and notify.o; add enum.o |
| 3787 | * init/control.c, init/control.h, init/tests/test_control.c: Delete |
| 3788 | * init/notify.c, init/notify.h, init/tests/test_notify.c: Delete |
| 3789 | * init/enum.c, init/job.c, init/job.h: Update include path for enum.h |
| 3790 | * init/parse_job.c: Remove unnecessary enum.h include |
| 3791 | * init/tests/test_enum.c: Update to reflect where it is. |
| 3792 | * init/main.c (main): Drop control socket opening. |
| 3793 | * init/tests/test_job.c: Remove unnecessary control.h include |
| 3794 | * init/event.c (event_pending, event_finished): Remove calls to |
| 3795 | notify_event and notify_event_finished |
| 3796 | * init/job.c (job_change_goal, job_change_state): Remove calls |
| 3797 | to notify_job. |
| 3798 | * init/tests/test_parse_conf.c: Remove calls to notify_init |
| 3799 | * init/tests/test_parse_job.c: Remove calls to notify_init |
| 3800 | * init/tests/test_event.c (test_poll): Strip out the part of the |
| 3801 | test that checks processes are notified. |
| 3802 | (check_event, check_event_finished): Remove. |
| 3803 | |
Scott James Remnant | a86d398 | 2007-10-15 17:55:09 +0100 | [diff] [blame] | 3804 | * configure.ac: Bump Autoconf dependency to 2.61 to match libnih |
| 3805 | * HACKING: Bump dependency in docs too. |
| 3806 | |
Scott James Remnant | 5d6466d | 2007-10-15 01:40:52 +0100 | [diff] [blame] | 3807 | * NEWS: Copy in news from 0.3.9; that release doesn't appear in |
| 3808 | this ChangeLog since it was made on a separate branch by backporting |
| 3809 | bug fixes made here. |
| 3810 | * configure.ac: Bump version to 0.5.0, which is where development |
| 3811 | is heading for. |
| 3812 | |
Scott James Remnant | 56d2d82 | 2007-10-12 18:06:21 +0100 | [diff] [blame] | 3813 | 2007-10-12 Scott James Remnant <scott@netsplit.com> |
| 3814 | |
| 3815 | * HACKING: Change URL for libnih. |
| 3816 | |
Scott James Remnant | 0c3bef3 | 2007-10-08 13:20:56 +0100 | [diff] [blame] | 3817 | 2007-10-08 Scott James Remnant <scott@netsplit.com> |
| 3818 | |
Scott James Remnant | e16d32c | 2007-10-08 13:37:44 +0100 | [diff] [blame] | 3819 | * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.16.1 since this |
| 3820 | version of gettext is needed for compatibility with Automake 1.10 |
| 3821 | * HACKING: Bump version in the docs too. |
| 3822 | |
Scott James Remnant | e647836 | 2007-10-08 13:21:51 +0100 | [diff] [blame] | 3823 | * compat/sysv/Makefile.am: Only create symlinks if COMPAT_SYSV is |
| 3824 | enabled, otherwise we leave dangling ones. |
| 3825 | |
Scott James Remnant | 0c3bef3 | 2007-10-08 13:20:56 +0100 | [diff] [blame] | 3826 | * Makefile.am (ACLOCAL_AMFLAGS): Specify that aclocal install |
| 3827 | ordinarily system-wide macros into m4 (libtool.m4, specifically). |
| 3828 | This makes it easier for packagers to modify autoconfery since |
| 3829 | aclocal is no longer a destructive event. |
| 3830 | * configure.ac (AM_INIT_AUTOMAKE): Increase Automake requirement to |
| 3831 | 1.10 to ensure we have aclocal --instal |
| 3832 | * HACKING: Increase Automake version in the docs. |
| 3833 | |
Scott James Remnant | 52ada04 | 2007-09-21 15:59:12 +0100 | [diff] [blame] | 3834 | 2007-09-21 Scott James Remnant <scott@netsplit.com> |
| 3835 | |
| 3836 | * init/job.c (job_detect_stalled, job_free_deleted): Call job_init() |
| 3837 | on entry, since we don't have a Job pointer passed to us, we need |
| 3838 | to make sure we don't dereference a potentially NULL list. |
| 3839 | |
Scott James Remnant | 65e21ac | 2007-06-22 12:48:14 +0100 | [diff] [blame] | 3840 | 2007-06-22 Scott James Remnant <scott@netsplit.com> |
| 3841 | |
Scott James Remnant | 1e2e0b3 | 2007-06-22 16:59:29 +0100 | [diff] [blame] | 3842 | * TODO: Update. |
| 3843 | |
Scott James Remnant | 3a807ca | 2007-06-22 16:53:35 +0100 | [diff] [blame] | 3844 | * init/job.h: Update prototype of job_change_goal. |
| 3845 | (Job): Remove cause member. |
| 3846 | * init/job.c (job_change_goal): Drop additional argument since cause |
| 3847 | is no longer used. |
| 3848 | (job_change_state, job_child_reaper, job_handle_event): Only pass |
| 3849 | two arguments to job_change_goal. |
| 3850 | * init/control.c (control_job_start, control_job_stop): Only pass |
| 3851 | two argumenst to job_change_goal. |
| 3852 | * init/tests/test_job.c (test_change_goal, test_change_state): Only |
| 3853 | pass two arguments to job_change_goal. |
| 3854 | |
Scott James Remnant | 134e059 | 2007-06-22 16:51:02 +0100 | [diff] [blame] | 3855 | * init/job.c (job_new): Drop setting of cause. |
| 3856 | (job_change_cause): Drop this function entirely. |
| 3857 | (job_change_goal, job_change_state): Drop calls to job_change_cause |
| 3858 | (job_change_state, job_child_reaper): Don't pass job->cause to |
| 3859 | job_change_goal calls. |
| 3860 | |
| 3861 | * init/tests/test_job.c: Remove all tests that checked the value of |
| 3862 | job->cause, since that variable is going away. |
| 3863 | (test_change_goal): Remove the specific tests that checked whether |
| 3864 | cause was updated or not. |
| 3865 | |
Scott James Remnant | 108152d | 2007-06-22 16:43:07 +0100 | [diff] [blame] | 3866 | * init/job.c (job_run_process): Replace the arguments from the event |
| 3867 | with a list of event names. |
| 3868 | * init/tests/test_job.c (test_run_process): Update test case to |
| 3869 | supply arguments from the list of events. |
| 3870 | |
Scott James Remnant | bc68399 | 2007-06-22 16:37:10 +0100 | [diff] [blame] | 3871 | * init/process.c (process_setup_environment): Drop the UPSTART_EVENT |
| 3872 | environment variable; it doesn't make sense when you can have multiple |
| 3873 | events. |
| 3874 | (process_setup_environment): Put all variables from the job's start |
| 3875 | events into the job's environment; replacing the UPSTART_EVENT variable |
| 3876 | |
Scott James Remnant | 47f5a76 | 2007-06-22 15:57:26 +0100 | [diff] [blame] | 3877 | * init/job.c (job_change_cause): Don't notify the job event |
| 3878 | subscribers when changing the cause. |
| 3879 | * init/notify.c (notify_job_finished): Instead notify them when |
| 3880 | the job reaches a rest state. |
| 3881 | |
Scott James Remnant | fed4f26 | 2007-06-22 15:50:51 +0100 | [diff] [blame] | 3882 | * init/notify.c (notify_job): Call notify_job_event regardless, |
| 3883 | since this now looks over the start_on and stop_on fields. |
| 3884 | (notify_job_event): Rewrite to iterate over start_on and stop_on, |
| 3885 | and notifying for each cause event found. |
| 3886 | (notify_job_event_caused): Static function that is the guts of the |
| 3887 | above function. |
| 3888 | * init/tests/test_notify.c (test_job, test_job_event): Modify tests |
| 3889 | to refer exclusively to the start_on/stop_on expressions rather than |
| 3890 | the cause. |
| 3891 | |
Scott James Remnant | e379ab9 | 2007-06-22 15:35:42 +0100 | [diff] [blame] | 3892 | * init/job.c (job_change_cause): Only notify the job event and |
| 3893 | update the cause member, we don't need to ref or block it anymore |
| 3894 | since that's handled by start_on and stop_on. |
| 3895 | * init/tests/test_job.c (test_change_goal): Drop checks on cause |
| 3896 | being referenced and blocked. |
| 3897 | (test_change_state, test_child_reaper, test_handle_event): Update |
| 3898 | test cases to not reference ->cause, and not count any references |
| 3899 | or blockers towards it. |
| 3900 | * init/tests/test_event.c (test_poll): Update expected reference |
| 3901 | and block counts for events handled by jobs. |
| 3902 | |
Scott James Remnant | 0621864 | 2007-06-22 15:15:56 +0100 | [diff] [blame] | 3903 | * init/tests/test_process.c (test_kill): Make sure that all processes |
| 3904 | in the process group are killed, rather than just the lone one. |
| 3905 | * init/process.c (process_kill): Send the signal to all processes |
| 3906 | in the same process group as the pid. |
| 3907 | * init/tests/test_job.c (test_change_state, test_kill_process): |
| 3908 | After spawning a child, call setpgid() to put it in its own process |
| 3909 | group otherwise we could end up TERMing ourselves. |
| 3910 | |
Scott James Remnant | e84eb01 | 2007-06-22 13:42:14 +0100 | [diff] [blame] | 3911 | * init/tests/test_job.c (test_child_reaper): Update test cases to |
| 3912 | include checking of the start_on and stop_on expression trees. |
| 3913 | * init/job.c (job_child_reaper): Mark all blocked events in the |
| 3914 | start_on and stop_on trees as failed; since these are copies of |
| 3915 | the cause event, we can drop that setting already. |
| 3916 | |
Scott James Remnant | 65e21ac | 2007-06-22 12:48:14 +0100 | [diff] [blame] | 3917 | * TODO: Update again, still thinking about the atomicity of event |
| 3918 | expressions. |
| 3919 | |
Scott James Remnant | e332fa9 | 2007-06-21 15:35:53 +0100 | [diff] [blame] | 3920 | 2007-06-21 Scott James Remnant <scott@netsplit.com> |
| 3921 | |
Scott James Remnant | b455639 | 2007-06-21 18:38:20 +0100 | [diff] [blame] | 3922 | * init/tests/test_job.c (test_change_state): Include tests on a job's |
| 3923 | start_on and stop_on event expression trees, and make sure that events |
| 3924 | are unblocked and unreferenced at the appropriate moments. |
| 3925 | * init/job.c (job_change_state): Unblock the events that started the |
| 3926 | job in running (if a service), and reset when we reach waiting (leave |
| 3927 | referenced otherwise so the environment is always present). |
| 3928 | Unblock and unreference the events that stopped the job in |
| 3929 | starting (for restarting), running (if coming from pre-stop) and |
| 3930 | waiting. |
| 3931 | |
Scott James Remnant | 7e198e4 | 2007-06-21 17:02:12 +0100 | [diff] [blame] | 3932 | * init/tests/test_job.c (test_handle_event): Rewrite tests using |
| 3933 | event expressions, and make sure events are referenced and blocked |
| 3934 | correctly matching how jobs are affected. Include tests for correct |
| 3935 | instance behaviour. |
| 3936 | (test_instance): Make sure that instances copy across the expression |
| 3937 | state, and reset the parent. |
| 3938 | * init/job.c (job_instance): After spawning a new instance, reset |
| 3939 | the start_on expression of the master job. |
| 3940 | |
Scott James Remnant | 625c8d0 | 2007-06-21 16:28:43 +0100 | [diff] [blame] | 3941 | * init/event.c (event_operator_copy): Change to making the parent |
| 3942 | of copies nodes be the actual tree parent, rather than the top |
| 3943 | parent; otherwise you can't free an entire tree in one go. |
| 3944 | * init/tests/test_event.c (test_operator_copy): Check parents of |
| 3945 | copied nodes. |
| 3946 | * init/tests/test_job.c (test_copy): Update parent checks here too. |
| 3947 | |
Scott James Remnant | e332fa9 | 2007-06-21 15:35:53 +0100 | [diff] [blame] | 3948 | * init/tests/test_job.c (test_copy): Make sure that the job copy |
| 3949 | references and blocks the event; and in the event of failure, doesn't |
| 3950 | * init/job.c (job_copy): Reset the start_on and stop_on expressions |
| 3951 | in the event of failure. |
| 3952 | |
Scott James Remnant | e7b6cd6 | 2007-06-20 22:17:09 +0100 | [diff] [blame] | 3953 | 2007-06-20 Scott James Remnant <scott@netsplit.com> |
| 3954 | |
Scott James Remnant | 9b1d520 | 2007-06-20 23:26:37 +0100 | [diff] [blame] | 3955 | * TODO: Update. |
| 3956 | |
Scott James Remnant | ce628ca | 2007-06-20 23:25:02 +0100 | [diff] [blame] | 3957 | * init/parse_job.c (parse_on): New generic parsing function to deal |
| 3958 | with event expressions, including operators, parentheses, etc. |
| 3959 | (parse_on_operator): Function called by parse_on() to deal with an |
| 3960 | operator or operand. |
| 3961 | (parse_on_paren): Function called by parse_on() to deal with a |
| 3962 | parenthesis. |
| 3963 | (parse_on_operand): Function called by parse_on_operator() to deal |
| 3964 | with a non-operator token. |
| 3965 | (parse_on_collect): Function called by all of the above to collect |
| 3966 | the operators on the stack and deposit them into the output box, |
| 3967 | either for collection by a later operator or for returning from |
| 3968 | parse_on(). |
| 3969 | (stanza_start, stanza_stop): Call the new parse_on() function to |
| 3970 | deal with "start on" and "stop on", storing it in the appropriate |
| 3971 | part of the job. |
| 3972 | * init/tests/test_parse_job.c (test_parse_job): Replace list empty |
| 3973 | checks for start_events/stop_events with NULL checks on the new |
| 3974 | start_on/stop_on members. |
| 3975 | (test_stanza_start, test_stanza_stop): Test new stanza code. |
| 3976 | |
| 3977 | * init/errors.h (PARSE_EXPECTED_EVENT, PARSE_EXPECTED_OPERATOR) |
| 3978 | (PARSE_MISMATCHED_PARENS): Add numerics and strings for the errors |
| 3979 | that can be generated by parsing an event expression. |
| 3980 | * init/conf.c (conf_reload_path): Handle the new errors properly, |
| 3981 | including the line number where they occurred. |
| 3982 | * logd/jobs.d/logd.in: Update "stop on" to work with the new parser. |
| 3983 | |
Scott James Remnant | 404f99c | 2007-06-20 22:18:39 +0100 | [diff] [blame] | 3984 | * init/parse_job.c (stanza_emits): Each entry in the emits list |
| 3985 | is now an NihListEntry with the event name as the string data |
| 3986 | pointer, rather than an EventInfo structure (since that structure |
| 3987 | is gone). |
| 3988 | * init/tests/test_parse_job.c (test_stanza_emits): Update test |
| 3989 | case to check for NihListEntry structures. |
| 3990 | |
Scott James Remnant | e7b6cd6 | 2007-06-20 22:17:09 +0100 | [diff] [blame] | 3991 | * init/parse_job.c: Where the stanza function parses an argument and |
| 3992 | can possibly reject it, save the position and line number and do not |
| 3993 | return that unless we're happy with the argument. This ensures errors |
| 3994 | are raised pointing *at* the argument, rather than past it. |
| 3995 | * init/tests/test_parse_job.c: Fix several test case errors where |
| 3996 | the buffer was built incorrectly. Pedantically check pos and lineno |
| 3997 | after successful parsing, and after errors, to make sure they are |
| 3998 | where they should be. |
| 3999 | |
Scott James Remnant | 77e9d34 | 2007-06-18 12:59:22 +0100 | [diff] [blame] | 4000 | 2007-06-18 Scott James Remnant <scott@netsplit.com> |
| 4001 | |
Scott James Remnant | c8ca88e | 2007-06-18 15:18:02 +0100 | [diff] [blame] | 4002 | * init/job.h (Job): Replace the start_events and stop_events NihLists |
| 4003 | with start_on and stop_on EventOperators. |
| 4004 | * init/job.c (job_new): Drop list initialising, and instead just set |
| 4005 | the new start_on/stop_on members to NULL. |
| 4006 | (job_copy): Copy the entire event operator tree to the new job, |
| 4007 | including references and blockers. emits has changed to a list of |
| 4008 | NihListEntry with embedded strings, so copy them that way. |
| 4009 | (job_run_process): Drop "->info." |
| 4010 | (job_handle_event): Instead of iterating the events lists, call |
| 4011 | event_operator_handle and check the return value and top node value. |
| 4012 | (job_detect_stalled): Modify to iterate the start_on tree. |
| 4013 | * init/tests/test_job.c (test_change_state, test_detect_stalled): |
| 4014 | Drop references to "->info." since we can get the variables directly. |
| 4015 | (test_new): Check that start_on and stop_on are NULL. |
| 4016 | (test_copy): Adjust tests of copying start_on and stop_on trees as |
| 4017 | well as the emits list. |
| 4018 | (test_handle_event, test_handle_event_finished) |
| 4019 | (test_detect_stalled): Change references from start_events to start_on, |
| 4020 | stop_events to stop_on and construct using EventOperators instead. |
| 4021 | (test_handle_event): Update number of blockers now that the event |
| 4022 | expressions themselves will block the event. |
| 4023 | * init/tests/test_event.c (test_poll): Update number of blockers since |
| 4024 | both the events and cause will block it for now; also change |
| 4025 | start_events and stop_events to start_on and stop_on respectively. |
| 4026 | |
Scott James Remnant | 210d6fa | 2007-06-18 15:12:29 +0100 | [diff] [blame] | 4027 | * init/event.c (event_operator_copy): Copy the children nodes as well. |
| 4028 | * init/tests/test_event.c (test_operator_copy): Test copying |
| 4029 | with children nodes. |
| 4030 | |
Scott James Remnant | 77e7a38 | 2007-06-18 14:10:39 +0100 | [diff] [blame] | 4031 | * init/tests/test_control.c (test_event_emit): Drop "->info." |
| 4032 | |
Scott James Remnant | 5b27f0b | 2007-06-18 14:09:49 +0100 | [diff] [blame] | 4033 | * init/notify.c (notify_event, notify_event_finished): Drop |
| 4034 | "->info." from event references. |
| 4035 | |
Scott James Remnant | 61b7ae8 | 2007-06-18 14:05:00 +0100 | [diff] [blame] | 4036 | * init/process.c (process_setup_environment): Drop "->info." from |
| 4037 | cause references |
| 4038 | * init/tests/test_process.c (test_spawn): Likewise. |
| 4039 | |
Scott James Remnant | 77e9d34 | 2007-06-18 12:59:22 +0100 | [diff] [blame] | 4040 | * init/event.h (Event): Directly include the name, args and env |
| 4041 | fields rather than using an interim structure; this makes more sense |
| 4042 | since we use them differently than a match does. |
| 4043 | (EventOperatorType, EventOperator): New structure to build event |
| 4044 | expression trees that combine a match with "or" and "and" boolean |
| 4045 | operators; solve some problems by holding the reference and blocker |
| 4046 | on the matched event inside this structure directly and provide |
| 4047 | methods to unblock and reset them. |
| 4048 | (EventInfo): Drop this structure completely now that it is unused. |
| 4049 | * init/event.c (event_info_new): Rename this structure to |
| 4050 | event_operator_new() and initialise the new fields properly. |
| 4051 | (event_info_copy): Likewise rename to event_operator_copy and deal |
| 4052 | with copying event references and blockers over to the new structure, |
| 4053 | since the state is useful to copy. |
| 4054 | (event_match): Rename to event_operator_match and switch the arguments |
| 4055 | around since it makes slightly more sense that way. |
| 4056 | (event_operator_update): Function to update the value of an EVENT_OR |
| 4057 | or EVENT_AND operator based on the value of the two children. |
| 4058 | (event_operator_handle): Function to iterate an entire expression |
| 4059 | tree looking for a given event, and update the values of other |
| 4060 | operators if matched. |
| 4061 | (event_operator_unblock): Function to iterate an expression tree |
| 4062 | and release any events we're blocking. |
| 4063 | (event_operator_reset): Function to iterate an expression tree, |
| 4064 | unreferencing any events and resetting all values back to FALSE. |
| 4065 | (event_new, event_pending, event_finished): Update references to |
| 4066 | the Event structure to discard the intermediate "->info." |
| 4067 | * init/tests/test_event.c (test_info_new): Rename to |
| 4068 | test_operator_new() and test various features of the function added |
| 4069 | in the converstion. |
| 4070 | (test_info_copy): Likewise rename to test_operator_copy() and add a |
| 4071 | few more tests, especially that blockers and references are copied. |
| 4072 | (test_match): Rename to test_operator_match() and adjust argument |
| 4073 | order to match the change. |
| 4074 | (test_new) Call event_init() to avoid a valgrind error and update |
| 4075 | references to drop "->info." |
| 4076 | (test_poll): Use EventOperators in the job to test event polling, |
| 4077 | rather than the old structures. |
| 4078 | (test_operator_update, test_operator_handle, test_operator_unblock) |
| 4079 | (test_operator_reset): Test behaviour of the new functions. |
| 4080 | |
Scott James Remnant | f050aa6 | 2007-06-13 12:37:16 +0100 | [diff] [blame] | 4081 | 2007-06-13 Scott James Remnant <scott@netsplit.com> |
| 4082 | |
| 4083 | * TODO: Update utmp/wtmp thoughts. |
| 4084 | |
Scott James Remnant | f9aec8c | 2007-06-12 12:18:15 +0100 | [diff] [blame] | 4085 | 2007-06-12 Scott James Remnant <scott@netsplit.com> |
| 4086 | |
Scott James Remnant | dd9249d | 2007-06-12 15:30:19 +0100 | [diff] [blame] | 4087 | * init/paths.h: Remove extra /, oops. |
| 4088 | * init/Makefile.am (install-data-local): Make destination |
| 4089 | configuration directories as part of "make install". |
| 4090 | (AM_CPPFLAGS): Define LEGACY_CONFDIR to be $(sysconfdir)/event.d |
| 4091 | * logd/Makefile.am (jobs.d/logd): Replace mkdir_p with MKDIR_P |
| 4092 | * init/main.c: Use macro to pick up /etc/event.d so it can be moved |
| 4093 | by configure |
| 4094 | |
Scott James Remnant | dc6b5e4 | 2007-06-12 14:57:14 +0100 | [diff] [blame] | 4095 | * TODO: Update. |
| 4096 | |
Scott James Remnant | 0b3171a | 2007-06-12 14:55:58 +0100 | [diff] [blame] | 4097 | * init/Makefile.am (AM_CPPFLAGS): Define CONFDIR to be |
| 4098 | $(sysconfdir)/init, replacing the old CFG_DIR definition. |
| 4099 | * init/paths.h (CFG_DIR): Replace with CONFDIR definition, |
| 4100 | and set the default to /etc/init |
| 4101 | * init/main.c: Load configuration from /etc/init/init.conf, |
| 4102 | /etc/init/conf.d and /etc/init/jobs.d; retain loading from /etc/event.d |
| 4103 | for the time being. |
| 4104 | * init/man/init.8: Change reference to directory. |
| 4105 | * logd/Makefile.am: Replace references of eventdir with jobsdir, |
| 4106 | and event.d with jobs.d |
| 4107 | * logd/event.d: Rename to logd/jobs.d |
| 4108 | |
Scott James Remnant | 2b8a505 | 2007-06-12 14:49:16 +0100 | [diff] [blame] | 4109 | * init/conf.c (conf_reload): Ignore ENOENT, it's not interesting |
| 4110 | in the general case. |
| 4111 | |
Scott James Remnant | 018e356 | 2007-06-12 14:47:42 +0100 | [diff] [blame] | 4112 | * init/tests/test_conf.c (test_source_reload): Test the general |
| 4113 | reload function. |
| 4114 | |
Scott James Remnant | 0ca92cb | 2007-06-12 14:37:09 +0100 | [diff] [blame] | 4115 | * init/tests/test_conf.c (test_source_free): s/unlink/rmdir/ |
| 4116 | (test_source_reload_file): Test that configuration files work, and |
| 4117 | are parsed with anything alongside ignored automatically. |
| 4118 | * init/conf.c (conf_file_filter): As well as not filtering out the |
| 4119 | source path itself, we also need to not filter out the path we're |
| 4120 | watching which is different in the case of files; we need to know |
| 4121 | about it because we handle its removal. |
| 4122 | (conf_delete_handler): Compare the path deleted against the path |
| 4123 | we're watching, rather than the source path, since this means the |
| 4124 | watch needs to be freed. |
| 4125 | |
Scott James Remnant | f9aec8c | 2007-06-12 12:18:15 +0100 | [diff] [blame] | 4126 | * compat/sysv/shutdown.c: Use nih pidfile functions since they're |
| 4127 | more reliable than doing it ourselves. |
| 4128 | |
Scott James Remnant | 11b08b5 | 2007-06-11 12:00:40 +0100 | [diff] [blame] | 4129 | 2007-06-11 Scott James Remnant <scott@netsplit.com> |
| 4130 | |
Scott James Remnant | 7e6d3a9 | 2007-06-11 18:37:44 +0100 | [diff] [blame] | 4131 | * init/conf.c (conf_reload_path): Call parse_conf for mixed files |
| 4132 | and directories. Make a correction to the old_items code, was |
| 4133 | passing the wrong arguments to nih_list_add; the effect we wanted |
| 4134 | was that we add the old items head into the list, and remove the |
| 4135 | existing head (what we did was add the first item to the old_items |
| 4136 | list and then cut the rest out). |
| 4137 | * init/tests/test_conf.c (test_source_reload_dir): Rename to |
| 4138 | test_source_reload_job_dir, since that's what this does. |
| 4139 | (test_source_reload_conf_dir): Add another function that tests |
| 4140 | directories of mixed configuration. |
| 4141 | |
Scott James Remnant | c12704a | 2007-06-11 17:17:22 +0100 | [diff] [blame] | 4142 | * init/parse_conf.c (parse_conf): Parse a configuration file that |
| 4143 | defines jobs by name. |
| 4144 | (stanza_job): Job stanza, slightly trickier than it would appear to |
| 4145 | need to be, to parse the block in-place and keep pos/lineno |
| 4146 | consistent. |
| 4147 | * init/parse_conf.h: Prototype for external function. |
| 4148 | * init/tests/test_parse_conf.c: Test suite for mixed configuration |
| 4149 | parsing. |
| 4150 | * init/Makefile.am (init_SOURCES): Build and link parse_conf.c and |
| 4151 | parse_conf.h |
| 4152 | (TESTS): Build and run parse_conf tests |
| 4153 | (test_parse_conf_SOURCES, test_parse_conf_LDFLAGS) |
| 4154 | (test_parse_conf_LDADD): Details for parse_conf test suite. |
| 4155 | (test_conf_LDADD): Add parse_conf.o and conf.o since this calls |
| 4156 | them now. |
| 4157 | |
Scott James Remnant | c14ec86 | 2007-06-11 16:47:34 +0100 | [diff] [blame] | 4158 | * init/conf.c (conf_source_reload, conf_source_reload) |
| 4159 | (conf_reload_path): Add some debugging messages. |
| 4160 | |
Scott James Remnant | 142a322 | 2007-06-11 16:22:33 +0100 | [diff] [blame] | 4161 | * init/conf.c (conf_source_new): Add missing call to conf_init() |
| 4162 | |
Scott James Remnant | 11b08b5 | 2007-06-11 12:00:40 +0100 | [diff] [blame] | 4163 | * init/conf.c (conf_item_new): Drop source parameter, since it's |
| 4164 | unused in the function and makes it harder to call this when we |
| 4165 | only have one data pointer. |
| 4166 | (conf_reload_path): Drop source from conf_item_new() call. |
| 4167 | * init/conf.h: Update prototype. |
| 4168 | * init/tests/test_conf.c (test_item_new, test_item_free) |
| 4169 | (test_file_free): Drop source parameter from calls. |
| 4170 | |
Scott James Remnant | 56760be | 2007-06-10 14:23:53 +0100 | [diff] [blame] | 4171 | 2007-06-10 Scott James Remnant <scott@netsplit.com> |
| 4172 | |
Scott James Remnant | 7ba2cf6 | 2007-06-10 22:20:38 +0100 | [diff] [blame] | 4173 | * init/main.c (main): Add a handler for the SIGHUP signal |
| 4174 | (hup_handler): Handler for SIGHUP, just calls conf_reload(). |
| 4175 | |
Scott James Remnant | 54b2a95 | 2007-06-10 22:15:24 +0100 | [diff] [blame] | 4176 | * init/main.c (main): Read the configuration again. |
| 4177 | |
Scott James Remnant | d961948 | 2007-06-10 22:11:42 +0100 | [diff] [blame] | 4178 | * TODO: Update. |
| 4179 | |
Scott James Remnant | 4b32414 | 2007-06-10 22:08:40 +0100 | [diff] [blame] | 4180 | * init/tests/test_conf.c (test_source_reload_dir): Reset the priority |
| 4181 | and clean up consumed inotify instances. |
| 4182 | (test_source_free, test_file_free, test_item_free): Test the free |
| 4183 | functions on their own, paying special attention to conf_item_free() |
| 4184 | even though this really duplicates other tests. |
| 4185 | |
Scott James Remnant | 4561b26 | 2007-06-10 21:43:52 +0100 | [diff] [blame] | 4186 | * init/conf.c (conf_reload_path): In the case where we fail to map |
| 4187 | the file into memory, we still need to purge all the items that |
| 4188 | previously existed. |
| 4189 | * init/tests/test_conf.c (test_source_reload): Rename to |
| 4190 | test_source_reload_dir, so that we can keep this and the file |
| 4191 | tests separate to make it easier to deal with. |
| 4192 | (test_source_reload_dir): Add tests for physical and parse errors |
| 4193 | when re-loading jobs with and without inotify, and for inotify-based |
| 4194 | modification handling of jobs. |
| 4195 | |
Scott James Remnant | de27a55 | 2007-06-10 21:17:55 +0100 | [diff] [blame] | 4196 | * init/tests/test_conf.c (test_source_reload): Add test for walk |
| 4197 | of non-existant directory with and without inotify; also test for |
| 4198 | what happens when the top-level directory is deleted, again with |
| 4199 | and without inotify. |
| 4200 | * init/conf.c (conf_delete_handler): Handle the case of the top-level |
| 4201 | directory being deleted by freeing the watch (so next time we asked |
| 4202 | to reload, we can restore it). |
| 4203 | |
Scott James Remnant | 4ee170f | 2007-06-10 20:58:09 +0100 | [diff] [blame] | 4204 | * init/tests/test_conf.c (test_source_reload): Add a test for |
| 4205 | deletion of a running job. |
| 4206 | |
Scott James Remnant | cf52ef7 | 2007-06-10 20:55:41 +0100 | [diff] [blame] | 4207 | * init/conf.c (conf_item_free): Fix this up; when deleting an item |
| 4208 | from a source, we first mark it for deletion unless it's already |
| 4209 | marked for replacement. Then if it's the replacement for something |
| 4210 | else, we mark that to be replaced by whatever we're being replaced |
| 4211 | by (so there are no references to us) and change that state if |
| 4212 | necessary. Finally we replace our own item and free the record |
| 4213 | before returning. |
| 4214 | * init/tests/test_conf.c (test_source_reload): Check that we handle |
| 4215 | the cases of modiciation of a running job, modification of a |
| 4216 | replacement of a running job and deletion of a replacement for a |
| 4217 | running job. |
| 4218 | |
Scott James Remnant | a77229e | 2007-06-10 20:52:55 +0100 | [diff] [blame] | 4219 | * init/parse_job.c (parse_job): Instead of freeing the previous |
| 4220 | replacement, which could leave invalid references to it, mark it |
| 4221 | for deletion and change the state. |
| 4222 | * init/tests/test_parse_job.c (test_parse_job): Adjust the test so |
| 4223 | that we hold a reference to the replacement job and make sure that |
| 4224 | the state is changed to deleted, rather than checking for a destructor |
| 4225 | being called on it. |
| 4226 | |
Scott James Remnant | f1de26c | 2007-06-10 20:43:16 +0100 | [diff] [blame] | 4227 | * init/init.supp (conf-init): Add valgrind suppression for the |
| 4228 | configuration sources hash table. |
| 4229 | |
Scott James Remnant | 11a1cf2 | 2007-06-10 17:38:06 +0100 | [diff] [blame] | 4230 | * init/conf.c (conf_item_free): Don't overwrite any previous |
| 4231 | replacement, only mark us for deletion if we wouldn't otherwise |
| 4232 | be replaced. Add some commented possible code for testing. |
| 4233 | * init/tests/test_conf.c (test_source_reload): Test replacement of |
| 4234 | jobs works properly; test modification with direct write and with |
| 4235 | atomic rename replace; test deletion. |
| 4236 | |
Scott James Remnant | fa38c53 | 2007-06-10 16:49:13 +0100 | [diff] [blame] | 4237 | * init/conf.c (conf_reload_path): It turns out that the flag trick |
| 4238 | doesn't work for items since we often reparse them within the same |
| 4239 | file tag (it works with files because they're atomic and reparsed). |
| 4240 | Store the old items in a different list instead. |
| 4241 | (conf_source_free): We need to be careful about freeing sources, |
| 4242 | so have a function to do it properly. |
| 4243 | (conf_item_new): Since the flag member isn't useful, don't bother |
| 4244 | setting it. |
| 4245 | * init/conf.h: Add conf_source_free prototype. |
| 4246 | (ConfFile): Remove flag member. |
| 4247 | * init/tests/test_conf.c (test_source_reload): Add test for inotify |
| 4248 | create detection. |
| 4249 | |
Scott James Remnant | 79b9bde | 2007-06-10 15:43:18 +0100 | [diff] [blame] | 4250 | * init/conf.c (conf_file_delete): Rename to conf_file_free and match |
| 4251 | the pattern of those kinds of functions. |
| 4252 | (conf_item_delete): Likewise rename to conf_item_free and match the |
| 4253 | pattern of these kinds of functions. |
| 4254 | * init/conf.h: Add prototypes. |
| 4255 | |
Scott James Remnant | db56d50 | 2007-06-10 15:37:28 +0100 | [diff] [blame] | 4256 | * init/conf.c (conf_reload_path): Fix bug with job name generation. |
| 4257 | Allow non-parsing errors to be returned from the function. |
| 4258 | (conf_item_delete): Drop all replacement management code, we'll put |
| 4259 | this back through testing. |
| 4260 | * init/tests/test_conf.c (test_source_reload): Test reloading adds |
| 4261 | the right inotify watch and parses the files, also check that loading |
| 4262 | without inotify and mandatory reloading work. |
| 4263 | |
Scott James Remnant | 56760be | 2007-06-10 14:23:53 +0100 | [diff] [blame] | 4264 | * init/conf.c (conf_source_reload): Move the item deletion detection |
| 4265 | code from this function, where it would only happen on a mandatory |
| 4266 | reload |
| 4267 | (conf_reload_path): to this function, where it will happen every time |
| 4268 | the file is parsed; which is actually what we want. |
| 4269 | |
Scott James Remnant | ac1f068 | 2007-06-08 16:04:50 +0100 | [diff] [blame] | 4270 | 2007-06-08 Scott James Remnant <scott@netsplit.com> |
| 4271 | |
| 4272 | * init/conf.h (ConfItem): Drop the name and replace it with a type. |
| 4273 | (ConfItemType): Enum for different types of configuration items |
| 4274 | (ConfFile): Change items from a hash table to a list. |
| 4275 | * init/conf.c (conf_file_get): Initialise the items member as a list. |
| 4276 | (conf_item_set): Rename to conf_item_new again. |
| 4277 | (conf_item_new): Allocates a new ConfItem and adds it to the file's |
| 4278 | list, we won't reuse items anymore since it doesn't really make sense. |
| 4279 | (conf_source_reload): Adjust clean-up code now that items is a list. |
| 4280 | (conf_reload_path): Work out the name of jobs found by filename, |
| 4281 | allocate a new item for them and parse the job into it. Perform |
| 4282 | handling of errors by outputting a warning. |
| 4283 | (conf_item_delete): Takes both source and file so we can make |
| 4284 | intelligent decisions. |
| 4285 | (conf_file_delete): Takes a source and passes it to conf_item_delete |
| 4286 | (conf_delete_handler): Pass both source and file to conf_file_delet |
Scott James Remnant | ac1f068 | 2007-06-08 16:04:50 +0100 | [diff] [blame] | 4287 | * init/tests/test_conf.c (test_file_get): Check that the items |
| 4288 | list is empty; rather than the hash being unallocated. |
| 4289 | (test_item_set): Rename back to test_item_new and only allocate a |
| 4290 | single item which should get added to the list. |
| 4291 | |
Scott James Remnant | 3c06342 | 2007-06-06 13:25:15 +0100 | [diff] [blame] | 4292 | 2007-06-06 Scott James Remnant <scott@netsplit.com> |
| 4293 | |
Scott James Remnant | a940d5c | 2007-06-06 15:45:26 +0100 | [diff] [blame] | 4294 | * init/parse_job.c (stanza_respawn): Permit the word "unlimited", |
| 4295 | raise a specific error for illegal limit and illegal interval. |
| 4296 | (stanza_pid, stanza_kill, stanza_normal, stanza_umask) |
| 4297 | (stanza_nice, stanza_limit): Raise specific errors rather than |
| 4298 | a generic "illegal value" error. |
| 4299 | * init/tests/test_parse_job.c (test_stanza_respawn): Check that |
| 4300 | we can use "unlimited", also check for new error return. |
| 4301 | (test_stanza_pid, test_stanza_kill, test_stanza_normal) |
| 4302 | (test_stanza_umask, test_stanza_nice, test_stanza_limit): Check |
| 4303 | for new specific errors. |
| 4304 | * init/errors.h: Replace CFG_ILLEGAL_VALUE with a series of parse |
| 4305 | errors. |
| 4306 | |
Scott James Remnant | d516e3a | 2007-06-06 13:37:45 +0100 | [diff] [blame] | 4307 | * init/conf.c: Comments. |
| 4308 | |
Scott James Remnant | f5ade4a | 2007-06-06 13:36:24 +0100 | [diff] [blame] | 4309 | * init/conf.c (conf_item_set): Call out to conf_item_delete() to |
| 4310 | handle unsetting of an item's data. |
| 4311 | (conf_source_reload): Add code to deal with mandatory reloading, |
| 4312 | calls conf_file_delete() and/or conf_item_delete() as appropriate. |
| 4313 | (conf_delete_handler): Call conf_file_delete() on the ConfFile that |
| 4314 | we find. |
| 4315 | (conf_file_delete): Function to delete all items in a file. |
| 4316 | (conf_item_delete): Placeholder function to delete an item. |
| 4317 | |
Scott James Remnant | 3c06342 | 2007-06-06 13:25:15 +0100 | [diff] [blame] | 4318 | * init/conf.c (conf_file_new): Rename to conf_file_get; in practice |
| 4319 | we never just want to allocate one of these, we always want to |
| 4320 | return the existing entry if it exists. |
| 4321 | (conf_item_new): Rename to conf_item_set; again in practice we always |
| 4322 | want to update an existing item. This function will grow the "deal |
| 4323 | with replacement" stuff. |
| 4324 | (conf_reload): Start putting in place the code that will allow |
| 4325 | mandatory reloads, as well as initial setup. This function iterates |
| 4326 | over the sources and deals with errors. |
| 4327 | (conf_source_reload): Function to reload an individual source, calls |
| 4328 | out to one of the following two functions and will eventually perform |
| 4329 | the deleted items scan. |
| 4330 | (conf_source_reload_file): Set up a watch on a file, and reload it. |
| 4331 | (conf_source_reload_dir): Set up a watch on a directory and reload it. |
| 4332 | (conf_file_filter): Filter for watching parent directory of files. |
| 4333 | (conf_create_modify_handler): File creation and modification handler. |
| 4334 | (conf_delete_handler): File deletion handler. |
| 4335 | (conf_file_visitor): Tree walk handler. |
| 4336 | (conf_reload_path): Function that deals with files themselves, |
| 4337 | currently just sorts out the ConfFile structure and maps the file |
| 4338 | into memory. |
| 4339 | * init/conf.h: Add new prototypes, update existing ones. |
| 4340 | * init/tests/test_conf.c (test_file_new): Rename to test_file_get, |
| 4341 | also test repeated calls when already in the table. |
| 4342 | (test_item_new): Rename to test_item_set, also test repeated calls |
| 4343 | when already in the table. |
| 4344 | (test_source_reload): Start of test for reloading sources. |
| 4345 | |
Scott James Remnant | 8382641 | 2007-06-05 16:52:12 +0100 | [diff] [blame] | 4346 | 2007-06-05 Scott James Remnant <scott@netsplit.com> |
| 4347 | |
| 4348 | * init/conf.c: Make a start on the new configuration management |
| 4349 | routines, which will allow finer-grained tracking of configuration |
| 4350 | and support mandatory reloading. |
| 4351 | (conf_source_new, conf_file_new, conf_item_new): Start off with the |
| 4352 | functions to allocate the tracking structures we need to use. |
| 4353 | * init/conf.h: Structures and prototypes |
| 4354 | * init/tests/test_conf.c: Test suite for allocation functions. |
| 4355 | * init/Makefile.am (init_SOURCES): Build and link conf.c and conf.h |
| 4356 | (TESTS): Run the conf test suite. |
| 4357 | (test_conf_SOURCES, test_conf_LDFLAGS, test_conf_LDADD): Details for |
| 4358 | the conf test suite. |
| 4359 | |
Scott James Remnant | 1f71924 | 2007-06-04 10:14:38 +0100 | [diff] [blame] | 4360 | 2007-06-04 Scott James Remnant <scott@netsplit.com> |
| 4361 | |
Scott James Remnant | 758cd3a | 2007-06-04 11:49:02 +0100 | [diff] [blame] | 4362 | * init/parse_job.c (stanza_description, stanza_author, stanza_version) |
| 4363 | (stanza_chroot, stanza_chdir, stanza_pid): Instead of erroring when |
| 4364 | the string has already been allocated, free it and replace it with the |
| 4365 | new one. Attempting to forbid duplicates is just too inconsistent, |
| 4366 | especially for the integer ones which we compare against the default; |
| 4367 | using the last one allows us to be entirely consistent. |
| 4368 | (stanza_daemon, stanza_respawn, stanza_service, stanza_instance): |
| 4369 | Don't error if the flag is already set, just ignore it. |
| 4370 | (stanza_respawn, stanza_pid, stanza_kill, stanza_console) |
| 4371 | (stanza_umask, stanza_nice): Don't compare the current value against |
| 4372 | the default, just overwrite it! |
| 4373 | (parse_exec, parse_script): Free existing process command string |
| 4374 | before setting a new one over the top. |
| 4375 | (parse_process, stanza_exec, stanza_script, stanza_limit): Instead of |
| 4376 | erroring if the structure is already set and allocated, just don't |
| 4377 | allocate a new one and allow its members to be overwritten. |
| 4378 | * init/tests/test_parse_job.c (test_stanza_exec) |
| 4379 | (test_stanza_script, test_stanza_pre_start) |
| 4380 | (test_stanza_post_start, test_stanza_pre_stop) |
| 4381 | (test_stanza_post_stop, test_stanza_description) |
| 4382 | (test_stanza_author, test_stanza_version, test_stanza_daemon) |
| 4383 | (test_stanza_respawn, test_stanza_service, test_stanza_instance) |
| 4384 | (test_stanza_pid, test_stanza_kill, test_stanza_console) |
| 4385 | (test_stanza_umask, test_stanza_nice, test_stanza_limit) |
| 4386 | (test_stanza_chroot, test_stanza_chdir): Replace tests that check |
| 4387 | for an error in the case of duplicate stanzas with tests that make |
| 4388 | sure the last of the duplicates is used. |
| 4389 | * init/errors.h (CFG_DUPLICATE_VALUE, CFG_DUPLICATE_VALUE_STR): Drop |
| 4390 | this error, since we don't consider this a problem anymore. |
| 4391 | |
Scott James Remnant | 1f71924 | 2007-06-04 10:14:38 +0100 | [diff] [blame] | 4392 | * upstart/Makefile.am (libupstart_la_LIBADD): Add $(LTLIBINTL) |
| 4393 | * init/Makefile.am (init_LDADD): Reorder and add $(LTLIBINTL) |
| 4394 | * util/Makefile.am (initctl_LDADD): Reorder and add $(LTLIBINTL) |
| 4395 | * compat/sysv/Makefile.am (reboot_LDADD): Reorder and add $(LTLIBINTL) |
| 4396 | (runlevel_LDADD): add $(LTLIBINTL) |
| 4397 | (shutdown_LDADD): Reorder and add $(LTLIBINTL) |
| 4398 | (telinit_LDADD): Reorder and add $(LTLIBINTL) |
| 4399 | * logd/Makefile.am (logd_LDADD): Add $(LTLIBINTL) |
| 4400 | |
Scott James Remnant | e8b584e | 2007-06-03 19:08:38 +0100 | [diff] [blame] | 4401 | 2007-06-03 Scott James Remnant <scott@netsplit.com> |
| 4402 | |
Scott James Remnant | 48a3a94 | 2007-06-03 19:21:34 +0100 | [diff] [blame] | 4403 | * init/tests/test_job.c (test_run_process): Add a test case for a |
| 4404 | crasher when the event has no arguments. |
| 4405 | * init/job.c (job_run_process): Fix the bug, we need to check the |
| 4406 | arguments before trying to append them. |
| 4407 | |
Scott James Remnant | e8b584e | 2007-06-03 19:08:38 +0100 | [diff] [blame] | 4408 | * init/cfgfile.c, init/cfgfile.h, init/tests/test_cfgfile.c: Rename |
| 4409 | to parse_job and strip out all functions except the parsing and stanza |
| 4410 | ones. |
| 4411 | * init/Makefile.am (init_SOURCES): Build and link parse_job.c and h |
| 4412 | (TESTS): Run the parse job test suite |
| 4413 | (test_cfgfile_SOURCES, test_cfgfile_LDFLAGS, test_cfgfile_LDADD): |
| 4414 | Rename and update. |
| 4415 | * init/parse_job.c: Rename all cfg_stanza_*() functions to just |
| 4416 | stanza_*(), rename all cfg_parse_*() functions to just parse_*(). |
| 4417 | (parse_job, parse_process, stanza_exec, stanza_script, stanza_start) |
| 4418 | (stanza_stop, stanza_emits, stanza_normal, stanza_env, stanza_limit): |
| 4419 | Don't use NIH_MUST, it's fine to be out of memory and we should fail |
| 4420 | in that case with a useful error. The user can always reload the |
| 4421 | config file. |
| 4422 | (cfg_read_job, cfg_watch_dir, cfg_job_name, cfg_create_modify_handler) |
| 4423 | (cfg_delete_handler, cfg_visitor): Drop these functions for now. |
| 4424 | * init/parse_job.h: Update so it just contains the one prototype. |
| 4425 | * init/tests/test_parse_job.c: Update all tests to pass a string |
| 4426 | to parse_job(), and check errors raised; rather than mucking around |
| 4427 | with file descriptors all of the time. Spend the effort while we're |
| 4428 | in here to run TEST_ALLOC_FAIL where we can. |
| 4429 | * init/main.c: Drop config file loading for now since it's missing. |
| 4430 | |
Scott James Remnant | a482d9a | 2007-05-27 16:57:35 +0100 | [diff] [blame] | 4431 | 2007-05-27 Scott James Remnant <scott@netsplit.com> |
| 4432 | |
Scott James Remnant | e7464fd | 2007-06-02 11:43:11 +0100 | [diff] [blame] | 4433 | * init/cfgfile.h (CFG_DIR): Drop this define, since it's in paths.h |
| 4434 | (CfgDirectory): |
| 4435 | |
Scott James Remnant | a482d9a | 2007-05-27 16:57:35 +0100 | [diff] [blame] | 4436 | * init/cfgfile.c (cfg_read_job): Separate out the job-handling code |
| 4437 | into a new function that we could call from a stanza if we want |
| 4438 | later; this one now just maps the file into memory and deals with |
| 4439 | exceptions from the parsing. |
| 4440 | (cfg_parse_job): Function containing the seperated out code; parses |
| 4441 | a new job, marking it as a replacement for any existing job with the |
| 4442 | same name. Drop the warnings for using pid options without a daemon, |
| 4443 | since these are actually useful for other things later. |
| 4444 | * init/tests/test_cfgfile.c (test_read_job): Drop the check on |
| 4445 | unexpected daemon options, since we don't issue these warnings |
| 4446 | anymore. |
| 4447 | |
Scott James Remnant | 4fa7b87 | 2007-05-20 13:09:17 +0100 | [diff] [blame] | 4448 | 2007-05-20 Scott James Remnant <scott@netsplit.com> |
| 4449 | |
Scott James Remnant | 2b4e0ed | 2007-05-20 14:00:06 +0100 | [diff] [blame] | 4450 | * init/event.c (event_match): Change to accept Event as the first |
| 4451 | argument and EventInfo as the second, making it obvious that this |
| 4452 | matches a received Event against known EventInfo rather than just |
| 4453 | comparing two info structs (since the order matters). |
| 4454 | * init/event.h: Update prototype. |
| 4455 | * init/tests/test_event.c (test_match): Update test accordingly. |
| 4456 | (test_poll): Fix typo. |
| 4457 | * init/job.c (job_handle_event): Pass in the event as the first |
| 4458 | argument to event_match, rather than its info. |
| 4459 | * TODO: Update. |
| 4460 | |
Scott James Remnant | 64b5f68 | 2007-05-20 13:14:51 +0100 | [diff] [blame] | 4461 | * init/job.c (job_emit_event): Return the event that we emit; don't |
| 4462 | bother tracking block status or setting blocked, leave that to the |
| 4463 | state loop so things are more obvious. |
| 4464 | (job_change_state): Set the blocked flag here for starting and stopping |
| 4465 | to the return value of job_emit_event(). |
| 4466 | |
Scott James Remnant | 4fa7b87 | 2007-05-20 13:09:17 +0100 | [diff] [blame] | 4467 | * init/event.c (event_ref, event_unref): Reference counting of events |
| 4468 | so we don't free those we still need. |
| 4469 | (event_block, event_unblock): Blocker counting that replaces the |
| 4470 | previous jobs member. |
| 4471 | (event_new): Initialise refs and blockers fields. |
| 4472 | (event_emit_finished): Remove this function. |
| 4473 | (event_poll): Handle the new done state, and deal with the blockers |
| 4474 | and references counts; turns out that we can fall all the way through |
| 4475 | this switch if these are zero without needing to check again. |
| 4476 | (event_pending): Remove call to event_emit_finished, the event_poll() |
| 4477 | loop handles this case now. |
| 4478 | (event_finished): Set progress to done on the way out. |
| 4479 | * init/event.h (EventProgress): Add new done state |
| 4480 | (Event): Add refs and blockers members, replacing jobs |
| 4481 | * init/tests/test_event.c (test_new): Check refs and blockers are |
| 4482 | initialised to zero. |
| 4483 | (test_ref, test_unref, test_block, test_unblock): Check the ref |
| 4484 | counting function behaviours. |
| 4485 | (test_emit_finished): Drop this function since it's not used |
| 4486 | * init/job.c (job_change_cause): Reference and block the event, |
| 4487 | and unblock and unreference before changing. |
| 4488 | (job_emit_event): Reference the event that blocks the job from |
| 4489 | continuing. |
| 4490 | (job_handle_event_finished): Unreference the blocking event again. |
| 4491 | (job_change_state): Make sure that blocked has been cleared before |
| 4492 | allowing a state change. |
| 4493 | * init/tests/test_job.c: Change tests to use refs/blockers on the |
| 4494 | cause event when counting, and also to follow the status of blocked |
| 4495 | since that is now ref-counted as well. |
| 4496 | |
Scott James Remnant | fea1e9c | 2007-05-18 15:42:25 +0100 | [diff] [blame] | 4497 | 2007-05-18 Scott James Remnant <scott@netsplit.com> |
| 4498 | |
Scott James Remnant | 186ecdc | 2007-05-18 20:18:17 +0100 | [diff] [blame] | 4499 | * init/main.c (main, cad_handler, kbd_handler, pwr_handler): Use |
| 4500 | event_new rather than event_emit. |
| 4501 | * init/job.h (Job): Change type of cause and blocked to Event |
| 4502 | * init/job.c (job_change_goal, job_change_cause, job_emit_event) |
| 4503 | (job_handle_event, job_handle_event_finished): Update all references |
| 4504 | to EventEmission to use Event instead. |
| 4505 | (job_detect_stalled): Call event_new instead of event_emit |
| 4506 | (job_run_process): Use the info member of cause, not event member |
| 4507 | * init/tests/test_job.c (test_change_goal, test_change_state) |
| 4508 | (test_run_process, test_child_reaper, test_handle_event) |
| 4509 | (test_handle_event_finished): Update all references to EventEmission |
| 4510 | to use Event instead. |
| 4511 | (test_detect_stalled): Correct to use right structure types. |
| 4512 | * init/process.c (process_setup_environment): Use cause's info member, |
| 4513 | rather than event member. |
| 4514 | * init/tests/test_process.c (test_spawn): Update to use Event. |
| 4515 | * init/notify.h (NotifySubscription): Change member to event |
| 4516 | * init/notify.c (notify_subscribe_event) |
| 4517 | (notify_subscription_find, notify_job_event, notify_event) |
| 4518 | (notify_event_finished): Update functions to use event member and |
| 4519 | Event structures. |
| 4520 | * init/tests/test_notify.c (test_subscribe_event) |
| 4521 | (test_subscription_find, test_job, test_job_event, test_event) |
| 4522 | (test_event_finished): Update to use Event instead of EventEmission |
| 4523 | * init/control.c (control_event_emit): Update to use event_new. |
| 4524 | * init/tests/test_control.c (test_event_emit) |
| 4525 | (test_subscribe_events, test_unsubscribe_events): Update to use |
| 4526 | Event rather than EventEmission. |
| 4527 | |
| 4528 | * init/event.h: Fix up a few references. |
| 4529 | * init/tests/test_event.c (test_new): Remove reference to emission. |
| 4530 | |
Scott James Remnant | 3a6b7f6 | 2007-05-18 19:54:45 +0100 | [diff] [blame] | 4531 | * init/event.h (EventEmission): Rename to Event, and rename event |
| 4532 | member to info. |
| 4533 | * init/event.c (event_emit_next_id): Rename to event_next_id |
| 4534 | (event_emit): Rename to event_new, and add standard parent argument. |
| 4535 | (event_emit_find_by_id): Rename to event_find_by_id |
| 4536 | (event_poll): Iterate over Events in the list |
| 4537 | (event_pending, event_finished): Operate on Event |
| 4538 | * init/tests/test_event.c (test_emit): Rename to test_new and |
| 4539 | adjust for names and arguments. |
| 4540 | (test_emit_find_by_id): Rename to test_find_by_id and adjust for |
| 4541 | names. |
| 4542 | (test_emit_finished, test_poll): Adjust names. |
| 4543 | |
Scott James Remnant | 23adaa4 | 2007-05-18 19:17:42 +0100 | [diff] [blame] | 4544 | * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop) |
| 4545 | (cfg_stanza_emits): Convert to use EventInfo and event_info_*. |
| 4546 | * init/job.c (job_copy): Use EventInfo and event_info_copy. |
| 4547 | (job_handle_event, job_detect_stalled): Iterate EventInfo structures |
| 4548 | * init/tests/test_cfgfile.c (test_stanza_start, test_stanza_stop) |
| 4549 | (test_stanza_emits): Update to use EventInfo |
| 4550 | * init/tests/test_job.c (test_copy, test_handle_event) |
| 4551 | (test_handle_event_finished, test_detect_stalled): Update to use |
| 4552 | EventInfo and event_info_new |
| 4553 | * init/event.c (event_copy): Use nih_str_array_copy here, to make the |
| 4554 | code somewhat simpler. |
| 4555 | (event_finished): Copy the arguments and environment from the old |
| 4556 | event, rather than stealing and reparenting. |
| 4557 | * init/job.c (job_copy): Use nih_str_array_copy here too. |
| 4558 | (job_run_process): Use nih_str_array_append to add the arguments from |
| 4559 | the emission onto the command run. |
| 4560 | |
Scott James Remnant | ccf3ac2 | 2007-05-18 19:17:36 +0100 | [diff] [blame] | 4561 | * init/event.h (Event): Rename to EventInfo, since this structure |
| 4562 | representations information about an event, rather than an actual |
| 4563 | event in progress. |
| 4564 | * init/event.c (event_new): Rename to event_info_new, also now can |
| 4565 | take arguments and environment like event_emit() can. |
| 4566 | (event_copy): Rename to event_info_copy. |
| 4567 | * init/tests/test_event.c (test_new): Rename to test_info_new, |
| 4568 | update names in test and test being given args or env. |
| 4569 | (test_copy): Rename to test_info_copy and update names in test. |
| 4570 | (test_match, test_poll): Use EventInfo. |
Scott James Remnant | 4a558b6 | 2007-05-18 18:41:12 +0100 | [diff] [blame] | 4571 | |
Scott James Remnant | fea1e9c | 2007-05-18 15:42:25 +0100 | [diff] [blame] | 4572 | * TODO: Update. |
| 4573 | |
Scott James Remnant | c043a8a | 2007-04-24 12:59:54 +0100 | [diff] [blame] | 4574 | 2007-04-24 Scott James Remnant <scott@netsplit.com> |
| 4575 | |
| 4576 | * configure.ac: Add AM_PROG_CC_C_O since we use per-target flags |
| 4577 | for one of the test cases. |
| 4578 | |
Scott James Remnant | 0495ff8 | 2007-03-16 17:18:00 +0000 | [diff] [blame] | 4579 | 2007-03-16 Scott James Remnant <scott@netsplit.com> |
| 4580 | |
| 4581 | * upstart/message.c (upstart_message_newv): Add va_end to match |
| 4582 | va_copy because the standard says so. |
| 4583 | * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Add |
| 4584 | va_end here as well. |
| 4585 | |
Scott James Remnant | 5b78ebf | 2007-03-13 17:04:16 +0000 | [diff] [blame] | 4586 | 2007-03-13 Scott James Remnant <scott@netsplit.com> |
| 4587 | |
Scott James Remnant | d03c53c | 2007-03-13 19:13:19 +0000 | [diff] [blame] | 4588 | * init/main.c: Wait until we've closed inherited standard file |
| 4589 | descriptors and opened the console instead before trying to open the |
| 4590 | control socket; otherwise we end up closing it by accident if we |
| 4591 | weren't opened with sufficient descriptors in the first place. |
| 4592 | Also wait until we've set up the logger before trying to parse the |
| 4593 | configuration. In fact both of these things need to be pretty low |
| 4594 | down the main() function. |
| 4595 | |
Scott James Remnant | dde290e | 2007-03-13 18:52:30 +0000 | [diff] [blame] | 4596 | * init/tests/test_job.c (test_run_process): Skip /dev/fd test cases |
| 4597 | if that's not available. |
| 4598 | |
Scott James Remnant | 3284419 | 2007-03-13 18:47:54 +0000 | [diff] [blame] | 4599 | * init/tests/test_control.c (test_log_priority): Make sure we know |
| 4600 | that the message has been sent before calling the watcher. |
| 4601 | |
Scott James Remnant | a951cec | 2007-03-13 18:39:13 +0000 | [diff] [blame] | 4602 | * init/cfgfile.c (cfg_watch_dir): We get ENOSYS for missing inotify |
| 4603 | support, not EOPNOTSUPP. |
| 4604 | * init/tests/test_cfgfile.c (test_watch_dir): Actually make the |
| 4605 | directory tree before testing for inotify, since we use the same |
| 4606 | tree there too. |
| 4607 | |
Scott James Remnant | 7f6ac15 | 2007-03-13 18:08:31 +0000 | [diff] [blame] | 4608 | * util/initctl.c (job_info_output): Restructure so gcc doesn't think |
| 4609 | name can be used uninitialised. |
| 4610 | * init/tests/test_cfgfile.c (test_watch_dir): Correct an error where |
| 4611 | i wouldn't be initialised if we skipped the inotify tests. |
| 4612 | |
| 4613 | * util/initctl.c (job_info_output): Restructure so gcc doesn't think |
Scott James Remnant | 7e5d006 | 2007-03-13 17:27:38 +0000 | [diff] [blame] | 4614 | * init/process.c (process_setup_environment): job id fits inside |
| 4615 | a %u now |
| 4616 | |
Scott James Remnant | 7230102 | 2007-03-13 17:27:09 +0000 | [diff] [blame] | 4617 | * upstart/message.h: Style; always refer to "unsigned int" as |
| 4618 | "unsigned int", and never "unsigned. |
| 4619 | * upstart/tests/test_message.c (my_handler): Catch a stray couple |
| 4620 | of "unsigned"s |
| 4621 | |
Scott James Remnant | 25a7154 | 2007-03-13 17:25:34 +0000 | [diff] [blame] | 4622 | * init/control.c (control_job_query, control_job_start) |
| 4623 | (control_job_stop): Change type of id argument to unsigned int, |
| 4624 | and call printf with %u to output it. |
| 4625 | * init/tests/test_control.c (check_job, check_job_instance) |
| 4626 | (check_job_instance_end, check_job_status__waiting) |
| 4627 | (check_job_status_end__waiting, check_job_status__starting) |
| 4628 | (check_job_status_end__starting, check_job_status__running) |
| 4629 | (check_job_status_end__running, check_job_status__pre_stop) |
| 4630 | (check_job_status_end__pre_stop, check_job_status__stopping) |
| 4631 | (check_job_status_end__stopping, check_job_status__deleted) |
| 4632 | (check_job_status_end__deleted, check_job_unknown) |
| 4633 | (check_job_invalid, check_job_unchanged, check_event): Change |
| 4634 | type of id arguments to unsigned int. |
| 4635 | (check_list): Change type of id to unsigned int. |
| 4636 | * init/tests/test_notify.c (check_job_status) |
| 4637 | (check_job_status_end, check_job_finished, check_event) |
| 4638 | (check_event_caused, check_event_finished): Change type of id |
| 4639 | arguments to unsigned int. |
| 4640 | |
Scott James Remnant | 4e7af0c | 2007-03-13 17:20:20 +0000 | [diff] [blame] | 4641 | * init/job.h (Job): Change the type of the id to unsigned int. |
| 4642 | * init/job.c (job_next_id): Change ids to be unsigned ints, and now |
| 4643 | we can just use %u in the nih_error call. |
| 4644 | (job_find_by_id): Change argument to be unsigned int |
| 4645 | * init/tests/test_job.c (test_find_by_id): Change id type to unsigned |
| 4646 | int. |
| 4647 | * init/event.h (Event): Change the type of the id to unsigned int. |
| 4648 | * init/event.c (event_emit_next_id): Change ids to be unsigned ints, |
| 4649 | and now we can just use %u in the nih_error call. |
| 4650 | (event_emit_find_by_id): Change argument to be unsigned int |
| 4651 | * init/tests/test_event.c (test_emit, test_emit_find_by_id) |
| 4652 | (check_event, check_event_finished): Change id type to unsigned int. |
| 4653 | |
Scott James Remnant | 8de2c53 | 2007-03-13 17:14:27 +0000 | [diff] [blame] | 4654 | * util/initctl.c (output_name): Use an unsigned int for the job id, |
| 4655 | which means we can use ordinary %u for the printf argument. |
| 4656 | (handle_job, handle_job_finished, handle_job_instance) |
| 4657 | (handle_job_instance_end, handle_job_status) |
| 4658 | (handle_job_status_end, handle_job_unknown, handle_job_invalid) |
| 4659 | (handle_job_unchanged, handle_event, handle_event_caused) |
| 4660 | (handle_event_finished): Change argument type of id from uint32_t |
| 4661 | to unsigned int. |
| 4662 | (job_info_output): Change output type of id from %zu to %u |
| 4663 | |
Scott James Remnant | 9240641 | 2007-03-13 17:10:40 +0000 | [diff] [blame] | 4664 | * upstart/message.c (upstart_message_handle): Use unsigned int for |
| 4665 | ids, rather than a fixed-width type. |
| 4666 | * upstart/tests/test_message.c (my_handler): Use unsigned int for |
| 4667 | the ids, and give "unsigned int" instead of "unsigned" to va_arg as |
| 4668 | a matter of style. |
| 4669 | |
Scott James Remnant | 5b78ebf | 2007-03-13 17:04:16 +0000 | [diff] [blame] | 4670 | * upstart/wire.c (upstart_push_int, upstart_pop_int): Send over the |
| 4671 | wire using a plain old integer type, instead of a fixed width type; |
| 4672 | there's no advantage to using the fixed-width type and we could hurt |
| 4673 | ourselves if we tried running on ILP64. |
| 4674 | (upstart_push_unsigned, upstart_pop_unsigned): Likewise use a plain |
| 4675 | unsigned int over the wire. |
| 4676 | (upstart_push_string, upstart_pop_string): Use an unsigned int for |
| 4677 | the length of the string, technically this means that we silently |
| 4678 | truncate any string that's greater than 4GB on 64-bit platforms; |
| 4679 | it's either that or make the test cases harder (we did this before |
| 4680 | anyway). |
| 4681 | (upstart_push_header, upstart_pop_header): Type is always an unsigned |
| 4682 | int (best conversion from an enum) |
| 4683 | |
Scott James Remnant | 57f02a7 | 2007-03-11 12:53:49 +0000 | [diff] [blame] | 4684 | 2007-03-11 Scott James Remnant <scott@netsplit.com> |
| 4685 | |
Scott James Remnant | fc7e60d | 2007-03-11 19:13:41 +0000 | [diff] [blame] | 4686 | * configure.ac: Bump version to 0.3.9 |
| 4687 | |
Scott James Remnant | 7c862ed | 2007-03-11 19:13:24 +0000 | [diff] [blame] | 4688 | * NEWS: Update. |
| 4689 | |
Scott James Remnant | 2bc5c5e | 2007-03-11 19:01:57 +0000 | [diff] [blame] | 4690 | * util/man/initctl.8: Document the new commands. |
| 4691 | |
Scott James Remnant | d055a9d | 2007-03-11 17:58:15 +0000 | [diff] [blame] | 4692 | * TODO: Update. |
| 4693 | |
Scott James Remnant | 1919825 | 2007-03-11 17:57:34 +0000 | [diff] [blame] | 4694 | * init/job.c (job_handle_event): Correct the function so we don't |
| 4695 | try and stop the master of an instance, and cause an assertion error. |
| 4696 | |
Scott James Remnant | bea9e8d | 2007-03-11 17:41:58 +0000 | [diff] [blame] | 4697 | * util/initctl.c: Oops, correct function pointers in command table |
| 4698 | |
| 4699 | * util/tests/test_initctl.c (test_version_action): |
| 4700 | |
Scott James Remnant | 509f8a6 | 2007-03-11 17:39:27 +0000 | [diff] [blame] | 4701 | * util/initctl.c (handle_version): Handle receipt of the version |
| 4702 | reply. |
| 4703 | (version_action): Send the version-query message to the server and |
| 4704 | expect one response. |
| 4705 | (log_priority_action): Parse the single argument into an NihLogLevel |
| 4706 | and send it to the server. |
| 4707 | |
Scott James Remnant | ae1927e | 2007-03-11 13:45:13 +0000 | [diff] [blame] | 4708 | * init/control.c (control_version_query, control_log_priority): |
| 4709 | Functions to handle the new messages from the server pov |
| 4710 | * init/tests/test_control.c (test_version_query) |
| 4711 | (test_log_priority): Test the new messages are handled properly. |
| 4712 | (check_version): Check the version string matches. |
Scott James Remnant | ebeb2b6 | 2007-03-11 13:33:36 +0000 | [diff] [blame] | 4713 | * upstart/message.h: Add messages for querying the version of the |
| 4714 | init daemon and changing the log priority. |
| 4715 | * upstart/message.c (upstart_message_newv) |
| 4716 | (upstart_message_handle): Marshal the new messages. |
| 4717 | * upstart/tests/test_message.c (test_new, my_handler) |
| 4718 | (test_handle): Test the marshalling of the new messages, |
| 4719 | |
Scott James Remnant | 57312ad | 2007-03-11 12:55:32 +0000 | [diff] [blame] | 4720 | * upstart/libupstart.ver: Add enum functions to the global list. |
| 4721 | |
Scott James Remnant | 57f02a7 | 2007-03-11 12:53:49 +0000 | [diff] [blame] | 4722 | * util/initctl.c (start_action, stop_action): Imply --no-wait if |
| 4723 | we take the job id or name from an environment variable, since we'd |
| 4724 | end up waiting for ourselves otherwise |
| 4725 | * util/tests/test_initctl.c (test_start_action, test_stop_action): |
| 4726 | Update test cases to make sure no-wait is implied. |
| 4727 | |
Scott James Remnant | cd84c31 | 2007-03-09 12:51:31 +0000 | [diff] [blame] | 4728 | 2007-03-09 Scott James Remnant <scott@netsplit.com> |
| 4729 | |
Scott James Remnant | b1c7eb2 | 2007-03-09 21:35:52 +0000 | [diff] [blame] | 4730 | * configure.ac: Bump version to 0.3.8 |
| 4731 | |
Scott James Remnant | 79a3c9a | 2007-03-09 21:35:31 +0000 | [diff] [blame] | 4732 | * NEWS: Updated. |
| 4733 | * configure.ac: Increase version to 0.3.7 |
| 4734 | |
Scott James Remnant | cf8ede0 | 2007-03-09 19:56:07 +0000 | [diff] [blame] | 4735 | * init/tests/test_job.c (test_change_state): Add a test case for |
| 4736 | deleting the last instance of a replaced job. |
| 4737 | * init/job.c (job_change_state): When moving a instance of a job into |
| 4738 | the deleted state, check whether we should replace the job it's an |
| 4739 | instance of, and if so, change that job's state too. |
| 4740 | * TODO: Update. |
| 4741 | |
Scott James Remnant | 5188191 | 2007-03-09 18:15:58 +0000 | [diff] [blame] | 4742 | * util/initctl.c (handle_job_list): Always allocate current_list, |
| 4743 | since we need it to be the parent of pointers we attach to it. |
| 4744 | (handle_job_list_end): Always free the current list, only suppress |
| 4745 | output if there aren't any entries in it. |
| 4746 | (initctl_recv): Check the current_list pointer, no need for in_list |
| 4747 | (handle_job_instance, handle_job_instance_end, handle_job_status): |
| 4748 | Check current_list not in_list. |
| 4749 | * util/tests/test_initctl.c: Correct some memory leaks. |
| 4750 | |
Scott James Remnant | 46390a7 | 2007-03-09 17:38:35 +0000 | [diff] [blame] | 4751 | * init/process.c (process_setup_environment): Set the UPSTART_JOB_ID |
| 4752 | environment variable to the job's unique id. |
| 4753 | * init/tests/test_process.c (test_spawn): Make sure it's set. |
| 4754 | |
Scott James Remnant | 671c31c | 2007-03-09 17:34:34 +0000 | [diff] [blame] | 4755 | * util/man/initctl.8: Update the initctl manpage. |
| 4756 | * compat/sysv/man/reboot.8: Correct a minor grammar error. |
| 4757 | * compat/sysv/man/shutdown.8: Fix reference from runlevel to telinit. |
| 4758 | |
Scott James Remnant | ecf322c | 2007-03-09 16:58:48 +0000 | [diff] [blame] | 4759 | * README: Add a README that copies the text from the web page and |
| 4760 | adds some notes about recommended operating system versions. |
| 4761 | |
Scott James Remnant | 4f19cb9 | 2007-03-09 16:48:41 +0000 | [diff] [blame] | 4762 | * util/initctl.c: Completely rewrite initctl, top to bottom; handling |
| 4763 | of the new messages is done natively, meaning that the commands just |
| 4764 | vary the requests send and number of responses expected. |
| 4765 | * util/tests/test_initctl.c: Test all of the new code. |
| 4766 | |
Scott James Remnant | 06abbec | 2007-03-09 13:02:38 +0000 | [diff] [blame] | 4767 | * init/main.c: Improve restarting and rescuing a little; store the |
| 4768 | program path in a static variable so we can always access it, and |
| 4769 | use the exported loglevel to pass the same to the new process. |
| 4770 | * TODO: Update. |
| 4771 | |
Scott James Remnant | cd84c31 | 2007-03-09 12:51:31 +0000 | [diff] [blame] | 4772 | * compat/sysv/shutdown.c: More error/fatal adjustments. |
| 4773 | * compat/sysv/telinit.c: More error/fatal adjustments. |
| 4774 | |
Scott James Remnant | ab1dd0d | 2007-03-08 12:29:02 +0000 | [diff] [blame] | 4775 | 2007-03-08 Scott James Remnant <scott@netsplit.com> |
| 4776 | |
Scott James Remnant | 31421b7 | 2007-03-08 23:53:05 +0000 | [diff] [blame] | 4777 | * init/main.c (main, crash_handler): Promote deadly errors to nih_fatal |
| 4778 | * logd/main.c (main): Promote deadly errors to nih_fatal |
| 4779 | * compat/sysv/reboot.c (main): Promote deadly errors to nih_fatal |
| 4780 | * compat/sysv/shutdown.c (main, shutdown_now): Promote deadly errors |
| 4781 | to nih_fatal |
| 4782 | * compat/sysv/telinit.c (main): Promote deadly errors to nih_fatal |
| 4783 | |
Scott James Remnant | 12d741e | 2007-03-08 23:39:59 +0000 | [diff] [blame] | 4784 | * init/event.c (event_pending): The message that we're handling an |
| 4785 | event should be logged with --verbose. |
| 4786 | |
Scott James Remnant | 5cf17ea | 2007-03-08 15:42:32 +0000 | [diff] [blame] | 4787 | * init/cfgfile.c (cfg_parse_script): Remove the unnecessary check for |
| 4788 | a token inside a script block. |
| 4789 | |
Scott James Remnant | 3ee512d | 2007-03-08 14:30:21 +0000 | [diff] [blame] | 4790 | * TODO: Update. |
| 4791 | |
Scott James Remnant | 9435b8b | 2007-03-08 14:22:45 +0000 | [diff] [blame] | 4792 | * init/control.c (control_watch_jobs): Rename to control_subscribe_jobs |
| 4793 | and update to handle new event name. |
| 4794 | (control_unwatch_jobs): Rename to control_unsubscribe_jobs and update |
| 4795 | to handle the new event name. |
| 4796 | (control_watch_events): Rename to control_subscribe_events and update |
| 4797 | to handle the new event name. |
| 4798 | (control_unwatch_events): Rename to control_unsubscribe_events and |
| 4799 | update to handle the new event name. |
| 4800 | * init/tests/test_control.c (test_watch_jobs): Rename to |
| 4801 | test_subscribe_jobs and update to new event name. |
| 4802 | (test_unwatch_jobs): Rename to test_unsubscribe_jobs and update to |
| 4803 | new event name. |
| 4804 | (test_watch_events): Rename to test_subscribe_events and update to |
| 4805 | new event name. |
| 4806 | (test_unwatch_events): Rename to test_unsubscribe events and update |
| 4807 | to new event name. |
| 4808 | |
| 4809 | * upstart/message.h: Rename the watch commands to subscribe/unsubscribe |
| 4810 | and regroup with new message numbers. |
| 4811 | * upstart/message.c (upstart_message_newv) |
| 4812 | (upstart_message_handle): Marshal the updated subscription messages. |
| 4813 | * upstart/tests/test_message.c (test_new, my_handler) |
| 4814 | (test_handle): Update tests to new names and numbers. |
| 4815 | * TODO: Update. |
| 4816 | |
Scott James Remnant | 47d4b8b | 2007-03-08 13:24:59 +0000 | [diff] [blame] | 4817 | * upstart/message.c (upstart_message_handle): Raise a the unknown |
| 4818 | message error if the type is unknown, rather than the invalid message |
| 4819 | error. |
| 4820 | * upstart/tests/test_message.c (test_handle): Correct test case. |
| 4821 | |
Scott James Remnant | 0534516 | 2007-03-08 12:37:09 +0000 | [diff] [blame] | 4822 | * init/job.c (job_change_state): Correct a problem here too, when |
| 4823 | moving from pre-stop to running, we don't want to emit a started event |
| 4824 | since we never emitted a stopping event and never killed the process |
| 4825 | anyway. We do need to notify the job as finished, since the process |
| 4826 | that tried to stop it will need to be told not to wait any longer. |
| 4827 | * init/tests/test_job.c (test_change_state): Add a test for pre-stop |
| 4828 | back to running. |
| 4829 | |
Scott James Remnant | ab1dd0d | 2007-03-08 12:29:02 +0000 | [diff] [blame] | 4830 | * doc/states.dot: Fix an error in the state diagram; when moving from |
| 4831 | starting back to waiting, due to a failed respawn, we need to emit |
| 4832 | the stopped event otherwise it will never happen. |
| 4833 | * doc/states.png: Update. |
| 4834 | |
Scott James Remnant | 609b24e | 2007-03-05 12:05:20 +0000 | [diff] [blame] | 4835 | 2007-03-05 Scott James Remnant <scott@netsplit.com> |
| 4836 | |
Scott James Remnant | fd5609b | 2007-03-05 20:48:06 +0000 | [diff] [blame] | 4837 | * upstart/message.c (upstart_message_new): Make this a wrapper around |
| 4838 | (upstart_message_newv): which has all the old code, but accepts a |
| 4839 | va_list instead of making its own. |
| 4840 | * upstart/message.h: Add prototype. |
| 4841 | |
Scott James Remnant | 502ea70 | 2007-03-05 20:47:18 +0000 | [diff] [blame] | 4842 | * init/main.c (crash_handler): Simply trying to leave a SEGV handler |
| 4843 | doesn't work so well, we end up repeating the problem instruction. |
| 4844 | We really can't resume from this point, and can't even jump elsewhere |
| 4845 | since our state is probably buggered up. Only thing for it is to |
| 4846 | re-exec ourselves with a clean state. |
| 4847 | |
Scott James Remnant | b27ad2e | 2007-03-05 20:45:04 +0000 | [diff] [blame] | 4848 | * init/cfgfile.c (cfg_read_job, cfg_delete_handler): Don't try and |
| 4849 | free the magic (void *)-1 replacement (delete). |
| 4850 | |
Scott James Remnant | 4cd6367 | 2007-03-05 16:15:39 +0000 | [diff] [blame] | 4851 | * util/events.c, util/events.c, util/jobs.c, util/jobs.h: With the |
| 4852 | new message responses, that intermix event and job information freely, |
| 4853 | it no longer makes sense to distinguish between them. So fold these |
| 4854 | files back into the main initctl.c |
| 4855 | * util/initctl.h: Drop unused header. |
| 4856 | * util/Makefile.am (initctl_SOURCES): Update sources list. |
| 4857 | (TESTS): Change which tests we build |
| 4858 | (test_initctl_SOURCES, test_initctl_CFLAGS, test_initctl_LDFLAGS) |
| 4859 | (test_initctl_LDADD): Build the new combined test case binary, use |
| 4860 | an automake feature to rebuild initctl.c with -DTEST and a different |
| 4861 | .o file, and thus be able to define out main() |
| 4862 | |
| 4863 | * util/tests/test_events.c, util/tests/test_jobs.c: Collapse the two |
| 4864 | test case files into one single |
| 4865 | * util/tests/test_initctl.c |
| 4866 | |
Scott James Remnant | 751245c | 2007-03-05 14:35:09 +0000 | [diff] [blame] | 4867 | * init/control.c (control_job_find): And implement the find function |
| 4868 | that returns a list of jobs matching an optional pattern. |
| 4869 | * init/tests/test_control.c: Make sure we do send all messages. |
| 4870 | (check_list): Complex function to check the responses to a job list |
| 4871 | (test_job_find): Test a couple of job lists. |
| 4872 | * init/tests/test_notify.c: Make sure we do send all messages. |
| 4873 | |
Scott James Remnant | 4ea9ddd | 2007-03-05 13:33:55 +0000 | [diff] [blame] | 4874 | * init/control.c (control_job_query): Implement the query message, |
| 4875 | this just needs to return the status or instance set. |
| 4876 | * init/tests/test_control.c (test_job_query): Test the query command. |
| 4877 | (check_job_status__deleted, check_job_status_end__deleted): Pair of |
| 4878 | functions to check we can query deleted jobs directly. |
| 4879 | |
Scott James Remnant | eca04df | 2007-03-05 13:18:00 +0000 | [diff] [blame] | 4880 | * init/control.c (control_send_instance): Function to send an instance |
| 4881 | job, collating all of its instances together. |
| 4882 | * init/control.h: Update. |
| 4883 | * init/tests/test_control.c (test_send_instance): Check we receive |
| 4884 | the right messages. |
| 4885 | (check_job_instance, check_job_instance_end): Pair of functions to |
| 4886 | check the instance messages. |
| 4887 | |
Scott James Remnant | d62b904 | 2007-03-05 13:04:02 +0000 | [diff] [blame] | 4888 | * upstart/message.h: Add new UPSTART_JOB_INSTANCE and |
| 4889 | UPSTART_JOB_INSTANCE_END messages which we'll use to communicate that |
| 4890 | a job is an instance, and group the instances of it together. |
| 4891 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 4892 | Marshal the new instance messages. |
| 4893 | * upstart/tests/test_message.c (test_new, my_handler) |
| 4894 | (test_handle): Test the new message types. |
| 4895 | |
Scott James Remnant | 609b24e | 2007-03-05 12:05:20 +0000 | [diff] [blame] | 4896 | * upstart/message.h: Restore arguments to JOB_LIST, but rename to |
| 4897 | pattern since that's what it is. |
| 4898 | * upstart/message.c (upstart_message_handle): Restore arguments |
| 4899 | with updated name. |
| 4900 | * upstart/tests/test_message.c (test_new, my_handler) |
| 4901 | (test_handle): Restore tests for arguments, rename and make sure we |
| 4902 | include a wildcard. |
| 4903 | |
Scott James Remnant | f1091d1 | 2007-03-04 01:09:16 +0000 | [diff] [blame] | 4904 | 2007-03-04 Scott James Remnant <scott@netsplit.com> |
| 4905 | |
Scott James Remnant | bfb31a1 | 2007-03-04 20:52:43 +0000 | [diff] [blame] | 4906 | * upstart/message.h: Drop arguments to JOB_LIST. |
| 4907 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 4908 | Drop arguments to JOB_LIST. |
| 4909 | * upstart/tests/test_message.c (test_new, my_handler) |
| 4910 | (test_handle): Drop the arguments from the test. |
| 4911 | |
Scott James Remnant | 117e16c | 2007-03-04 20:17:25 +0000 | [diff] [blame] | 4912 | * init/control.c (control_job_start): Update to return INVALID for |
| 4913 | instances and replacements; add the forgotten UPSTART_JOB message. |
| 4914 | (control_job_stop): Update to return INVALID for replacements; add |
| 4915 | the forgotten UPSTART_JOB message. Deal with instance masters |
| 4916 | magically by iterating all instances and stopping those instead. |
| 4917 | * init/tests/test_control.c (check_job_deleted): Rename to |
| 4918 | check_job_invalid and check that message. |
| 4919 | (check_job): Function to check the job we've acted upon. |
| 4920 | (test_job_start): Check that we get the UPSTART_JOB message first, |
| 4921 | restore the check on deleted jobs causing an error and add checks |
| 4922 | that instance and replacement jobs also cause an error. |
| 4923 | (test_job_stop): Check that we get the UPSTART_JOB message first, |
| 4924 | restore the check on deleted jobs causing an error. Make sure |
| 4925 | instances are handled. |
| 4926 | |
Scott James Remnant | 510b808 | 2007-03-04 19:54:56 +0000 | [diff] [blame] | 4927 | * upstart/message.h: More message changes; add a JOB_FIND message |
| 4928 | and replace UPSTART_JOB_DELETED with UPSTART_JOB_INVALID since there's |
| 4929 | a few more problem conditions. |
| 4930 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 4931 | Marshal the new message and update names. |
| 4932 | * upstart/tests/test_message.c (test_new, my_handler) |
| 4933 | (test_handle): Update tests to check the new message and update the |
| 4934 | values and names of the existing ones. |
| 4935 | |
Scott James Remnant | a7e3bf1 | 2007-03-04 19:39:32 +0000 | [diff] [blame] | 4936 | * init/job.h (Job): Remove the delete flag, add replacement and |
| 4937 | replacement_for pointers instead. |
| 4938 | * init/job.c (job_new): Initialise replacement and replacement_for |
| 4939 | pointers to NULL. |
| 4940 | (job_find_by_name): Update to return what job the one we found is |
| 4941 | a replacement for, and to skip DELETED jobs. |
| 4942 | (job_instance): Make it simply illegal to call this for deleted jobs, |
| 4943 | instances or replacements. |
| 4944 | (job_change_goal): Make it illegal to change the goal of a replacement |
| 4945 | job. |
| 4946 | (job_free_deleted): Remove the previous code to handle deleted instance |
| 4947 | masters, because it's now bogus. |
| 4948 | (job_should_replace): New function to determine whether a job is |
| 4949 | replaceable. |
| 4950 | * init/tests/test_job.c (test_new): Check pointers are set. |
| 4951 | (test_copy): Check that replacement and replacement_for are not |
| 4952 | copied, since their state of an individual job. |
| 4953 | (test_find_by_name): Update tests to make sure we ignore deleted jobs, |
| 4954 | instances and replacements. |
| 4955 | (test_instance): Remove test that will now cause an assertion, |
| 4956 | and no longer check delete is set. |
| 4957 | (test_change_goal): Remove test that will now cause an assertion. |
| 4958 | (test_free_deleted): Remove test cases for deleted masters. |
| 4959 | (test_should_replace): Test the new check function. |
| 4960 | (test_change_state): Make sure that we end up in deleted for instances |
| 4961 | and replaced jobs, and that replacements become the real job. |
| 4962 | * init/cfgfile.c (cfg_read_job): Update to handle replacement jobs; |
| 4963 | the old job's previous replacement is discarded, and set to the |
| 4964 | current job; and then if the job should be replaced, it's moved |
| 4965 | to deleted (which should promote the new job). |
| 4966 | (cfg_delete_handler): Handle deletion of a job in a similar manner, |
| 4967 | except we sent the replacement pointer to the special -1 value since |
| 4968 | we have no actual replacement. |
| 4969 | * init/tests/test_cfgfile.c (test_watch_dir): Update tests to make |
| 4970 | sure that deletion and modification are handled wrt replacement. |
| 4971 | (test_read_job): Make sure that reparsing an existing file is handled. |
| 4972 | * init/tests/test_control.c (test_job_start): Remove checks that |
| 4973 | delete gets set to true for instances. |
| 4974 | (test_job_stop, test_job_start): Temporarily comment out deleted |
| 4975 | job behaviour, since that's been somewhat changed. |
| 4976 | |
Scott James Remnant | ffcbc5f | 2007-03-04 17:34:38 +0000 | [diff] [blame] | 4977 | * upstart/message.h: We're not going to return JOB_LIST for JOB_STOP |
| 4978 | since that's just awkward for the client; just act on the master, |
| 4979 | and return JOB_UNCHANGED. |
| 4980 | |
Scott James Remnant | 78dce1d | 2007-03-04 17:04:28 +0000 | [diff] [blame] | 4981 | * init/notify.c (notify_job_status): Move this function to |
| 4982 | * init/control.c (control_send_job_status): here, since we need it for |
| 4983 | the new control responses. |
| 4984 | (control_job_query): New single function to list all jobs or a |
| 4985 | particular job. |
| 4986 | * init/control.h: Add prototype. |
| 4987 | * init/tests/test_control.c (test_error_handler): Simplify this a |
| 4988 | little to just sending a NO_OP message, since we can send an entire |
| 4989 | stream of messages and leave them in the queue. |
| 4990 | (check_job_status__stopping, check_job_process) |
| 4991 | (check_job_status_end__stopping): Trio of check functions for a job |
| 4992 | status that's stopping, with an active main process. |
| 4993 | (test_send_job_status): Test the now global status function. |
| 4994 | (check_job_status__starting, check_job_status_end__starting): Pair |
| 4995 | of check functions for a starting job with no process yet. |
| 4996 | (test_watch_jobs, test_unwatch_jobs): Update to expect the full new |
| 4997 | job status messages, with an optional process part as well. |
| 4998 | (check_event): Function to check an event. |
| 4999 | (test_watch_events): Minor update to use above function. |
| 5000 | (check_job_status__waiting, check_job_status_end__waiting): Pair of |
| 5001 | check functions for the first step in starting a job (goal change only) |
| 5002 | (check_job_unknown, check_job_deleted, check_job_unchanged): Trio |
| 5003 | of functions to check common error responses. |
| 5004 | (test_job_start): Update tests to newer behaviour. |
| 5005 | (check_job_status__running, check_job_status_end__running) |
| 5006 | (check_job_status__pre_stop, check_job_status_end__pre_stop): Checks |
| 5007 | for the states we go through when stopping a job. |
| 5008 | (test_job_stop): Update tests to newer behaviour. |
| 5009 | * init/notify.c (notify_job, notify_job_event, notify_job_finished): |
| 5010 | Update to call the newly exported function. |
| 5011 | * init/job.c: Make job_id and job_id_wrapped externally available. |
| 5012 | * init/job.h: Update. |
| 5013 | * init/event.c: Make emission_id and emission_id_wrapped externally |
| 5014 | available. |
| 5015 | * init/event.h: Update. |
| 5016 | |
Scott James Remnant | a90e642 | 2007-03-04 14:41:05 +0000 | [diff] [blame] | 5017 | * upstart/message.h: Rename UPSTART_JOB_INVALID to |
| 5018 | UPSTART_JOB_UNCHANGED, as it's not really invalid just a no-op |
| 5019 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 5020 | Update the constant, fields are unchanged, |
| 5021 | * upstart/tests/test_message.c (test_new, my_handler) |
| 5022 | (test_handle): Rename constants/messages. |
| 5023 | |
Scott James Remnant | 82626a9 | 2007-03-04 14:37:12 +0000 | [diff] [blame] | 5024 | * upstart/message.h: Turns out we need extra errors to indicate that |
| 5025 | the job was deleted or already at that goal, otherwise the client |
| 5026 | would sit there waiting for the finished event. |
| 5027 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 5028 | Marshal the new error messages. |
| 5029 | * upstart/tests/test_message.c (test_new, my_handler) |
| 5030 | (test_handle): Test the handling of the new messages. |
| 5031 | |
Scott James Remnant | d39165c | 2007-03-04 14:27:41 +0000 | [diff] [blame] | 5032 | * init/tests/test_job.c (test_free_deleted): Found a bug; because |
| 5033 | master instances never change state, they never end up in the deleted |
| 5034 | state so are never reaped. Add some test cases for cleaning them up, |
| 5035 | but not while they have remaining instances. |
| 5036 | * init/job.c (job_free_deleted): Implement the bug fix. |
| 5037 | |
Scott James Remnant | d3cbc56 | 2007-03-04 14:18:36 +0000 | [diff] [blame] | 5038 | * init/job.c (job_instance): Split out the instance spawning code |
| 5039 | into its own function, as we'll frequently need a pointer to the |
| 5040 | instance before we try and change the goal. |
| 5041 | (job_change_goal): Clean this function back up again, it no longer |
| 5042 | needs to return values and can assert that it's never called for |
| 5043 | deleted jobs or instance mastersr. |
| 5044 | (job_handle_event): Spawn an instance when we get a start event. |
| 5045 | * init/job.h: Update. |
| 5046 | * init/tests/test_job.c (test_instance): Check instance creation. |
| 5047 | (test_change_goal): Update tests now that it doesn't return a value |
| 5048 | again, and doesn't spawn instances itself. |
| 5049 | (test_handle_event): Make sure instances are spawned. |
| 5050 | |
Scott James Remnant | 5bcc62b | 2007-03-04 13:27:15 +0000 | [diff] [blame] | 5051 | * init/tests/test_event.c (test_poll): Needs a slight fix now that |
| 5052 | we generate more events than we check, and that subscriptions go |
| 5053 | away automatically. |
| 5054 | |
Scott James Remnant | b844efb | 2007-03-04 13:00:06 +0000 | [diff] [blame] | 5055 | * init/notify.c (notify_job_status): Static function to handle |
| 5056 | sending the more complicated job status message series |
| 5057 | (notify_job): Call notify_job_status() to send the new-style message |
| 5058 | (notify_job_event): Send the new UPSTART_EVENT_CAUSED message with |
| 5059 | the emission id, then call notify_job_status() to send the new-style |
| 5060 | common status message. |
| 5061 | (notify_job_finished): New function to be called when we reach the |
| 5062 | job rest state, notifies and unsubscribes directly subscribed |
| 5063 | processes, and includes failed information. |
| 5064 | (notify_event_finished): Unsubscribe processes after sending the |
| 5065 | finished event, since the event has gone away. Also don't send |
| 5066 | this to processes subscribed to all events, since it's not useful |
| 5067 | for them. |
| 5068 | * init/notify.h: Add prototype. |
| 5069 | * init/tests/test_notify.c: Update all test cases and helper |
| 5070 | functions to the new message types. |
| 5071 | (test_job_finished): Check the new finished message is sent with |
| 5072 | a status message preceeding it. |
| 5073 | * init/job.c (job_change_state, job_change_state): Notify subscribed |
| 5074 | processes with notify_job_finished() when in the running (for service) |
| 5075 | or waiting states, just before we drop the cause. |
| 5076 | |
Scott James Remnant | 79c95ff | 2007-03-04 12:30:37 +0000 | [diff] [blame] | 5077 | * upstart/message.h: Add failed, failed_process and exit_status |
| 5078 | arguments to UPSTART_JOB_FINISHED. |
| 5079 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 5080 | Marshal the new arguments. |
| 5081 | * upstart/tests/test_message.c (test_new, my_handler) |
| 5082 | (test_handle): Test the new arguments. |
| 5083 | |
Scott James Remnant | f1091d1 | 2007-03-04 01:09:16 +0000 | [diff] [blame] | 5084 | * upstart/message.h: Update the message types, introducing a more |
| 5085 | structured job message set and replacing the UPSTART_EVENT_JOB_STATUS |
| 5086 | message with UPSTART_EVENT_CAUSED which will be immediately followed |
| 5087 | by an ordinary UPSTART_JOB_STATUS message. |
| 5088 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 5089 | Marshal the new messages. |
| 5090 | * upstart/tests/test_message.c (test_new, my_handler) |
| 5091 | (test_handle): Test the new message types. |
| 5092 | * TODO: Update. |
| 5093 | |
Scott James Remnant | 1553879 | 2007-03-03 15:30:23 +0000 | [diff] [blame] | 5094 | 2007-03-03 Scott James Remnant <scott@netsplit.com> |
| 5095 | |
Scott James Remnant | cd15761 | 2007-03-03 17:09:09 +0000 | [diff] [blame] | 5096 | * TODO: Update. |
| 5097 | |
Scott James Remnant | 8568a06 | 2007-03-03 17:06:43 +0000 | [diff] [blame] | 5098 | * init/cfgfile.c (cfg_parse_exec, cfg_parse_script): Separate out |
| 5099 | the parsing of an exec or script stanza into separate functions, |
| 5100 | seeing as this is quite a common operation. This also means we |
| 5101 | just need to change them in one place now. |
| 5102 | (cfg_parse_process): Function to call either of the above depending |
| 5103 | on the next argument. |
| 5104 | (cfg_stanza_exec): Call cfg_parse_exec instead. |
| 5105 | (cfg_stanza_script): Call cfg_parse_script instead. |
| 5106 | (cfg_stanza_pre_start, cfg_stanza_post_start) |
| 5107 | (cfg_stanza_pre_stop, cfg_stanza_post_stop): Call cfg_parse_process |
| 5108 | with the right arguments instead of doing by hand in each function. |
| 5109 | |
Scott James Remnant | 1553879 | 2007-03-03 15:30:23 +0000 | [diff] [blame] | 5110 | * init/event.c (event_emit_next_id): Split the id assigning code into |
| 5111 | a static inline function for easier modification. |
| 5112 | * init/job.c (job_next_id): Use the same style function here too. |
| 5113 | |
Scott James Remnant | 3d39c7d | 2007-03-02 10:50:14 +0000 | [diff] [blame] | 5114 | 2007-03-02 Scott James Remnant <scott@netsplit.com> |
| 5115 | |
Scott James Remnant | 9c7a911 | 2007-03-02 17:08:46 +0000 | [diff] [blame] | 5116 | * init/event.c (event_emit): Port the slightly more efficient in the |
| 5117 | early case code from job_new. |
| 5118 | |
Scott James Remnant | b61f593 | 2007-03-02 17:06:44 +0000 | [diff] [blame] | 5119 | * init/job.h (Job): Add a unique id to the job structure. |
| 5120 | * init/job.c (job_new): Assign an incrementing id to each new job |
| 5121 | allocated. |
| 5122 | (job_find_by_id): Locate a job by its unique id, sadly not very |
| 5123 | efficient in a hash table ;-) |
| 5124 | (job_name): New hash key function since name isn't the first entry |
| 5125 | anymore. |
| 5126 | (job_init): Change hash key function. |
| 5127 | * init/tests/test_job.c (test_find_by_id): Make sure we can find a |
| 5128 | job by its id. |
| 5129 | |
Scott James Remnant | 5e45316 | 2007-03-02 16:27:57 +0000 | [diff] [blame] | 5130 | * init/job.c (job_change_goal): Return the new instance in that |
| 5131 | circumstance, and clean up a little bit. |
| 5132 | * init/job.h: Update prototype. |
| 5133 | * init/tests/test_job.c (test_change_goal): Update tests. |
| 5134 | |
Scott James Remnant | 3caa9f4 | 2007-03-02 15:09:34 +0000 | [diff] [blame] | 5135 | * init/job.c (job_find_by_name): Skip jobs marked for deletion too. |
| 5136 | * init/tests/test_job.c (test_find_by_name): Update test case. |
| 5137 | |
Scott James Remnant | 0720acf | 2007-03-02 14:58:27 +0000 | [diff] [blame] | 5138 | * init/event.h, init/notify.h, upstart/message.h: Provide C-level names |
| 5139 | for enums, this makes the compiler generate things that gdb can get. |
| 5140 | |
Scott James Remnant | f60ee62 | 2007-03-02 13:13:11 +0000 | [diff] [blame] | 5141 | * init/job.c (job_run_process, job_kill_process, job_kill_timer): |
| 5142 | Change process argument to be a plain ProcessType, this means we |
| 5143 | know exactly which process we're trying to run or kill. |
| 5144 | (job_change_state): Update calls to job_run_process |
| 5145 | and job_kill_process |
| 5146 | * init/tests/test_job.c (test_run_process, test_kill_process): Update |
| 5147 | function calls to just pass a ProcessType in. |
| 5148 | |
Scott James Remnant | db61ca8 | 2007-03-02 13:02:42 +0000 | [diff] [blame] | 5149 | * upstart/enum.h: Rename JobAction to ProcessType. |
| 5150 | * upstart/enum.c (job_action_name): Rename to process_name. |
| 5151 | (job_action_from_name): Rename to process_from_name. |
| 5152 | * upstart/tests/test_enum.c (test_action_name, test_action_from_name): |
| 5153 | Rename and update to match. |
| 5154 | * init/job.c (job_new, job_copy, job_change_state) |
| 5155 | (job_next_state): Change JOB_*_ACTION constants to PROCESS_*. |
| 5156 | (job_find_by_pid): Change JobAction argument to ProcessType. |
| 5157 | (job_emit_event): Call process_name on the failed process. |
| 5158 | (job_child_reaper): Update to use ProcessType instead of JobAction. |
| 5159 | * init/job.h (Job): Change type of failed_process to ProcessType. |
| 5160 | * init/tests/test_job.c (test_find_by_pid): Update to use ProcessType |
| 5161 | instead of JobAction in tests. |
| 5162 | (test_new, test_copy, test_change_goal, test_change_state) |
| 5163 | (test_next_state, test_run_process, test_kill_process) |
| 5164 | (test_child_reaper, test_handle_event_finished): Change JOB_*_ACTION |
| 5165 | constants to PROCESS_* |
| 5166 | * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_script) |
| 5167 | (cfg_stanza_pre_start, cfg_stanza_post_start) |
| 5168 | (cfg_stanza_pre_stop, cfg_stanza_post_stop): Change JOB_*_ACTION |
| 5169 | constants to PROCESS_* |
| 5170 | * init/tests/test_cfgfile.c (test_stanza_exec) |
| 5171 | (test_stanza_script, test_stanza_pre_start) |
| 5172 | (test_stanza_post_start, test_stanza_pre_stop) |
| 5173 | (test_stanza_post_stop, test_read_job, test_watch_dir): Change |
| 5174 | JOB_*_ACTION constants to PROCESS_* |
| 5175 | * init/tests/test_event.c (test_poll): Change JOB_*_ACTION constants |
| 5176 | to PROCESS_* |
| 5177 | * init/tests/test_control.c (test_job_start, test_job_stop): Change |
| 5178 | JOB_*_ACTION constants to PROCESS_* |
| 5179 | |
Scott James Remnant | 4a104b5 | 2007-03-02 12:21:45 +0000 | [diff] [blame] | 5180 | * init/cfgfile.c (cfg_watch_dir): Restore the prefix argument; pass |
| 5181 | as the data pointer to the inotify callbacks and visitor function. |
| 5182 | Change the return value to be the watch structure. |
| 5183 | (cfg_job_name): Add prefix argument and prepend to relative path. |
| 5184 | (cfg_create_modify_handler, cfg_delete_handler, cfg_visitor): Get |
| 5185 | the prefix for the job names from the data pointer and pass to |
| 5186 | cfg_job_name(). |
| 5187 | * init/cfgfile.h: Update prototypes. |
| 5188 | * init/tests/test_cfgfile.c (test_watch_dir): Actually test the |
| 5189 | watch functions. |
| 5190 | * init/main.c (main): Pass NULL for the prefix for the global job |
| 5191 | directory, compare the return value against (void *)-1. |
| 5192 | * TODO: Update. |
| 5193 | |
Scott James Remnant | 002dcda | 2007-03-02 11:05:56 +0000 | [diff] [blame] | 5194 | * init/cfgfile.c (cfg_stanza_on): Drop the simple on stanza. |
| 5195 | * init/tests/test_cfgfile.c (test_stanza_on): Remove test case. |
| 5196 | |
Scott James Remnant | 3d39c7d | 2007-03-02 10:50:14 +0000 | [diff] [blame] | 5197 | * TODO: Update. |
| 5198 | |
Scott James Remnant | bc1ebc0 | 2007-03-01 12:27:09 +0000 | [diff] [blame] | 5199 | 2007-03-01 Scott James Remnant <scott@netsplit.com> |
| 5200 | |
Scott James Remnant | 75914fd | 2007-03-01 19:05:45 +0000 | [diff] [blame] | 5201 | * util/jobs.c (handle_job_status): Drop the process field from the |
| 5202 | output for now. |
| 5203 | * util/events.c (handle_event_job_status): Likewise |
| 5204 | * util/tests/test_jobs.c (test_start_action, test_list_action) |
| 5205 | (test_jobs_action): Drop pid from messages we simulate. |
| 5206 | * util/tests/test_events.c (test_emit_action): Likewise. |
| 5207 | |
Scott James Remnant | 0c68cc1 | 2007-03-01 18:53:23 +0000 | [diff] [blame] | 5208 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 5209 | Remove the pid field from the job status and event job status |
| 5210 | messages. |
| 5211 | * upstart/message.h: Update description of job status and event |
| 5212 | job status message to remove the pid field. |
| 5213 | * upstart/tests/test_message.c (test_new, my_handler) |
| 5214 | (test_handle): Remove checks using the pid field. |
| 5215 | |
Scott James Remnant | d134fe8 | 2007-03-01 18:46:53 +0000 | [diff] [blame] | 5216 | * init/control.c (control_job_start, control_job_stop) |
| 5217 | (control_job_query, control_job_list): Remove the pid field from |
| 5218 | the messages, it'll come back later when we get better message |
| 5219 | formats. |
| 5220 | * init/tests/test_control.c (check_job_status, check_job_waiting) |
| 5221 | (check_job_started, check_job_stopped): Remove checks on the process |
| 5222 | id, since that field is gone from the message. |
| 5223 | (test_job_stop): Use the pid field of the main process. |
| 5224 | (test_job_start): Initialise the main action process. |
| 5225 | |
Scott James Remnant | dd1a674 | 2007-03-01 18:42:42 +0000 | [diff] [blame] | 5226 | * init/notify.c (notify_job, notify_job_event): Remove the pid field |
| 5227 | from the message, it'll come back later when we get better message |
| 5228 | formats. |
| 5229 | * init/tests/test_notify.c (check_job_status) |
| 5230 | (check_event_job_status): Remove checks on the pid, since that field |
| 5231 | is no longer present. |
| 5232 | |
Scott James Remnant | e2ce637 | 2007-03-01 18:37:53 +0000 | [diff] [blame] | 5233 | * init/job.c (job_process_copy): Use job_process_new here, oops. |
| 5234 | |
Scott James Remnant | 8ed70e4 | 2007-03-01 18:34:37 +0000 | [diff] [blame] | 5235 | * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_script) |
| 5236 | (cfg_stanza_pre_start, cfg_stanza_post_start) |
| 5237 | (cfg_stanza_pre_stop, cfg_stanza_post_stop): Use job_process_new |
| 5238 | to allocate process structures and store in the process array. |
| 5239 | * init/tests/test_cfgfile.c (test_read_job, test_stanza_exec) |
| 5240 | (test_stanza_script, test_stanza_pre_start) |
| 5241 | (test_stanza_post_start, test_stanza_pre_stop) |
| 5242 | (test_stanza_post_stop): Update test cases to use process array |
| 5243 | member information. |
| 5244 | |
Scott James Remnant | 42479f9 | 2007-03-01 18:12:34 +0000 | [diff] [blame] | 5245 | * init/tests/test_event.c (test_poll): Update to use newer job process |
| 5246 | array and find the pid under there. |
| 5247 | |
Scott James Remnant | c8f15ac | 2007-03-01 18:03:22 +0000 | [diff] [blame] | 5248 | * init/job.h (Job): Remove the pid and aux_pid fields; replace the |
| 5249 | individual JobProcess pointers with an array of them of a fixed |
| 5250 | minimum size; replace failed_state with failed_process. |
| 5251 | (JobProcess): add a pid field here, so now we can obtain the pid on |
| 5252 | an individual process/action basis rather than global. |
| 5253 | * init/job.c (job_process_new): Function to create a JobProcess |
| 5254 | structure, setting the initial values to FALSE/NULL/0. |
| 5255 | (job_process_copy): Function to copy a JobProcess. |
| 5256 | (job_new): Don't initialise the pid or aux_pid members, initialise |
| 5257 | the process array to a fixed initial size and set the members to NULL, |
| 5258 | initialise the failed_process member to -1. |
| 5259 | (job_copy): Update to use job_process_copy and copy the process array. |
| 5260 | (job_find_by_pid): Look through the process structures in the job's |
| 5261 | process array to find the pid, and optionally return which action it |
| 5262 | was. |
| 5263 | (job_change_state): Call job_kill_process in the JOB_KILLED state if |
| 5264 | we have a main process and that has a pid, pass in the main process. |
| 5265 | (job_next_state): Check the process id of the main process when |
| 5266 | deciding what the next state is for running. |
| 5267 | (job_run_process): Store the process id in the process structure |
| 5268 | (job_kill_process): Accept a process structure and use that to obtain |
| 5269 | the process id we need to send TERM too. Remove the code that forced |
| 5270 | a state change if kill() failed, since we will get a child signal |
| 5271 | anyway and should do it there. |
| 5272 | (job_kill_timer): Likewise, accept a process structure and don't |
| 5273 | forcibly change the state anymore. |
| 5274 | (job_child_reaper): Rewrite to switch based on the action that died, |
| 5275 | rather than the state we were in; assert that the state is what we |
| 5276 | expected. |
| 5277 | (job_emit_event): The argument to the failed event is now the action |
| 5278 | name, rather than the state name; an action of -1 indicates that |
| 5279 | respawn failed. |
| 5280 | * init/tests/test_job.c (test_process_new, test_process_copy): Make |
| 5281 | sure the structure is created and copied properly. |
| 5282 | (test_new, test_copy): Drop checks on the pid and aux_pid members, |
| 5283 | add checks for the process array and pid members of processes. |
| 5284 | (test_find_by_pid): Update test case to make sure we can find the pid |
| 5285 | of any process, returning the action index rather than the process |
| 5286 | pointer. |
| 5287 | (test_run_process, test_kill_process, test_change_goal) |
| 5288 | (test_change_state, test_next_state, test_child_reaper): Update test |
| 5289 | cases to use pid fields inside process structures rather than the |
| 5290 | pid or aux_pid members. |
| 5291 | (test_handle_event, test_handle_event_finished) |
| 5292 | (test_free_deleted): Update to avoid pid field checks. |
| 5293 | |
Scott James Remnant | 4652e3b | 2007-03-01 16:25:56 +0000 | [diff] [blame] | 5294 | * upstart/enum.h (JobAction): Enumeration of different actions. |
| 5295 | * upstart/enum.c (job_action_name, job_action_from_name): Enumeration |
| 5296 | to string conversion functions. |
| 5297 | * upstart/tests/test_enum.c (test_action_name) |
| 5298 | (test_action_from_name): Tests for the new functions. |
| 5299 | |
Scott James Remnant | dc9d790 | 2007-03-01 12:57:37 +0000 | [diff] [blame] | 5300 | * init/cfgfile.c (cfg_read_job): Instead of trying to copy over an |
| 5301 | old job's state and instances into the new one, mark the old job |
| 5302 | as deleted. This ensures we never end up applying a new post-stop |
| 5303 | script to a job started with an old pre-start script, etc. It also |
| 5304 | makes life so much simpler. |
| 5305 | * init/tests/test_cfgfile.c (test_read_job): Update tests to make |
| 5306 | sure the old job is marked for deletion, instead of freed. |
| 5307 | * TODO: Update. |
| 5308 | |
Scott James Remnant | 26a41cf | 2007-03-01 12:50:10 +0000 | [diff] [blame] | 5309 | * init/notify.c (notify_job): Split out notification to processes |
| 5310 | subscribed to the cause event into a new function |
| 5311 | (notify_job_event): We can call this when we change cause. |
| 5312 | * init/job.c (job_change_state): Notify anyone subscribed to the |
| 5313 | job after we've changed the state, rather than before, otherwise |
| 5314 | we won't know the new pids or anything. |
| 5315 | (job_change_cause): Call notify_job_event before changing the cause |
| 5316 | so that subscribers get a final status update. |
| 5317 | * init/tests/test_notify.c (test_job_event): Check the new function. |
| 5318 | * TODO: Update. |
| 5319 | |
Scott James Remnant | bc1ebc0 | 2007-03-01 12:27:09 +0000 | [diff] [blame] | 5320 | * init/cfgfile.c (cfg_stanza_respawn): Remove the shortcut that |
| 5321 | lets you specify "respawn COMMAND". It was confusing as it hid |
| 5322 | the common "[when] exec"/"[when] script" syntax, made it non-obvious |
| 5323 | that "exec" and "respawn" were the same flag, etc. |
| 5324 | * init/tests/test_cfgfile.c (test_stanza_respawn): Update tests. |
| 5325 | (test_stanza_service): Fix test case to not use shortcut. |
| 5326 | * logd/event.d/logd.in: Update to not use respawn shortcut. |
| 5327 | |
Scott James Remnant | b1f3405 | 2007-02-25 09:12:53 +0000 | [diff] [blame] | 5328 | 2007-02-25 Scott James Remnant <scott@netsplit.com> |
| 5329 | |
Scott James Remnant | 43d8f09 | 2007-02-25 12:56:37 +0000 | [diff] [blame] | 5330 | * init/job.c (job_child_reaper): Shift the signal value into the |
| 5331 | higher byte to make it easier to detect, and not stamp over exit |
| 5332 | statuses between 128 and 255. |
| 5333 | (job_emit_event): Detect the signal stored in the new way. |
| 5334 | * init/cfgfile.c (cfg_stanza_normal): Store signal in the higher bytes. |
| 5335 | * init/tests/test_job.c (test_copy, test_change_state) |
| 5336 | (test_child_reaper): Update test cases. |
| 5337 | * init/tests/test_cfgfile.c (test_stanza_normal): Update test. |
| 5338 | |
Scott James Remnant | 8a77b5d | 2007-02-25 11:45:47 +0000 | [diff] [blame] | 5339 | * TODO: Update. |
| 5340 | |
Scott James Remnant | 2c95069 | 2007-02-25 09:13:38 +0000 | [diff] [blame] | 5341 | * init/event.h (PWRSTATUS_EVENT): Add new power-status-changed event. |
| 5342 | * init/main.c (pwd_handler): Handle the SIGPWR signal by generating |
| 5343 | the new event, leave it up to a job to parse the file and do |
| 5344 | whatever it likes. |
| 5345 | |
Scott James Remnant | b1f3405 | 2007-02-25 09:12:53 +0000 | [diff] [blame] | 5346 | * TODO: Update. |
| 5347 | |
Scott James Remnant | 7e3ad17 | 2007-02-13 15:53:39 +0000 | [diff] [blame] | 5348 | 2007-02-13 Scott James Remnant <scott@netsplit.com> |
| 5349 | |
| 5350 | * upstart/tests/test_message.c (test_reader, test_handle_using) |
| 5351 | (test_handle); Usual fix for gcc optimiser thinking that fixed |
| 5352 | for loops might not be. |
| 5353 | * init/tests/test_job.c (test_run_process, test_kill_process): |
| 5354 | Likewise. |
| 5355 | * init/tests/test_notify.c (test_subscription_find): I still don't |
| 5356 | know what a type-punned pointer is, nor why dereferencing such a |
| 5357 | thing would break strict-aliasing rules. |
| 5358 | * init/tests/test_cfgfile.c (test_read_job): More type-punning. |
| 5359 | * util/tests/test_jobs.c (test_start_action): More for-loop action. |
| 5360 | * util/tests/test_events.c (test_emit_action): And again. |
| 5361 | |
Scott James Remnant | 5c89c50 | 2007-02-11 14:08:19 +0000 | [diff] [blame] | 5362 | 2007-02-11 Scott James Remnant <scott@netsplit.com> |
| 5363 | |
Scott James Remnant | 17305e1 | 2007-02-11 18:20:19 +0000 | [diff] [blame] | 5364 | * init/job.c (job_change_goal): We need to be able to stop a running |
| 5365 | job without a process, because that's what a job-as-state is! The |
| 5366 | check was added because job_child_reaper calls job_change_goal and |
| 5367 | then job_change_state immediately after, we should fix that instead. |
| 5368 | (job_child_reaper): If we call job_change_goal while in the running |
| 5369 | state, it will call job_change_state for us; so check for that first |
| 5370 | and don't change the state! |
| 5371 | * init/tests/test_job.c (test_change_goal): Update the test to ensure |
| 5372 | that we can stop a job with no running process. |
| 5373 | |
Scott James Remnant | ddda5f9 | 2007-02-11 14:18:00 +0000 | [diff] [blame] | 5374 | * init/cfgfile.c (cfg_stanza_normalexit): normalexit is inconsistent, |
| 5375 | change to "normal exit" |
| 5376 | * init/tests/test_cfgfile.c (test_stanza_normalexit): Update. |
| 5377 | |
Scott James Remnant | 5c89c50 | 2007-02-11 14:08:19 +0000 | [diff] [blame] | 5378 | * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop) |
| 5379 | (cfg_stanza_pre_start, cfg_stanza_post_start) |
| 5380 | (cfg_stanza_pre_stop, cfg_stanza_post_stop, cfg_stanza_respawn): |
| 5381 | We're not going to allow stanza keywords to be quoted, since this |
| 5382 | gives us an easy way to allow users to make something explicitly |
| 5383 | not a keyword. |
| 5384 | |
Scott James Remnant | 5dd50e3 | 2007-02-10 00:44:44 +0000 | [diff] [blame] | 5385 | 2007-02-10 Scott James Remnant <scott@netsplit.com> |
| 5386 | |
Scott James Remnant | 9675c07 | 2007-02-10 21:36:48 +0000 | [diff] [blame] | 5387 | * configure.ac: Bump version to 0.3.6 |
| 5388 | |
Scott James Remnant | 4e97717 | 2007-02-10 21:24:29 +0000 | [diff] [blame] | 5389 | * configure.ac: Increase version to 0.3.5 |
| 5390 | * NEWS: Update. |
| 5391 | * TODO: Update. |
| 5392 | |
Scott James Remnant | a2f0a54 | 2007-02-10 18:07:26 +0000 | [diff] [blame] | 5393 | * TODO: More notes. |
| 5394 | |
Scott James Remnant | 78456a5 | 2007-02-10 17:46:21 +0000 | [diff] [blame] | 5395 | * TODO: Note an issue with using JobProcess->pid |
| 5396 | |
Scott James Remnant | d11d0fd | 2007-02-10 17:45:17 +0000 | [diff] [blame] | 5397 | * init/cfgfile.c (cfg_stanza_pre_start, cfg_stanza_post_start) |
| 5398 | (cfg_stanza_pre_stop, cfg_stanza_post_stop): Add a needed check |
| 5399 | for a token when parsing "exec". Correct line number we expect |
| 5400 | to see the duplicated value on. Correct expected error for missing |
| 5401 | argument from "Unexpected token" to "Expected token". |
| 5402 | |
| 5403 | * init/tests/test_cfgfile.c (main): Actually invoke the tests for |
| 5404 | the scripts. |
| 5405 | |
Scott James Remnant | 2ebe37b | 2007-02-10 17:35:33 +0000 | [diff] [blame] | 5406 | * init/cfgfile.c (cfg_read_job): Correct type of lineno in error. |
| 5407 | |
Scott James Remnant | 178f3a6 | 2007-02-10 17:34:02 +0000 | [diff] [blame] | 5408 | * TOOD: Minor notify bug |
| 5409 | |
Scott James Remnant | e72695c | 2007-02-10 17:11:26 +0000 | [diff] [blame] | 5410 | * TODO: Big update. |
| 5411 | |
Scott James Remnant | 743c1c1 | 2007-02-10 16:49:17 +0000 | [diff] [blame] | 5412 | * init/tests/test_job.c (test_child_reaper): Make sure that we can |
| 5413 | reap post-start and pre-stop processes, and have only the aux_pid |
| 5414 | changed. Also make sure that if the running process dies while |
| 5415 | in these states, with or without an aux process, that we don't |
| 5416 | transition badly. |
| 5417 | |
Scott James Remnant | a54bfd0 | 2007-02-10 14:33:32 +0000 | [diff] [blame] | 5418 | * init/job.c (job_find_by_pid): Check aux_pid as well. |
| 5419 | * init/tests/test_job.c (test_find_by_pid): Make sure we can find it. |
| 5420 | |
Scott James Remnant | 153e3b5 | 2007-02-10 14:15:47 +0000 | [diff] [blame] | 5421 | * init/job.h (Job): Add an auxiliary pid member. |
| 5422 | * init/job.c (job_new): Initialise the aux_pid member. |
| 5423 | (job_change_state): Run the post-start and pre-stop scripts when we |
| 5424 | enter the state with the same name (assuming they exist). |
| 5425 | (job_run_process): Store the pid in aux_pid when starting the |
| 5426 | post-start or pre-stop processes. |
| 5427 | * init/tests/test_job.c (test_change_state): Add tests for running |
| 5428 | the new post-start and pre-stop scripts; which get their process ids |
| 5429 | stored in aux_pid instead of pid. |
| 5430 | (test_new): Make sure the aux_pid member is initialised properly. |
| 5431 | (test_copy): Make sure the aux_pid member is not copied. |
| 5432 | |
| 5433 | * TODO: Update. |
| 5434 | |
Scott James Remnant | f415d8d | 2007-02-10 13:55:04 +0000 | [diff] [blame] | 5435 | * init/tests/test_job.c (test_change_state): Add a check for the |
| 5436 | daemon stanza holding the job in spawned; we snuck this in a while |
| 5437 | back and never tested it (there's no support to get it out of |
| 5438 | spawned yet). |
| 5439 | |
Scott James Remnant | e9332be | 2007-02-10 13:46:50 +0000 | [diff] [blame] | 5440 | * init/job.h (Job): Add new post_start and pre_stop scripts. |
| 5441 | * init/job.c (job_new): Initialise new scripts to NULL. |
| 5442 | (job_copy): Copy the information from the new scripts over as well. |
| 5443 | * init/tests/test_job.c (test_new): Check they're initialised. |
| 5444 | (test_copy): Check that the information is copied properly. |
| 5445 | * init/cfgfile.c (cfg_stanza_post_start, cfg_stanza_pre_stop): Add |
| 5446 | new script stanza functions for the additional two scripts that |
| 5447 | we want. |
| 5448 | * init/tests/test_cfgfile.c (test_stanza_post_start) |
| 5449 | (test_stanza_pre_stop): Add tests for the new stanzas. |
| 5450 | |
Scott James Remnant | 5dd50e3 | 2007-02-10 00:44:44 +0000 | [diff] [blame] | 5451 | * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_script): Rewrite to |
| 5452 | allocate a JobProcess and parse the command or script into it. |
| 5453 | (cfg_read_job): Fix the long broken assumption that pid_file and |
| 5454 | pid_binary are required for respawn, when they're actually required |
| 5455 | for daemon. |
| 5456 | (cfg_stanza_start, cfg_stanza_stop): Remove script second-level. |
| 5457 | (cfg_stanza_respawn): Parse into the job's process. |
| 5458 | (cfg_stanza_pre_start, cfg_stanza_post_stop): New stanzas for the |
| 5459 | processes alone. |
| 5460 | * init/tests/test_cfgfile.c (test_read_job): Update a few test |
| 5461 | cases to match reality. |
| 5462 | (test_stanza_start, test_stanza_stop): Remove script-related checks. |
| 5463 | |
Scott James Remnant | e885d55 | 2007-02-09 00:01:46 +0000 | [diff] [blame] | 5464 | 2007-02-09 Scott James Remnant <scott@netsplit.com> |
| 5465 | |
Scott James Remnant | 315a80a | 2007-02-09 22:50:00 +0000 | [diff] [blame] | 5466 | * init/tests/test_job.c (test_kill_process): Poll the event queue |
| 5467 | after each test to get rid of the allocated events and make valgrind |
| 5468 | happy. |
| 5469 | * init/tests/test_control.c (test_job_start, test_job_stop) |
| 5470 | (test_event_emit): Poll the event queue after each test to get rid |
| 5471 | of the allocated events, as they make valgrind complain. |
| 5472 | (test_event_emit): Free args and env when done. |
| 5473 | |
Scott James Remnant | 1ada0e2 | 2007-02-09 22:40:51 +0000 | [diff] [blame] | 5474 | * init/job.h (JobName): Drop obsolete structure |
| 5475 | (JobProcess): Add a new structure to represent a single process |
| 5476 | within the job, instead of using two variables to pick either the |
| 5477 | script or command. |
| 5478 | (Job): Change command and script to a single JobProcess called process; |
| 5479 | change start_script and stop_script to a JobProcess called pre_start |
| 5480 | and post_stop respectively. |
| 5481 | * init/job.c (job_new): Initialise new members to NULL. |
| 5482 | (job_copy): Copy the process structures across, including contents. |
| 5483 | (job_change_state): Call job_run_process passing in the structure; |
| 5484 | rather than fiddling with if statements. |
| 5485 | (job_run_script, job_run_command, job_run_process): Combine all of |
| 5486 | these three functions into a single new job_run_process function. |
| 5487 | * init/tests/test_job.c (test_new, test_copy, test_change_goal) |
| 5488 | (test_change_state, test_child_reaper) |
| 5489 | (test_handle_event_finished): Change to using JobProcess for when |
| 5490 | we need to construct a command. |
| 5491 | (test_run_script, test_run_command): Merge into single new |
| 5492 | (test_run_process) function. |
| 5493 | * init/tests/test_event.c (test_poll): Replace command with process. |
| 5494 | * init/tests/test_control.c (test_job_start): Change to using |
| 5495 | JobProcess to specify the command. |
| 5496 | |
Scott James Remnant | c674047 | 2007-02-09 21:16:28 +0000 | [diff] [blame] | 5497 | * init/main.c (main): Run job_free_deleted each time through the |
| 5498 | main loop. |
| 5499 | |
Scott James Remnant | cb46860 | 2007-02-09 21:13:16 +0000 | [diff] [blame] | 5500 | * init/job.c (job_change_goal): Minor tweak to the logic; we may |
| 5501 | have just made the job an instance, that should still let us stop |
| 5502 | the one underneath. |
| 5503 | |
Scott James Remnant | 3fbdda7 | 2007-02-09 21:12:10 +0000 | [diff] [blame] | 5504 | * TODO: Update. |
| 5505 | |
Scott James Remnant | dde96ff | 2007-02-09 21:10:45 +0000 | [diff] [blame] | 5506 | * util/jobs.c (do_job): Always expect a list of replies. |
| 5507 | |
Scott James Remnant | f940995 | 2007-02-09 21:02:18 +0000 | [diff] [blame] | 5508 | * init/control.c (control_job_status, control_job_stop) |
| 5509 | (control_job_query): Reply with information about all instances of |
| 5510 | the job. |
| 5511 | * init/tests/test_control.c (test_job_status, test_job_stop) |
| 5512 | (test_job_query): Make sure we get the list end even for a single job; |
| 5513 | and make sure we get details of all instances attached to the job. |
| 5514 | |
Scott James Remnant | 6cfc8ab | 2007-02-09 20:34:37 +0000 | [diff] [blame] | 5515 | * init/tests/test_job.c (test_change_goal): Check that starting |
| 5516 | an instance job actually starts a new instance of it. |
| 5517 | |
Scott James Remnant | 87c4647 | 2007-02-09 20:05:32 +0000 | [diff] [blame] | 5518 | * init/cfgfile.c (cfg_stanza_limit): Support the word "unlimited" in |
| 5519 | limit arguments for both the soft and hard values. |
| 5520 | * init/tests/test_cfgfile.c (test_stanza_limit): Make sure that we |
| 5521 | can make limits be unlimited. |
| 5522 | |
Scott James Remnant | 22ac92f | 2007-02-09 19:39:42 +0000 | [diff] [blame] | 5523 | * init/event.c (event_copy): Function to copy an event structure. |
| 5524 | * init/event.h: Add prototype. |
| 5525 | * init/tests/test_event.c (test_copy): Make sure we copy the event |
| 5526 | correctly, with or without arguments and/or environment. |
| 5527 | * init/job.c (job_copy): Function to copy a job structure, leaving |
| 5528 | the state as it is. |
| 5529 | * init/job.h: Add prototype. |
| 5530 | * init/tests/test_job.c (test_copy): Make sure that we copy the |
| 5531 | job details whether they are NULL or non-NULL, but don't copy the |
| 5532 | state. |
| 5533 | * init/init.supp: Update supression. |
Scott James Remnant | 099ece2 | 2007-02-09 18:13:51 +0000 | [diff] [blame] | 5534 | * init/job.c (job_find_by_name): If we get a job that's an instance, |
| 5535 | return what it's an instance of. |
| 5536 | * init/tests/test_job.c (test_find_by_name): Restore accidentally |
| 5537 | deleted test function; test that we get the real job, not an instance. |
| 5538 | |
Scott James Remnant | 99e3ecc | 2007-02-09 18:08:45 +0000 | [diff] [blame] | 5539 | * init/job.c (job_new): instance_of is initialised to NULL. |
| 5540 | * init/job.h: Add a new instance_of pointer, pointing to the parent |
| 5541 | that we're an instance of. |
| 5542 | * init/tests/test_job.c (test_new): Check that. |
| 5543 | * init/tests/test_cfgfile.c (test_read_job): Make sure instance_of |
| 5544 | pointers are updated. |
| 5545 | |
Scott James Remnant | 4513fae | 2007-02-09 17:52:32 +0000 | [diff] [blame] | 5546 | * init/job.c (jobs): Store jobs in a hash table. |
| 5547 | (job_new): Add to hash table, not to a list. |
| 5548 | (job_handle_event, job_handle_event_finished, job_detect_stalled) |
| 5549 | (job_free_deleted): Iterate across the hash table, rather than list. |
| 5550 | (job_find_by_name): Use nih_hash_lookup, we keep this function because |
| 5551 | we'll add "is instance or not" smarts soon! |
| 5552 | (job_find_by_pid): Iterate across the entire hash table. |
| 5553 | * init/tests/test_job.c (test_find_by_name): Drop test since this |
| 5554 | function is now gone. |
| 5555 | (test_free_deleted): Can't assume things are in a line now. |
| 5556 | * init/control.c (control_job_list): Iterate the hash table. |
| 5557 | |
Scott James Remnant | 3f9624c | 2007-02-09 17:16:07 +0000 | [diff] [blame] | 5558 | * init/event.c: Don't hide the events list anymore |
| 5559 | * init/event.h: Publish it and the init function. |
| 5560 | * init/job.c: Don't hide the jobs list anymore. |
| 5561 | (job_list): Since we don't hide it, we can drop this. |
| 5562 | * init/job.h: Publish it and the init function. |
| 5563 | * init/notify.c: Don't hide the subscriptions list anymore. |
| 5564 | * init/notify.h: Publish it and the init function. |
| 5565 | * init/control.c (control_job_list): Iterate the job list directly |
| 5566 | * init/tests/test_control.c (test_event_emit): Use the events list |
| 5567 | available to us. |
| 5568 | * init/tests/test_event.c (test_poll): Call job_init directly and |
| 5569 | just use the events list available to us. |
| 5570 | * init/tests/test_job.c (test_new): Call job_init directly. |
| 5571 | (test_change_state): Use the events list available to us. |
| 5572 | * init/tests/test_notify.c (test_unsubscribe): Use the subscriptions |
| 5573 | list available to us. |
| 5574 | |
Scott James Remnant | 9709a8d | 2007-02-09 16:08:21 +0000 | [diff] [blame] | 5575 | * doc/states.dot: Add updated state graph. |
| 5576 | * doc/Makefile.am (EXTRA_DIST): Ship the states diagram. |
| 5577 | (states.png): Include rules to build the png, we'll put it in bzr |
| 5578 | anyway, but this is useful. |
| 5579 | |
Scott James Remnant | 92b0160 | 2007-02-09 15:46:55 +0000 | [diff] [blame] | 5580 | * init/cfgfile.c (cfg_delete_handler): Handle deleted jobs; mark |
| 5581 | the job as deleted, and if it's dormant, invoke a state change. |
| 5582 | |
Scott James Remnant | 9c0215a | 2007-02-09 15:42:20 +0000 | [diff] [blame] | 5583 | * upstart/enum.h: Add a new JOB_DELETED state. |
| 5584 | * upstart/enum.c (job_state_name, job_state_from_name): Add the new |
| 5585 | state to the string functions. |
| 5586 | * upstart/tests/test_enum.c (test_state_name) |
| 5587 | (test_state_from_name): Check the enum works. |
| 5588 | * init/job.c (job_change_goal): New decision; we can start a waiting |
| 5589 | job if it's marked delete (it might be a new instance) -- we'll use |
| 5590 | the new deleted state to decide that we shouldn't. |
| 5591 | (job_change_state): Once we reach waiting, if the job is to be deleted, |
| 5592 | move to the next state. |
| 5593 | (job_next_state): The next state for a waiting job if the goal is stop |
| 5594 | is deleted. We should never call job_next_state () for a deleted job. |
| 5595 | (job_free_deleted): Very simple function, just detects |
| 5596 | deleted jobs and frees them. |
| 5597 | * init/job.h: Add prototype for new function. |
| 5598 | * init/tests/test_job.c (test_change_goal): Update test to use new |
| 5599 | deleted state; and don't even change the goal. |
| 5600 | (test_change_state): Add a check to make sure we end up in deleted. |
| 5601 | (test_next_state): Make sure waiting goes to deleted. |
| 5602 | (test_free_deleted): Check the function. |
| 5603 | |
Scott James Remnant | 07dd5db | 2007-02-09 15:20:25 +0000 | [diff] [blame] | 5604 | * init/job.c (job_change_goal): Don't try and start a job if it's |
| 5605 | marked to be deleted and is just waiting for cleanup. |
| 5606 | * init/tests/test_job.c (test_change_state): Make sure that the cause |
| 5607 | is released when we reach waiting. |
| 5608 | |
Scott James Remnant | a1ade13 | 2007-02-09 15:07:30 +0000 | [diff] [blame] | 5609 | * init/tests/test_cfgfile.c (test_read_job): Make sure that a deleted |
| 5610 | job gets resurrected. |
| 5611 | |
Scott James Remnant | 25873b5 | 2007-02-09 13:35:43 +0000 | [diff] [blame] | 5612 | * init/cfgfile.c (cfg_visitor): Correct number of arguments and call |
| 5613 | to cfg_job_name. |
| 5614 | |
Scott James Remnant | 3b5daf6 | 2007-02-09 13:31:01 +0000 | [diff] [blame] | 5615 | * TODO: Update. |
| 5616 | |
Scott James Remnant | 845c6cb | 2007-02-09 13:29:27 +0000 | [diff] [blame] | 5617 | * init/cfgfile.c (cfg_stanza_daemon): Don't allow arguments anymore. |
| 5618 | * init/tests/test_cfgfile.c (test_stanza_daemon): Update tests. |
| 5619 | |
Scott James Remnant | 1cdc163 | 2007-02-09 13:26:09 +0000 | [diff] [blame] | 5620 | * init/job.c (job_handle_event_finished): Function to unblock all |
| 5621 | jobs blocked on a given event emission. |
| 5622 | (job_new, job_emit_event): Rename blocker to blocked; it's useful for |
| 5623 | testing for truth. |
| 5624 | * init/job.h: Add prototype, rename member. |
| 5625 | * init/tests/test_job.c (test_handle_event_finished): Test it. |
| 5626 | (test_new, test_change_state): Update name here too. |
| 5627 | * init/event.c (event_finished): Call job_handle_event_finished |
| 5628 | function to unblock jobs. |
| 5629 | * init/tests/test_event.c (test_poll): Make sure the job gets |
| 5630 | unblocked; a few other tests have to change since running event_poll |
| 5631 | always unblocks the job if nothing listens to it. |
| 5632 | |
Scott James Remnant | ba5ebb0 | 2007-02-09 04:46:39 +0000 | [diff] [blame] | 5633 | * init/job.c (job_child_reaper): Set failed back to FALSE if |
| 5634 | we're respawning, since we don't want to be failing. |
| 5635 | * init/tests/test_job.c (test_child_reaper): cause will be NULL. |
| 5636 | also free and poll events when done. |
| 5637 | (test_handle_event): pid can never be -1 |
| 5638 | (test_change_state): poll events when done |
| 5639 | |
Scott James Remnant | fd0cc55 | 2007-02-09 04:39:36 +0000 | [diff] [blame] | 5640 | * init/tests/test_job.c (test_child_reaper): Process will always |
| 5641 | be zero on return from reaper. |
| 5642 | |
Scott James Remnant | ef11ca4 | 2007-02-09 04:37:24 +0000 | [diff] [blame] | 5643 | * init/tests/test_job.c (test_child_reaper): Killed doesn't go past |
| 5644 | stopping; it goes to waiting, which will clear the cause. |
| 5645 | |
Scott James Remnant | a503498 | 2007-02-09 04:36:12 +0000 | [diff] [blame] | 5646 | * init/tests/test_job.c (test_child_reaper): Fill in values before |
| 5647 | we test against them. |
| 5648 | |
Scott James Remnant | da1ae31 | 2007-02-09 04:35:33 +0000 | [diff] [blame] | 5649 | * init/tests/test_job.c (test_kill_process): Fix violated assertion |
| 5650 | |
Scott James Remnant | 011e4ae | 2007-02-09 04:35:00 +0000 | [diff] [blame] | 5651 | * init/tests/test_job.c (test_change_state): This should be failed |
| 5652 | because nothing cleared it. |
| 5653 | |
Scott James Remnant | 4f4ea83 | 2007-02-09 04:33:50 +0000 | [diff] [blame] | 5654 | * init/tests/test_job.c (test_change_state): Fix a couple of array |
| 5655 | index problems. |
| 5656 | |
Scott James Remnant | af9b63f | 2007-02-09 04:32:50 +0000 | [diff] [blame] | 5657 | * init/tests/test_job.c (test_change_state): Why set that which |
| 5658 | does not change? |
| 5659 | |
Scott James Remnant | fcc5190 | 2007-02-09 04:30:43 +0000 | [diff] [blame] | 5660 | * init/tests/test_job.c (test_change_state): Add newline to test. |
| 5661 | |
Scott James Remnant | 5f93619 | 2007-02-09 04:29:54 +0000 | [diff] [blame] | 5662 | * init/job.c (job_emit_event): Add the job name as an argument; |
| 5663 | oops. |
| 5664 | |
Scott James Remnant | f89b161 | 2007-02-09 04:28:09 +0000 | [diff] [blame] | 5665 | * init/tests/test_control.c (test_job_stop): Need to kill the process |
| 5666 | ourselves, as we're blocked on an event. |
| 5667 | (test_job_query): Fix wrong value in test. |
| 5668 | (check_job_stopped, test_job_stop, test_unwatch_jobs): Change job |
| 5669 | name to match the test. |
| 5670 | |
Scott James Remnant | 7178e72 | 2007-02-09 04:22:04 +0000 | [diff] [blame] | 5671 | * init/job.c (job_change_state): Must only not enter some states |
| 5672 | with no process now; others like killed actually usually want one! |
| 5673 | |
Scott James Remnant | 851a05c | 2007-02-09 04:18:20 +0000 | [diff] [blame] | 5674 | * init/tests/test_cfgfile.c (test_read_job): Fix test case. |
| 5675 | |
Scott James Remnant | 6c08878 | 2007-02-09 04:13:43 +0000 | [diff] [blame] | 5676 | * init/tests/test_job.c (test_handle_event): Clean up tests. |
| 5677 | (test_detect_stalled): Clean up. |
| 5678 | |
Scott James Remnant | bfcb616 | 2007-02-09 04:08:53 +0000 | [diff] [blame] | 5679 | * init/job.c (job_child_reaper): Update the reaping of the child |
| 5680 | processes; there's a much larger state range for the main process |
| 5681 | now, so that needs to be taken into account. |
| 5682 | * init/tests/test_job.c (test_child_reaper): New test cases. |
| 5683 | |
Scott James Remnant | d7ac93f | 2007-02-09 03:39:00 +0000 | [diff] [blame] | 5684 | * init/job.c (job_next_state): Encapsulate the slightly odd three |
| 5685 | exit states of running in this function, otherwise we'll end up |
| 5686 | special-casing it in places I'd rather not think about. |
| 5687 | (job_change_goal): Only change the state of a running job if it |
| 5688 | has a process. |
| 5689 | * init/tests/test_job.c (test_next_state): Add a test case for the |
| 5690 | dead running job |
| 5691 | (test_change_goal): Add test case for the dead running job |
| 5692 | |
Scott James Remnant | d285b83 | 2007-02-09 02:49:06 +0000 | [diff] [blame] | 5693 | * init/tests/test_job.c (test_change_state): Add test cases for |
| 5694 | the forgotten stopping to killed transition. |
| 5695 | |
Scott James Remnant | 999fc9a | 2007-02-09 02:44:25 +0000 | [diff] [blame] | 5696 | * init/job.c (job_kill_process, job_kill_timer): Just check the pid |
| 5697 | and state, and no longer any need to notify jobs since we're just |
| 5698 | called from one state amongst many. |
| 5699 | (job_change_state): Skip over the killed state if there's no process. |
| 5700 | * init/tests/test_job.c (test_kill_process): Update test cases. |
| 5701 | |
Scott James Remnant | ad01161 | 2007-02-09 02:34:03 +0000 | [diff] [blame] | 5702 | * init/job.c (job_run_process): Simplify a little bit, no need to |
| 5703 | do the state assertions here, just make sure there's no already |
| 5704 | a process running. |
| 5705 | * init/tests/test_job.c (test_run_command, test_run_script): Run |
| 5706 | tests in the spawned state, since that's where we run the primary |
| 5707 | command or script. Drop check for process state since that's no |
| 5708 | longer set. |
| 5709 | |
Scott James Remnant | 8bd1b04 | 2007-02-09 02:27:40 +0000 | [diff] [blame] | 5710 | * init/job.c (job_change_state, job_next_state): Ok, here's the big |
| 5711 | one ... rewrite this to use the new state transitions. This has |
| 5712 | suddenly got a lot simpler and easier to read, this was definitely a |
| 5713 | good idea. |
| 5714 | (job_emit_event): Function to make emission of events easier. |
| 5715 | (job_failed_event): replaces this one which wasn't so easy. |
| 5716 | * init/tests/test_job.c (test_change_state): I can't say how much I |
| 5717 | wasn't looking forwards to rewriting these test cases; anyway, it's |
| 5718 | done now and I hope they're all right; |
| 5719 | (test_next_state): Make sure the state transitions are correct too. |
| 5720 | |
Scott James Remnant | 6aee378 | 2007-02-09 00:45:29 +0000 | [diff] [blame] | 5721 | * init/job.h: Rename is_instance to delete and spawns_instance to |
| 5722 | just instance. |
| 5723 | * init/job.c (job_new): Update. |
| 5724 | * init/tests/test_job.c (test_new): Update. |
| 5725 | * init/cfgfile.c (cfg_stanza_instance): Update. |
| 5726 | * init/tests/test_cfgfile.c (test_stanza_instance): Update. |
| 5727 | |
Scott James Remnant | 535c690 | 2007-02-09 00:43:03 +0000 | [diff] [blame] | 5728 | * init/event.h: Correct the event names. |
| 5729 | |
Scott James Remnant | e2edac9 | 2007-02-09 00:39:24 +0000 | [diff] [blame] | 5730 | * init/job.h: Add blocker event member. |
| 5731 | * init/job.c (job_new): Initialise it to NULL. |
| 5732 | * init/tests/test_job.c (test_new): Check it. |
| 5733 | |
Scott James Remnant | e885d55 | 2007-02-09 00:01:46 +0000 | [diff] [blame] | 5734 | * init/job.c (job_change_goal): Have a stab at this function with the |
| 5735 | new state machine; it gets somewhat simpler (until we introduce the |
| 5736 | second scripts), now we just induce things by a state change. |
| 5737 | * init/tests/test_job.c (test_change_goal): Made easier (for now) |
| 5738 | because we don't need to deal with processes and can just wait to |
| 5739 | be blocked on an event. |
| 5740 | |
Scott James Remnant | 9e13a24 | 2007-02-08 00:24:21 +0000 | [diff] [blame] | 5741 | 2007-02-08 Scott James Remnant <scott@netsplit.com> |
| 5742 | |
Scott James Remnant | 5e469e4 | 2007-02-08 23:49:01 +0000 | [diff] [blame] | 5743 | * init/cfgfile.c (cfg_read_job): Drop check for useless respawn script |
| 5744 | (cfg_stanza_respawn): Drop handling of "respawn script" |
| 5745 | * init/tests/test_cfgfile.c (test_stanza_respawn): Drop the checks |
| 5746 | for "respawn script" |
| 5747 | |
Scott James Remnant | 4fdf755 | 2007-02-08 23:45:34 +0000 | [diff] [blame] | 5748 | * init/job.h: Move things about a bit more; remove respawn_script |
| 5749 | since that state is going away. |
| 5750 | * init/job.c (job_new): Drop initialisation of process_state. |
| 5751 | * init/tests/test_job.c (test_new): Improve the tests. |
| 5752 | |
Scott James Remnant | 3856c63 | 2007-02-08 23:29:17 +0000 | [diff] [blame] | 5753 | * init/main.c (STATE_FD): Remove this define, not used anymore. |
| 5754 | |
Scott James Remnant | bc281c3 | 2007-02-08 23:25:33 +0000 | [diff] [blame] | 5755 | * init/tests/test_event.c (test_poll): Update the event checking |
| 5756 | to match what's likely to happen. |
| 5757 | |
Scott James Remnant | 049b50f | 2007-02-08 23:23:29 +0000 | [diff] [blame] | 5758 | * init/event.h: Remove commented out bit. |
| 5759 | |
Scott James Remnant | 1abebfd | 2007-02-08 23:20:02 +0000 | [diff] [blame] | 5760 | * init/tests/test_notify.c (check_job_status, test_job): Correct |
| 5761 | state usage to match a possible state. |
| 5762 | |
Scott James Remnant | 64bc2a8 | 2007-02-08 22:59:46 +0000 | [diff] [blame] | 5763 | * init/control.c (control_job_start, control_job_stop) |
| 5764 | (control_job_query, control_job_list): Drop process state and |
| 5765 | description from the job status messages we send back. |
| 5766 | * init/tests/test_control.c (test_error_handler) |
| 5767 | (check_job_started, test_job_start, check_job_stopped) |
| 5768 | (check_job_stopping, test_job_query, check_job_starting) |
| 5769 | (test_job_list, test_watch_jobs, test_unwatch_jobs): Remove |
| 5770 | process_state and description, and update usage of job states. |
| 5771 | |
Scott James Remnant | cb178f8 | 2007-02-08 22:47:42 +0000 | [diff] [blame] | 5772 | * init/notify.c (notify_job): Don't include process state or |
| 5773 | description in the job status message anymore. |
| 5774 | * init/tests/test_notify.c (check_job_status, test_job): Update tests |
| 5775 | |
Scott James Remnant | 79cd4bf | 2007-02-08 22:44:46 +0000 | [diff] [blame] | 5776 | * init/cfgfile.c (cfg_read_job): Drop the copying of the process_state |
| 5777 | member, since it doesn't exist anymore. |
| 5778 | * init/tests/test_cfgfile.c (test_read_job): Drop the check too. |
| 5779 | |
Scott James Remnant | 6f0ff59 | 2007-02-08 22:43:04 +0000 | [diff] [blame] | 5780 | * init/job.h (Job): Drop the process_state member. |
| 5781 | |
Scott James Remnant | 56a1fa8 | 2007-02-08 22:40:01 +0000 | [diff] [blame] | 5782 | * util/jobs.c (handle_job_status): Drop the process_state and |
| 5783 | description arguments; output a process id only if it's greater |
| 5784 | than zero. |
| 5785 | * util/tests/test_jobs.c (test_start_action, test_list_action) |
| 5786 | (test_jobs_action): Update tests to use newer states and arguments. |
| 5787 | * util/events.c (handle_event_job_status): Simplify in the same way |
| 5788 | |
Scott James Remnant | ac0c88b | 2007-02-08 22:31:00 +0000 | [diff] [blame] | 5789 | * upstart/message.h: Remove process_state and description from the |
| 5790 | job status event (we already had the foresight to not put them in |
| 5791 | the event job status event). |
| 5792 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 5793 | Update handling of the messages to reduce the arguments. |
| 5794 | * upstart/tests/test_message.c (test_new, my_handler) |
| 5795 | (test_handle): Update the tests for the new job status message. |
| 5796 | |
Scott James Remnant | e76986a | 2007-02-08 22:21:22 +0000 | [diff] [blame] | 5797 | * upstart/enum.h (JobState): Change the job states to the new set |
| 5798 | of states that we've planned. |
| 5799 | (ProcessState): Drop process state entirely; this information is now |
| 5800 | contained in the single JobState field. |
| 5801 | * upstart/enum.c (job_state_name, job_state_from_name): Update |
| 5802 | strings to match the new state names. |
| 5803 | (process_state_name, process_state_from_name): Drop these functions. |
| 5804 | * upstart/tests/test_enum.c (test_state_name) |
| 5805 | (test_state_from_name): Update test cases to match new names. |
| 5806 | (test_process_state_name, test_process_state_from_name): Drop. |
| 5807 | |
Scott James Remnant | 08100e0 | 2007-02-08 17:57:21 +0000 | [diff] [blame] | 5808 | * init/main.c (main): Remove the logd hack for now. |
| 5809 | * init/job.c (job_new): Change the default console to none for now. |
| 5810 | * init/tests/test_job.c (test_new): Update test. |
| 5811 | * init/cfgfile.c (cfg_stanza_console): Can't guard against duplicates |
| 5812 | for a while. |
| 5813 | * init/tests/test_cfgfile.c (test_stanza_console): Comment out dup test |
| 5814 | |
Scott James Remnant | f247adf | 2007-02-08 15:23:43 +0000 | [diff] [blame] | 5815 | * init/cfgfile.c (cfg_read_job): Remove the restriction that there |
| 5816 | must be either an 'exec' or 'script' for a job; jobs without either |
| 5817 | define states others can use. |
| 5818 | * init/tests/test_cfgfile.c (test_read_job): Convert the test to |
| 5819 | a "must work". |
| 5820 | * init/job.c (job_change_state): Remove restriction that we must |
| 5821 | have either a script or a command; having neither should just wedge |
| 5822 | the job at the running rest state. Note that there's no way to get |
| 5823 | it out yet, because we don't force that particular state change. |
| 5824 | * init/tests/test_job.c (test_change_state): Make sure that works. |
| 5825 | |
Scott James Remnant | 920d65b | 2007-02-08 13:49:53 +0000 | [diff] [blame] | 5826 | * init/job.c (job_change_cause): Put the knowledge about how to |
| 5827 | change the cause into a separate function, since it's slightly |
| 5828 | tricky. |
| 5829 | (job_change_goal, job_change_state): Set the cause using the above |
| 5830 | function. |
| 5831 | |
Scott James Remnant | a3bcac1 | 2007-02-08 13:40:53 +0000 | [diff] [blame] | 5832 | * init/job.h (Job): Rename goal_event to cause, also shuffle things |
| 5833 | around so that the state is mostly together. |
| 5834 | * init/job.c, init/process.c, init/notify.c, init/cfgfile.c: Update |
| 5835 | references (and comments) to match the new name. |
| 5836 | * init/tests/test_job.c, init/tests/test_event.c, |
| 5837 | init/tests/test_process.c, init/tests/test_cfgfile.c, |
| 5838 | init/tests/test_notify.c: Likewise. |
| 5839 | |
Scott James Remnant | ef11983 | 2007-02-08 13:24:16 +0000 | [diff] [blame] | 5840 | * init/job.c (job_child_reaper): Don't change the goal event; the |
| 5841 | state changes will handle this. |
| 5842 | (job_change_goal): Only dereference/reference the goal event if we're |
| 5843 | actually changing it. |
| 5844 | * init/tests/test_job.c (test_change_state, test_child_reaper): |
| 5845 | Update tests to not assume that the goal event gets changed. |
| 5846 | (test_kill_process): Eliminate race condition. |
| 5847 | |
Scott James Remnant | 93376ef | 2007-02-08 12:53:53 +0000 | [diff] [blame] | 5848 | * init/job.c (job_child_reaper): Correct some problems with job and |
| 5849 | event failure; we now don't overwrite an existing failure record, |
| 5850 | and don't record failure if the main process failed and the goal was |
| 5851 | stop; since we likely caused it. |
| 5852 | * init/tests/test_job.c (test_child_reaper): More test cases. |
| 5853 | |
Scott James Remnant | c3db81c | 2007-02-08 12:38:19 +0000 | [diff] [blame] | 5854 | * logd/event.d/logd.in: Stop on the new runlevel events, not the |
| 5855 | shutdown event. |
| 5856 | |
Scott James Remnant | e8d263c | 2007-02-08 03:20:30 +0000 | [diff] [blame] | 5857 | * compat/sysv/shutdown.c (shutdown_now): Emit an ordinary runlevel |
| 5858 | change event now; including the INIT_HALT environment variable |
| 5859 | * compat/sysv/man/shutdown.8: Update the manual |
| 5860 | |
Scott James Remnant | 52360ea | 2007-02-08 03:06:40 +0000 | [diff] [blame] | 5861 | * compat/sysv/telinit.c: Now just sends out a runlevel event with |
| 5862 | an argument giving the new runlevel. |
| 5863 | * compat/sysv/man/telinit.8: Update description of the command. |
| 5864 | |
Scott James Remnant | 8662bd0 | 2007-02-08 02:57:56 +0000 | [diff] [blame] | 5865 | * upstart/message.h: Remove the UPSTART_SHUTDOWN message. |
| 5866 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 5867 | Remove handling for the shutdown message. |
| 5868 | * upstart/tests/test_message.c (test_new, test_handle): Remove |
| 5869 | tests against the shutdown message. |
| 5870 | * init/control.c (control_shutdown): Remove the shutdown command |
| 5871 | from the server. |
| 5872 | * init/tests/test_control.c (test_shutdown): Remove tests for it. |
| 5873 | * init/event.h: Remove the shutdown event. |
| 5874 | * util/initctl.c: Remove the shutdown command reference. |
| 5875 | * util/events.c (shutdown_action): Remove the command. |
| 5876 | * util/events.h: Update. |
| 5877 | * util/tests/test_events.c (test_shutdown_action): Remove tests. |
| 5878 | |
Scott James Remnant | 6590660 | 2007-02-08 02:51:39 +0000 | [diff] [blame] | 5879 | * init/job.c (job_detect_idle): Rename to job_detect_stalled |
| 5880 | (job_detect_stalled): Remove the idle state detection |
| 5881 | (job_set_idle_event): Idle event has been removed. |
| 5882 | * init/job.h: Update. |
| 5883 | * init/tests/test_job.c (test_detect_idle): Rename to |
| 5884 | (test_detect_stalled): and remove idle detection tests. |
| 5885 | * init/main.c (main): Replace job_detect_idle with job_detect_stalled |
| 5886 | * init/control.c (control_shutdown): Don't set the idle event. |
| 5887 | * init/tests/test_control.c (test_shutdown): Don't detect the idle |
| 5888 | event (and thus the second event) |
| 5889 | |
Scott James Remnant | b0d99d5 | 2007-02-08 02:40:43 +0000 | [diff] [blame] | 5890 | * init/cfgfile.c (cfg_stanza_service): Parser for service stanza. |
| 5891 | * init/tests/test_cfgfile.c (test_stanza_service): Test the service |
| 5892 | stanza. |
| 5893 | (test_stanza_respawn): Check that respawn implies service. |
| 5894 | * TODO: Update. |
| 5895 | |
| 5896 | * init/job.h (Job): Add a new service member. |
| 5897 | * init/job.c (job_new): Service starts off as false. |
| 5898 | (job_change_state): Check service instead of respawn. |
| 5899 | * init/tests/test_job.c (test_change_state): Check with service |
| 5900 | instead of respawn, since that's what we really mean. |
| 5901 | |
Scott James Remnant | e4ab75c | 2007-02-08 02:28:19 +0000 | [diff] [blame] | 5902 | * init/cfgfile.c (cfg_read_job): Copy a whole bunch more state |
| 5903 | into the newly parsed job. |
| 5904 | * init/job.c (job_run_process): Only output the first error. |
| 5905 | * init/tests/test_cfgfile.c (test_read_job): Make sure important |
| 5906 | things are copied. |
| 5907 | * TODO: Update. |
| 5908 | |
Scott James Remnant | db31c15 | 2007-02-08 02:05:38 +0000 | [diff] [blame] | 5909 | * init/main.c: Restore a much simplified version of the term |
| 5910 | handler that doesn't try and copy across any state. |
| 5911 | |
Scott James Remnant | 517f555 | 2007-02-08 02:02:52 +0000 | [diff] [blame] | 5912 | * compat/sysv/telinit.c: Update call to event_emit; we'll revisit |
| 5913 | this shortly when we get rid of the shutdown event. |
| 5914 | |
Scott James Remnant | 1dc0de5 | 2007-02-08 01:57:34 +0000 | [diff] [blame] | 5915 | * util/events.c (handle_event): Add new id field (but ignore it) |
| 5916 | Functio |
| 5917 | (handle_event_job_status): New function to handle the new event. |
| 5918 | (handle_event_finished): Function to handle the end of the event. |
| 5919 | (emit_action): Send the newer event, and loop over replies until |
| 5920 | we get a finished one. |
| 5921 | * util/tests/test_events.c (test_emit_action): Update tests cases. |
| 5922 | |
Scott James Remnant | d952017 | 2007-02-08 01:18:24 +0000 | [diff] [blame] | 5923 | * init/control.c (control_event_emit): New function to handle the |
| 5924 | new-style emit message. |
| 5925 | * init/tests/test_control.c (test_event_emit): Make sure the new |
| 5926 | message function behaves. |
| 5927 | |
Scott James Remnant | b3e539e | 2007-02-08 01:10:12 +0000 | [diff] [blame] | 5928 | * init/event.c, init/job.c, init/main.c, init/tests/test_event.c, |
| 5929 | init/tests/test_job.c: Completely drop the serialisation code, it's |
| 5930 | getting out of date and in the way. |
| 5931 | |
Scott James Remnant | 71b91fc | 2007-02-08 01:07:56 +0000 | [diff] [blame] | 5932 | * init/event.h: Remove compatibility macros. |
| 5933 | (EventEmission): Drop the callback function; it was too error prone |
| 5934 | to try and do it this way, and we only ever wanted to release a job |
| 5935 | anyway as control requests are better handled through the notify |
| 5936 | interface. |
| 5937 | (EventEmissionCb): Drop unused typedef. |
| 5938 | * init/event.c (event_emit): Drop callback argument. |
| 5939 | (event_finished): Don't call the callback |
| 5940 | * init/tests/test_event.c: Update to avoid callbacks. |
| 5941 | * init/job.c (job_change_state): Convert to using event_emit and |
| 5942 | EventEmission. |
| 5943 | (job_detect_idle): Drop extra arguments to event_emit. |
| 5944 | * init/main.c (main, cad_handler, kbd_handler): Drop extra arguments |
| 5945 | to event_emit. |
| 5946 | * init/control.c (control_shutdown): Use event_emit instead of |
| 5947 | event_queue. |
| 5948 | * init/tests/test_control.c (test_shutdown): Convert to using |
| 5949 | EventEmission. |
| 5950 | (test_watch_events, test_unwatch_events): Drop extra arguments to |
| 5951 | event_emit. |
| 5952 | * init/tests/test_notify.c (test_subscribe_event, test_job) |
| 5953 | (test_event, test_event_finished): Drop extra arguments to event_emit |
| 5954 | * init/tests/test_job.c (test_change_goal, test_change_state) |
| 5955 | (test_run_script, test_child_reaper, test_detect_idle): Drop |
| 5956 | extra arguments to event_emit. |
| 5957 | * init/tests/test_process.c (test_spawn): Drop extra arguments to |
| 5958 | event_emit. |
| 5959 | |
Scott James Remnant | f082fc4 | 2007-02-08 00:50:11 +0000 | [diff] [blame] | 5960 | * TODO: Update. |
| 5961 | |
Scott James Remnant | 716f75c | 2007-02-08 00:49:40 +0000 | [diff] [blame] | 5962 | Rewrite the notification subsystem quite significantly; now we |
| 5963 | have individual functions to subscribe to different types of |
| 5964 | notification, and can even subscribe to individual jobs or events. |
| 5965 | |
| 5966 | * init/notify.c (notify_subscribe_job, notify_subscribe_event) |
| 5967 | (notify_unsubscribe): New subscription and unsubscription functions |
| 5968 | that assume one record per subscription, not process. |
| 5969 | (notify_subscription_find): Function to find a subscription. |
| 5970 | (notify_job): Send a message to anything subscribed to the goal event |
| 5971 | as well. |
| 5972 | (notify_event): Use EventEmission and include the id in the event. |
| 5973 | (notify_event_finished): New function, sends a finished message and |
| 5974 | includes both the id and whether the event failed. |
| 5975 | * init/notify.h (NotifySubscribe): New notify structure that is |
| 5976 | once per subscription, rather than per-process; and allows |
| 5977 | subscription to individual jobs or events. |
| 5978 | * init/tests/test_notify.c (test_subscribe_job) |
| 5979 | (test_subscribe_event, test_unsubscribe): Test the new subscription |
| 5980 | functions, replacing the old |
| 5981 | (test_subscribe): tests. |
| 5982 | (test_subscription_find): Check finding works |
| 5983 | (check_event, test_event): Update to use emissions, and check that the |
| 5984 | id is correct. |
| 5985 | (test_event_finished): Check this one works too |
| 5986 | (check_event_job_status, test_job): Make sure processes subscribed |
| 5987 | via the goal event are notified too. |
| 5988 | * init/event.c (event_pending): Pass the emission directly. |
| 5989 | (event_finished): Notify subscribers that the event has finished. |
| 5990 | * init/control.c (control_error_handler): Call notify_unsubscribe |
| 5991 | (control_watch_jobs, control_unwatch_jobs, control_watch_events) |
| 5992 | (control_unwatch_events): Update to the new subscription API. |
| 5993 | * init/tests/test_control.c (test_error_handler): Use new API |
| 5994 | (test_watch_jobs, test_unwatch_jobs, test_watch_events) |
| 5995 | (test_unwatch_events): Also update these to the new API; use a |
| 5996 | destructor to make sure the subscription is freed. |
| 5997 | |
Scott James Remnant | 9e13a24 | 2007-02-08 00:24:21 +0000 | [diff] [blame] | 5998 | * init/tests/test_process.c: Don't use printf, use TEST_FUNCTION |
| 5999 | |
Scott James Remnant | e627ad4 | 2007-02-07 00:23:57 +0000 | [diff] [blame] | 6000 | 2007-02-07 Scott James Remnant <scott@netsplit.com> |
| 6001 | |
Scott James Remnant | 459aee3 | 2007-02-07 22:44:08 +0000 | [diff] [blame] | 6002 | * upstart/message.h: Allocate new grouped event messages. |
| 6003 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 6004 | Add support for the new grouped event messages. |
| 6005 | * upstart/tests/test_message.c (test_new, test_handle) |
| 6006 | (my_handler): Make sure the new messages are passed correctly. |
| 6007 | |
Scott James Remnant | 1d79215 | 2007-02-07 20:56:01 +0000 | [diff] [blame] | 6008 | * init/job.c (job_change_state): Clear the goal event whenever we |
| 6009 | reach the final rest state of a job (waiting for all jobs, running |
| 6010 | for services). |
| 6011 | * init/tests/test_job.c (test_change_state): Check that the goal |
| 6012 | event goes away at the right times. |
| 6013 | * TODO: Update. |
| 6014 | |
Scott James Remnant | ab17ab9 | 2007-02-07 20:38:01 +0000 | [diff] [blame] | 6015 | * init/tests/test_job.c (test_child_reaper): Make sure that the |
| 6016 | event is marked failed properly |
| 6017 | |
Scott James Remnant | 6d007b8 | 2007-02-07 20:21:54 +0000 | [diff] [blame] | 6018 | * init/job.c (job_start_event, job_stop_event): There's no reason |
| 6019 | for these to exist as seperate functions anymore, especially since |
| 6020 | we want to eventually have some kind of match table. |
| 6021 | (job_handle_event): Perform the iterations and match calls here |
| 6022 | instead, since we just call job_change_goal now. |
| 6023 | * init/job.h: Remove prototypes. |
| 6024 | * init/tests/test_job.c (test_start_event, test_stop_event): Fold into |
| 6025 | (test_handle_event): which now handles all the cases. |
| 6026 | |
Scott James Remnant | 269b7b9 | 2007-02-07 20:04:42 +0000 | [diff] [blame] | 6027 | * init/job.c (job_detect_idle): Call event_emit |
| 6028 | * init/main.c (main, cad_handler, kbd_handler): Call event_emit |
| 6029 | instead of event_queue. |
| 6030 | * init/tests/test_event.c (test_new): Call event_poll |
| 6031 | * init/tests/test_job.c (test_change_state, test_child_reaper) |
| 6032 | (test_detect_idle, test_change_state): Update to use newer event API. |
| 6033 | * TODO: Update. |
| 6034 | |
Scott James Remnant | 80eabbc | 2007-02-07 19:54:27 +0000 | [diff] [blame] | 6035 | * init/job.c (job_start, job_stop): Drop these functions; call |
| 6036 | job_change_goal instead (which is now public). |
| 6037 | (job_change_state, job_child_reaper): Call job_change_goal instead. |
| 6038 | * init/job.h: Update. |
| 6039 | * init/tests/test_job.c (test_start, test_stop): Merge into new |
| 6040 | (test_change_goal): function. |
| 6041 | * init/main.c (main): Call job_change_goal instead of job_start. |
| 6042 | * init/control.c (control_job_start, control_job_stop): Call |
| 6043 | job_change_goal instead. |
| 6044 | |
Scott James Remnant | 4522f4d | 2007-02-07 19:38:19 +0000 | [diff] [blame] | 6045 | * init/tests/test_job.c (test_new, test_change_state) |
Scott James Remnant | 80eabbc | 2007-02-07 19:54:27 +0000 | [diff] [blame] | 6046 | (test_run_script, test_start, test_stop, test_start_event): |
Scott James Remnant | 4522f4d | 2007-02-07 19:38:19 +0000 | [diff] [blame] | 6047 | |
| 6048 | * init/job.h (Job): goal_event is now an EventEmission, and is |
| 6049 | a direct pointer to the one in the events queue, rather than a copy. |
| 6050 | * init/process.c (process_setup_environment): Reference the event |
| 6051 | name and environment through the goal event, not directly. |
| 6052 | * init/job.c (job_run_script): Reference the event name and |
| 6053 | environment through the goal event, not directly. |
| 6054 | (job_change_state, job_child_reaper): Replace direct setting of the |
| 6055 | job goal with a call to job_stop; the process state is always |
| 6056 | PROCESS_NONE in all three cases, so this is completely safe. |
| 6057 | (_job_start, _job_stop): Merge these two functions together into |
| 6058 | (job_change_goal): which behaves a lot more like job_change_state, |
| 6059 | except that it doesn't loop. This handles the changing of the |
| 6060 | emission. |
| 6061 | (job_start, job_start_event, job_stop, job_stop_event): Simplify |
| 6062 | these functions, now they just call job_change_goal passing in |
| 6063 | the emission pointer (or NULL). |
| 6064 | |
Scott James Remnant | b1db7a3 | 2007-02-07 16:33:27 +0000 | [diff] [blame] | 6065 | * init/main.c, init/job.c, init/job.h, init/event.c, init/event.h, |
| 6066 | init/tests/test_job.c, init/tests/test_event.c: Remove state |
| 6067 | serialisation code for the time being; maintaining it is getting |
| 6068 | increasingly harder, and it introduces some major bugs. It will |
| 6069 | get rewritten shortly. |
| 6070 | |
Scott James Remnant | 4216cc8 | 2007-02-07 16:22:47 +0000 | [diff] [blame] | 6071 | * init/event.c (event_pending): Pass the emission directly to |
| 6072 | job_handle_event now. |
| 6073 | * init/job.c (job_handle_event, job_start_event, job_stop_event): |
| 6074 | Deal with event emissions rather than just plain events, the change |
| 6075 | so far doesn't do anything else other than take the structure change. |
| 6076 | * init/job.h: Change prototypes. |
| 6077 | * init/tests/test_job.c (test_start_event, test_stop_event) |
| 6078 | (test_handle_event): Update tests to use emissions. |
| 6079 | |
Scott James Remnant | b2d06d4 | 2007-02-07 15:55:33 +0000 | [diff] [blame] | 6080 | * init/tests/test_event.c (test_read_state, test_write_state): Check |
| 6081 | the passing of the progress information. |
| 6082 | * init/event.c (event_read_state, event_write_state): Add progress |
| 6083 | field to the serialisation (oops). |
| 6084 | |
Scott James Remnant | ab132da | 2007-02-07 15:48:02 +0000 | [diff] [blame] | 6085 | * init/event.h: Add missing attribute for event_read_state. |
| 6086 | * init/cfgfile.h: Add missing attributes. |
| 6087 | * init/main.c (read_state): Don't discard return value. |
| 6088 | * TODO: Update. |
| 6089 | |
Scott James Remnant | fcc9a0d | 2007-02-07 15:41:57 +0000 | [diff] [blame] | 6090 | * init/main.c (read_state): Handle the Emission keyword; also handle |
| 6091 | Event really being an EventEmission. |
| 6092 | * init/event.c (event_emit): Make the next emission id a static global |
| 6093 | (event_read_state, event_write_state): Serialise event emission |
| 6094 | structures, not plain events; also send over the last id we used so |
| 6095 | it appears seamless. This doesn't yet handle the callback/data bit |
| 6096 | of the serialisation, which turns out to be a little tricky ... oops |
| 6097 | * init/event.h: Update. |
| 6098 | * init/tests/test_event.c (test_read_state, test_write_state): Check |
| 6099 | that serialisation is done with EventEmissions instead, and all the |
| 6100 | fields are passed (except callback and data which are ... tricky). |
| 6101 | |
Scott James Remnant | a39da0f | 2007-02-07 13:52:42 +0000 | [diff] [blame] | 6102 | * init/main.c (main): Call event_poll instead of event_queue_run. |
| 6103 | |
Scott James Remnant | e47588c | 2007-02-07 13:50:01 +0000 | [diff] [blame] | 6104 | * init/event.c (event_poll): Add the new function that replaces |
| 6105 | event_queue_run(); handles the new-style event emission structures |
| 6106 | in the list and only returns when there are no non-handling events. |
| 6107 | (event_pending, event_finished): Handling of particular event states |
| 6108 | during poll; split out for readability. |
| 6109 | (event_queue, event_queue_run): Drop these obsolete functions. |
| 6110 | (event_read_state): Force type from event_queue. |
| 6111 | * init/event.h: Add event_poll prototype; remove prototypes of old |
| 6112 | functions, replacing with #defines for now so things still compile. |
| 6113 | * init/tests/test_event.c (test_queue): Drop tests. |
| 6114 | (test_read_state, test_write_state): Force type from event_queue |
| 6115 | Change type we check size of. |
| 6116 | (test_poll): Pretty thoroughly test the new poll function. |
| 6117 | * init/job.c (job_change_state): Force type from event_queue |
| 6118 | * init/control.c (control_event_queue): Force type from event queue |
| 6119 | * init/tests/test_job.c (test_detect_idle): Force type from event_queue |
| 6120 | * init/tests/test_control.c (test_event_queue, test_shutdown): |
| 6121 | Force type from event_queue |
| 6122 | |
Scott James Remnant | 162c2b2 | 2007-02-07 11:32:04 +0000 | [diff] [blame] | 6123 | * init/event.c: Revert to a single list of events with an enum |
| 6124 | (event_emit): Set the progress to pending initially. |
| 6125 | (event_emit_find_by_id): Simplify now it just checks one list |
| 6126 | (event_emit_finished): Function for jobs to call once they've done |
| 6127 | with an event; just sets the progress to finished for the event |
| 6128 | queue to pick up. |
| 6129 | * init/tests/test_event.c (test_emit_finished): Check it. |
| 6130 | |
| 6131 | * init/event.h: Add prototype. |
| 6132 | (EventProgress): Add new enum |
| 6133 | (EventEmission): And add progress member to this structure |
| 6134 | * init/tests/test_event.c (test_emit): Make sure the event is pending |
| 6135 | |
Scott James Remnant | d379a60 | 2007-02-07 10:58:06 +0000 | [diff] [blame] | 6136 | * init/event.c (event_emit_find_by_id): Locate an event emission |
| 6137 | by its id in either the pending or handling queue. |
| 6138 | * init/event.h: Add prototype |
| 6139 | * init/tests/test_event.c (test_emit): Make sure that the emission |
| 6140 | id is unique each time. |
| 6141 | (test_emit_find_by_id): Test the function. |
| 6142 | |
Scott James Remnant | 7282c9a | 2007-02-07 03:14:08 +0000 | [diff] [blame] | 6143 | * init/event.c (event_emit): New function to replace event_queue(); |
| 6144 | returns an EventEmission structure with the details filled in as |
| 6145 | given. |
| 6146 | * init/event.h: Add prototype. |
| 6147 | |
Scott James Remnant | 81cc794 | 2007-02-07 02:54:25 +0000 | [diff] [blame] | 6148 | * init/event.c (event_init): Rename the single events queue to |
| 6149 | pending and add a new handling list. |
| 6150 | |
| 6151 | * init/event.h (EventEmission, EventEmissionCb): Add a new emission |
| 6152 | structure that wraps an event, for use in the queue. |
| 6153 | |
Scott James Remnant | d82109e | 2007-02-07 02:15:39 +0000 | [diff] [blame] | 6154 | * util/tests/test_events.c (test_events_action): Update test now |
| 6155 | that nih_message is more sensible. |
| 6156 | * util/tests/test_jobs.c (test_start_action, test_list_action) |
| 6157 | (test_jobs_action): Update test |
| 6158 | |
Scott James Remnant | e5d3f01 | 2007-02-07 01:59:57 +0000 | [diff] [blame] | 6159 | * util/events.c (emit_action): Actually pass the emit_env array |
| 6160 | * util/tests/test_events.c (test_emit_action): Make sure it does. |
| 6161 | |
| 6162 | * util/initctl.c (main): Catch nih_command_parser() returning a |
| 6163 | negative value to indicate an internal error, and always exit 1. |
| 6164 | |
Scott James Remnant | 2cb9305 | 2007-02-07 01:49:43 +0000 | [diff] [blame] | 6165 | * util/events.c (handle_event): Build up multiple lines to describe |
| 6166 | the event, including its arguments and environment. |
| 6167 | * util/tests/test_events.c (test_events_action): Check the new output |
| 6168 | format is right. |
| 6169 | |
Scott James Remnant | 685644e | 2007-02-07 01:29:28 +0000 | [diff] [blame] | 6170 | * init/main.c (main): Take out inadvertantly leaked debugging code; |
| 6171 | sorry about that. |
| 6172 | |
Scott James Remnant | 5130e6d | 2007-02-07 01:18:38 +0000 | [diff] [blame] | 6173 | * init/job.c (job_child_reaper): Rewrite this to make the logic a |
| 6174 | little easier to follow, and support signals in normalexit. This |
| 6175 | also now applies to deciding whether the job failed, if it did, we |
| 6176 | store that information in the job so the stop and stopped events |
| 6177 | can get it. |
| 6178 | * init/tests/test_job.c (test_child_reaper): Add new test cases for |
| 6179 | the setting of the failed flags. |
| 6180 | |
Scott James Remnant | 18935fe | 2007-02-07 00:38:13 +0000 | [diff] [blame] | 6181 | * init/cfgfile.c (cfg_stanza_normalexit): Allow signal names in the |
| 6182 | arguments, which are added to the normalexit array or'd with 0x80 |
| 6183 | * init/tests/test_cfgfile.c (test_stanza_normalexit): Check that we |
| 6184 | can now parse signal names correctly. |
| 6185 | |
Scott James Remnant | 326c231 | 2007-02-07 00:31:18 +0000 | [diff] [blame] | 6186 | * init/job.c (job_failed_event): Change add to addp to fix leak. |
| 6187 | |
Scott James Remnant | e627ad4 | 2007-02-07 00:23:57 +0000 | [diff] [blame] | 6188 | * init/job.c (job_failed_event): Function to turn an event into one |
| 6189 | that includes all the necessary arguments and environment. |
| 6190 | (job_change_state): Call job_failed_event for the stop and stopped |
| 6191 | events (bit hacky at the moment, will improve later). |
| 6192 | * init/tests/test_job.c (test_change_state): Check that the failed |
| 6193 | events are generated properly. |
| 6194 | |
Scott James Remnant | 2b2b7d1 | 2007-02-06 00:07:28 +0000 | [diff] [blame] | 6195 | 2007-02-06 Scott James Remnant <scott@netsplit.com> |
| 6196 | |
Scott James Remnant | 038ef4d | 2007-02-06 23:46:53 +0000 | [diff] [blame] | 6197 | * init/job.c (job_change_state): Reset the failed member when |
| 6198 | we enter the starting state. |
| 6199 | * init/tests/test_job.c (test_change_state): Make sure that the |
| 6200 | failed member is reset when we enter the starting state. |
| 6201 | |
Scott James Remnant | bd7ad1a | 2007-02-06 23:43:59 +0000 | [diff] [blame] | 6202 | * init/job.h (Job): Add failed, failed_state and exit_status members. |
| 6203 | * init/job.c (job_new): Initialise new members. |
| 6204 | |
Scott James Remnant | ddbf116 | 2007-02-06 23:40:30 +0000 | [diff] [blame] | 6205 | * init/job.c (job_child_reaper): Convert signals to names when |
| 6206 | outputting status messages. |
| 6207 | * init/tests/test_job.c (test_child_reaper): Check that the signal |
| 6208 | name gets converted over. |
| 6209 | |
Scott James Remnant | f11b7dc | 2007-02-06 23:03:48 +0000 | [diff] [blame] | 6210 | * init/event.h (CTRLALTDEL_EVENT): Now we've broken the shared |
| 6211 | namespace of events and jobs, rename the control-alt-delete event |
| 6212 | back to control-alt-delete. |
| 6213 | |
Scott James Remnant | 0ef0d39 | 2007-02-06 23:00:28 +0000 | [diff] [blame] | 6214 | * init/job.c (job_change_state): Replace the events generated as |
| 6215 | part of the job state, named for the job and state, with new state |
| 6216 | events that have the job name as an argument. |
| 6217 | * init/event.h: Define new job event names. |
| 6218 | * init/tests/test_job.c (test_change_state): Make sure the new |
| 6219 | events are correct, with the job name as an argument. |
| 6220 | |
Scott James Remnant | 1416d05 | 2007-02-06 22:42:55 +0000 | [diff] [blame] | 6221 | * init/job.c (job_change_state): Remove the job event; this has |
| 6222 | been repeatedly proved to be confusing. |
| 6223 | * init/tests/test_job.c (test_change_state): Remove checks for the |
| 6224 | job event. |
| 6225 | |
Scott James Remnant | 08146b9 | 2007-02-06 20:45:38 +0000 | [diff] [blame] | 6226 | * util/events.c (emit_action): Pass in extra arguments. |
| 6227 | (env_option): Function to parse an option given an environment |
| 6228 | variable. |
| 6229 | * util/events.h: Add prototype. |
| 6230 | * util/tests/test_events.c (test_emit_action): Make sure that the |
| 6231 | emit action works with no arguments and with arguments. |
| 6232 | (test_events_action): Send back events with the right number of args. |
| 6233 | (test_env_option): Check the env option parser works. |
| 6234 | * util/initctl.c: Give shutdown its own command and options, give |
| 6235 | emit a new -e option. |
Scott James Remnant | e8f3ef9 | 2007-02-06 20:20:33 +0000 | [diff] [blame] | 6236 | |
Scott James Remnant | 7f69c62 | 2007-02-06 20:16:50 +0000 | [diff] [blame] | 6237 | * util/events.c (shutdown_action): Split out from emit, seeing as |
| 6238 | these are going to be different from now on. |
| 6239 | * util/events.h: Add prototype. |
| 6240 | * util/tests/test_events.c (test_shutdown_action): Copy test cases. |
| 6241 | |
Scott James Remnant | ca2df74 | 2007-02-06 20:13:32 +0000 | [diff] [blame] | 6242 | * init/control.c (control_event_queue): Take the arguments and |
| 6243 | environment from the event queue request; and reparent into the |
| 6244 | event. |
| 6245 | * init/tests/test_control.c (test_event_queue): Check that arguments |
| 6246 | and environment are copied across properly. |
| 6247 | |
Scott James Remnant | a30a25f | 2007-02-06 20:08:22 +0000 | [diff] [blame] | 6248 | * init/notify.c (notify_event): Pass in the arguments and environment |
| 6249 | for the event. |
| 6250 | * init/tests/test_notify.c (check_event): Check for event arguments |
| 6251 | and environment from the notify process. |
| 6252 | (test_event): Add arguments and environment to the event we test with |
| 6253 | |
Scott James Remnant | ce51bfb | 2007-02-06 20:04:05 +0000 | [diff] [blame] | 6254 | * upstart/tests/test_message.c (test_new, test_handle): Send |
| 6255 | arguments and environment with the UPSTART_EVENT_QUEUE and |
| 6256 | UPSTART_EVENT messages. |
| 6257 | * upstart/wire.c (upstart_pop_int, upstart_pop_unsigned): Shrink |
| 6258 | only once. |
| 6259 | (upstart_pop_string): Check the length is at least one first, as |
| 6260 | we may just have an 'S'. |
| 6261 | |
| 6262 | * upstart/message.c (upstart_message_new, upstart_message_handle): |
| 6263 | The UPSTART_EVENT and UPSTART_EVENT_QUEUE messages gain new array |
| 6264 | arguments containing the arguments and environment for the event. |
| 6265 | * upstart/message.h: Document the new arguments. |
| 6266 | |
Scott James Remnant | d1a6534 | 2007-02-06 19:25:38 +0000 | [diff] [blame] | 6267 | * util/tests/test_events.c, util/tests/test_jobs.c: Update the |
| 6268 | message format checks here too. |
| 6269 | |
Scott James Remnant | fb45e43 | 2007-02-06 19:07:24 +0000 | [diff] [blame] | 6270 | * upstart/tests/test_wire.c (test_pop_pack): Free the array. |
| 6271 | |
Scott James Remnant | a888203 | 2007-02-06 19:06:44 +0000 | [diff] [blame] | 6272 | * upstart/tests/test_message.c (test_new, test_handle) |
| 6273 | (test_handle_using, test_reader): Update tests to include and |
| 6274 | expect new type markers between each field. |
| 6275 | |
Scott James Remnant | f9663f0 | 2007-02-06 18:58:37 +0000 | [diff] [blame] | 6276 | * upstart/wire.c (upstart_push_int, upstart_push_unsigned): |
| 6277 | Take out silly asserts; it must have room! |
| 6278 | |
Scott James Remnant | c874a94 | 2007-02-06 18:57:34 +0000 | [diff] [blame] | 6279 | * upstart/wire.c (upstart_push_string, upstart_pop_string): Rewrite |
| 6280 | to use a type like the rest of the functions; this removes the strange |
| 6281 | length restriction and allows us to make the pop function |
| 6282 | non-destructive. |
| 6283 | * upstart/tests/test_wire.c (test_push_string): Update. |
| 6284 | (test_pop_string): Update, adding in non-destructive, wrong type |
| 6285 | and insufficient space for type test cases. |
| 6286 | (test_push_array, test_pop_array): These needed updated too, |
| 6287 | changing the string format changed the array format. |
| 6288 | (test_push_pack, test_pop_pack): And obviously the pack format changed. |
| 6289 | |
Scott James Remnant | 9ed5209 | 2007-02-06 18:36:51 +0000 | [diff] [blame] | 6290 | * upstart/wire.c (upstart_pop_header): Make the function |
| 6291 | non-destructive in the face of errors. |
| 6292 | * upstart/tests/test_wire.c (test_pop_header): Make sure that |
| 6293 | invalid headers are non-destructive on error. |
| 6294 | |
Scott James Remnant | dc4436f | 2007-02-06 18:33:27 +0000 | [diff] [blame] | 6295 | * upstart/tests/test_wire.c (test_pop_int, test_pop_unsigned): |
| 6296 | Make sure that insufficient space is non-destructive. |
| 6297 | |
Scott James Remnant | afc5b8c | 2007-02-06 18:32:08 +0000 | [diff] [blame] | 6298 | * upstart/wire.c (upstart_push_int, upstart_pop_int) |
| 6299 | (upstart_push_unsigned, upstart_pop_unsigned): Convert to array-style |
| 6300 | type first format. |
| 6301 | (upstart_push_string, upstart_push_header): Write the length and |
| 6302 | type fields out by hand so they don't get an 'i' prefix. |
| 6303 | (upstart_pop_string, upstart_pop_header): Read the length and type |
| 6304 | fields by hand so they don't get an 'i' prefix. |
| 6305 | * upstart/tests/test_wire.c (test_push_int, test_pop_int) |
| 6306 | (test_push_unsigned, test_pop_unsigned): Update test cases to match. |
| 6307 | (test_push_pack, test_pop_pack): Pack format was changed too. |
| 6308 | |
Scott James Remnant | a63d486 | 2007-02-06 18:10:58 +0000 | [diff] [blame] | 6309 | * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Add calls |
| 6310 | to push and pop array. |
| 6311 | * upstart/tests/test_wire.c (test_push_pack, test_pop_pack): Test |
| 6312 | support for arrays. |
| 6313 | |
Scott James Remnant | 5b6a202 | 2007-02-06 18:00:49 +0000 | [diff] [blame] | 6314 | * upstart/wire.c (upstart_push_array, upstart_pop_array): Implement |
| 6315 | new array functions; note that these use a newer format that allows |
| 6316 | us to transmit NULL without needing to limit the size of the array. |
| 6317 | * upstart/wire.h: Add prototypes. |
| 6318 | * upstart/tests/test_wire.c (test_push_array, test_pop_array): |
| 6319 | Test the new array functions. |
| 6320 | |
Scott James Remnant | f1d5111 | 2007-02-06 16:22:48 +0000 | [diff] [blame] | 6321 | * init/job.c (job_run_script): Build up the argument list, appending |
| 6322 | those from the goal event if one is set. |
| 6323 | (job_run_command): Use nih_str_array_add to build up the arguments, |
| 6324 | but don't append those from the goal event (use script). |
| 6325 | * init/tests/test_job.c (test_run_script): Make sure the arguments get |
| 6326 | passed to the running shell scripts. |
| 6327 | |
Scott James Remnant | 2efe556 | 2007-02-06 15:51:19 +0000 | [diff] [blame] | 6328 | * init/job.c (job_run_script): Only use the /dev/fd trick if we can |
| 6329 | actually stat /dev/fd; also don't hardcode that path ... |
| 6330 | * init/paths.h (DEV_FD): Add here. |
| 6331 | |
Scott James Remnant | efa8c7e | 2007-02-06 15:02:23 +0000 | [diff] [blame] | 6332 | * init/process.c (process_setup_environment): Copy environment |
| 6333 | variables from the goal event into the job's process. |
| 6334 | * init/tests/test_process.c (test_spawn): Make sure the environment |
| 6335 | reaches the job, but doesn't override that in the job already. |
| 6336 | |
| 6337 | * init/tests/test_job.c (test_start_event): |
| 6338 | |
Scott James Remnant | 0071dd3 | 2007-02-06 14:57:37 +0000 | [diff] [blame] | 6339 | * init/job.c (job_start_event, job_stop_event): Copy the arguments |
| 6340 | and environment from the event into the goal event. |
| 6341 | |
Scott James Remnant | b3d4dee | 2007-02-06 14:39:35 +0000 | [diff] [blame] | 6342 | * init/job.c (job_read_state, job_write_state): Read and write |
| 6343 | arguments and environment for goal event. |
| 6344 | * init/tests/test_job.c (test_read_state, test_write_state): Test |
| 6345 | with arguments and environment to the goal event. |
| 6346 | |
Scott James Remnant | 4bba970 | 2007-02-06 14:28:10 +0000 | [diff] [blame] | 6347 | * init/event.c (event_read_state, event_write_state): Read and write |
| 6348 | the arguments and environment of the event. |
| 6349 | * init/tests/test_event.c (test_read_state, test_write_state): Make |
| 6350 | sure arguments and environment are correctly serialised. |
| 6351 | |
Scott James Remnant | 462e717 | 2007-02-06 13:30:24 +0000 | [diff] [blame] | 6352 | * init/cfgfile.c (cfg_stanza_console): Fix a leak of the console |
| 6353 | argument in the case of duplicated options. |
| 6354 | (cfg_stanza_env): Drop the counting now nih_str_array_addp does it; |
| 6355 | and be sure to use that function. |
| 6356 | (cfg_stanza_umask): Fix leak of umask argument |
| 6357 | (cfg_stanza_nice): Fix leak of nice argument |
| 6358 | * init/tests/test_event.c (test_new): Call event_queue_run so init |
| 6359 | is called outside of a TEST_ALLOC_FAIL block. |
| 6360 | |
Scott James Remnant | fd19634 | 2007-02-06 13:19:03 +0000 | [diff] [blame] | 6361 | * init/event.c (event_new): Start off with NULL args and env, to |
| 6362 | match job (saves a few bytes). |
| 6363 | (event_match): Watch for NULL arguments! |
| 6364 | * init/tests/test_event.c (test_new): Check for NULL not alloc'd |
| 6365 | |
Scott James Remnant | fc9a76e | 2007-02-06 13:14:46 +0000 | [diff] [blame] | 6366 | * init/cfgfile.c (cfg_stanza_on, cfg_stanza_start) |
| 6367 | (cfg_stanza_stop): Parse arguments to the on stanza and store them |
| 6368 | directly in the event. |
| 6369 | * init/tests/test_cfgfile.c (test_stanza_on, test_stanza_start) |
| 6370 | (test_stanza_stop): Make sure arguments are parsed into the event. |
| 6371 | |
Scott James Remnant | 5dd1bc9 | 2007-02-06 12:57:50 +0000 | [diff] [blame] | 6372 | * init/event.c (event_new): Use nih_str_array_new. |
| 6373 | * init/cfgfile.c (cfg_stanza_env): Rewrite to use nih_str_array. |
| 6374 | |
Scott James Remnant | 4d0fc0f | 2007-02-06 11:34:41 +0000 | [diff] [blame] | 6375 | * init/job.c (job_run_script): Check the error returned from |
| 6376 | nih_io_reopen; don't just loop. We only ever expect ENOMEM (the |
| 6377 | other error, EBADF, is impossible). |
| 6378 | |
Scott James Remnant | eb8cb14 | 2007-02-06 11:31:27 +0000 | [diff] [blame] | 6379 | * init/job.c (job_change_state): Reset the goal_event to NULL when |
| 6380 | we catch a run-away job (as it's not stopping for the same event |
| 6381 | it started with). |
| 6382 | (job_child_reaper): Reset the goal_event to NULL after setting the |
| 6383 | goal to STOP. |
| 6384 | * init/tests/test_job.c (test_change_state, test_child_reaper): |
| 6385 | Check that the goal event gets reset whenever the goal gets changed. |
| 6386 | |
Scott James Remnant | 62e22f4 | 2007-02-06 02:08:19 +0000 | [diff] [blame] | 6387 | * init/tests/test_event.c: Use TEST_ALLOC_FAIL |
| 6388 | |
Scott James Remnant | 93cd4d2 | 2007-02-06 02:07:45 +0000 | [diff] [blame] | 6389 | * init/event.c (event_match): Match arguments using fnmatch() and |
| 6390 | allow more arguments in event1 than event2 (but not the other way |
| 6391 | around). |
| 6392 | * init/tests/test_event.c (test_match): Check the new permitted |
| 6393 | combinations. |
| 6394 | |
Scott James Remnant | 34b7c71 | 2007-02-06 01:57:45 +0000 | [diff] [blame] | 6395 | * init/event.h (Event): Add args and env members to Event. |
| 6396 | * init/event.c (event_new): Initialise args and env members to |
| 6397 | zero-length arrays. |
| 6398 | * init/tests/test_event.c (test_new): Use TEST_ALLOC_FAIL and |
| 6399 | make sure args and env are both initialised to a list containing |
| 6400 | just NULL. |
| 6401 | |
Scott James Remnant | b36c196 | 2007-02-06 01:48:09 +0000 | [diff] [blame] | 6402 | * util/jobs.c (start_action): Get the UPSTART_JOB environment variable |
| 6403 | and use that if we don't have any arguments passed to us. |
| 6404 | (do_job): Code split from the above function that handles a named job |
| 6405 | * util/tests/test_jobs.c (test_start_action): Make sure UPSTART_JOB |
| 6406 | is picked up. |
| 6407 | |
Scott James Remnant | 2a0b085 | 2007-02-06 01:35:56 +0000 | [diff] [blame] | 6408 | * init/process.h: Add necessary attributes. |
| 6409 | |
Scott James Remnant | 0b10d50 | 2007-02-06 01:28:01 +0000 | [diff] [blame] | 6410 | * init/process.c (process_setup_environment): Set the UPSTART_JOB |
| 6411 | environment variable from the job, and the UPSTART_EVENT environment |
| 6412 | variable from the job's goal_event member (if set). |
| 6413 | * init/tests/test_process.c (test_spawn): Make sure we get the |
| 6414 | environment in the job. |
| 6415 | |
Scott James Remnant | afce528 | 2007-02-06 01:22:54 +0000 | [diff] [blame] | 6416 | * init/job.h: Add attributes to job_new and job_read_state. |
| 6417 | * init/tests/test_job.c: Use CHECK_ALLOC_FAIL on the functions we |
| 6418 | didn't get around to touching while we were in here. |
| 6419 | |
Scott James Remnant | 1b9914d | 2007-02-06 01:01:11 +0000 | [diff] [blame] | 6420 | * init/job.c (job_start_event, job_stop_event): Set the goal_event |
| 6421 | member to a copy of the event we found. |
| 6422 | (job_read_state): Use event_new instead of trying to do it by hand. |
| 6423 | * init/tests/test_job.c (test_start_event, test_stop_event): Use |
| 6424 | CHECK_ALLOC_FAIL; and make sure the goal_event is set properly. |
| 6425 | (test_start, test_stop, test_write_new): Use event_new here too |
| 6426 | |
Scott James Remnant | 9e7d25c | 2007-02-06 00:42:41 +0000 | [diff] [blame] | 6427 | * init/job.c (job_write_state): Output a goal_event field containing |
| 6428 | the event name or nothing for NULL. |
| 6429 | (job_read_state): Parse the goal_event field |
| 6430 | * init/tests/test_job.c (test_write_state): Make sure the state is |
| 6431 | written out properly. |
| 6432 | (test_read_state): Make sure that the state is parsed correctly too. |
| 6433 | |
Scott James Remnant | 7aa22b6 | 2007-02-06 00:32:30 +0000 | [diff] [blame] | 6434 | * init/job.c (job_start, job_stop): Split all of the code except |
| 6435 | the goal_event setting into two new static functions that this calls |
| 6436 | (_job_start, _job_stop): New static functions |
| 6437 | (job_start_event, job_stop_event): Call _job_start and _job_stop |
| 6438 | instead of job_start and job_stop |
| 6439 | |
Scott James Remnant | e4111be | 2007-02-06 00:17:27 +0000 | [diff] [blame] | 6440 | * init/job.c (job_catch_runaway): Move this function up a bit. |
| 6441 | |
Scott James Remnant | 5761ef0 | 2007-02-06 00:15:51 +0000 | [diff] [blame] | 6442 | * init/job.c (job_start, job_stop): Clear the goal_event member, |
| 6443 | these functions are called for a manual start. |
| 6444 | * init/tests/test_job.c (test_start, test_stop): Make sure the |
| 6445 | goal_event member is freed and set to NULL. |
| 6446 | |
Scott James Remnant | 2b2b7d1 | 2007-02-06 00:07:28 +0000 | [diff] [blame] | 6447 | * init/job.h (Job): Add a new goal_event member |
| 6448 | * init/job.c (job_new): Initialise the goal_event member to NULL. |
| 6449 | * init/tests/test_job.c (test_new): Check with TEST_ALLOC_FAIL; |
| 6450 | also make sure goal_event is initialised to NULL. |
| 6451 | |
Scott James Remnant | 506ad09 | 2007-02-05 21:09:30 +0000 | [diff] [blame] | 6452 | 2007-02-05 Scott James Remnant <scott@netsplit.com> |
| 6453 | |
Scott James Remnant | ee7e555 | 2007-02-05 23:14:10 +0000 | [diff] [blame] | 6454 | * configure.ac: Bump version to 0.3.3 |
| 6455 | |
Scott James Remnant | cf64c48 | 2007-02-05 23:14:00 +0000 | [diff] [blame] | 6456 | * NEWS: Update. |
| 6457 | |
Scott James Remnant | 506ad09 | 2007-02-05 21:09:30 +0000 | [diff] [blame] | 6458 | * init/process.c (process_spawn): Exit with 255 so we don't clash |
| 6459 | with anything that uses 1 as a normal exit code. Note why we only |
| 6460 | close 0..2 (everything else is FD_CLOEXEC). |
| 6461 | * init/cfgfile.c (cfg_watch_dir): Mark the inotify watch descriptor |
| 6462 | as FD_CLOEXEC. |
| 6463 | * init/control.c (control_open): nih_io_set_cloexec can only ever |
| 6464 | return EINVAL, so no point checking it. |
| 6465 | |
Scott James Remnant | 0b74ff6 | 2007-02-04 00:43:20 +0000 | [diff] [blame] | 6466 | 2007-02-04 Scott James Remnant <scott@netsplit.com> |
| 6467 | |
| 6468 | * init/tests/test_control.c: Remove strange old code. |
| 6469 | |
Scott James Remnant | 9c44a42 | 2007-02-03 12:17:14 +0000 | [diff] [blame] | 6470 | 2007-02-03 Scott James Remnant <scott@netsplit.com> |
| 6471 | |
Scott James Remnant | 7b61886 | 2007-02-03 23:41:33 +0000 | [diff] [blame] | 6472 | * init/control.c (control_open_sock, control_reopen) |
| 6473 | (control_close_handler): Drop these functions; unconnected datagram |
| 6474 | sockets don't close -- so why try dealing with it? |
| 6475 | (control_error_handler): Don't reopen the socket on error, just log |
| 6476 | it -- the socket should be fine, there's no remote end to be lost, |
| 6477 | after all. |
| 6478 | * init/tests/test_control.c (test_close_handler): Drop. |
| 6479 | (test_error_handler): Drop the reopen tests. |
| 6480 | |
Scott James Remnant | 88c1aac | 2007-02-03 23:26:36 +0000 | [diff] [blame] | 6481 | * init/tests/test_job.c (test_run_script): Control socket doesn't |
| 6482 | get unexpectedly opened anymore; so no need to close it. |
| 6483 | |
| 6484 | * init/control.c (control_open): Remove the strange behaviour that |
| 6485 | this can be called to get the socket. Instead make control_io |
| 6486 | global; we're all adults after all. |
| 6487 | * init/tests/test_control.c (test_open): Remove the test for the |
| 6488 | silly behaviour. |
| 6489 | * init/notify.c (notify_job, notify_event): Use the control_io |
| 6490 | pointer directly, and just do nothing if we lost it somehow. |
| 6491 | |
Scott James Remnant | 2e204b7 | 2007-02-03 23:15:28 +0000 | [diff] [blame] | 6492 | * init/main.c (main): Being unable tp open the control socket, or |
| 6493 | parse the configuration, should be a fatal error; stop being so |
| 6494 | damned liberal! <g> Don't reset the signal state if we're |
| 6495 | being restarted, as this loses any pending signals -- be happy |
| 6496 | that our parent left them in a good state. Set SIGCHLD to the |
| 6497 | standard handler, otherwise we might lose this before we start |
| 6498 | the main loop (which does the same anyway). |
| 6499 | (term_handler): Rework so we don't need to close and open the |
| 6500 | control socket; instead we just close it in the child that's |
| 6501 | going to send the state, and notify the parent that it's safe to |
| 6502 | exec (which will cause it to be closed so the new init can open it). |
| 6503 | |
Scott James Remnant | 3af8546 | 2007-02-03 18:31:54 +0000 | [diff] [blame] | 6504 | * init/tests/test_control.c (test_open): Fix valgrind error |
| 6505 | * init/tests/test_notify.c (test_subscribe): Fix valgrind error |
| 6506 | |
Scott James Remnant | e443b9c | 2007-02-03 18:24:18 +0000 | [diff] [blame] | 6507 | * init/notify.c (notify_subscribe): Make safe against ENOMEM. |
| 6508 | * init/tests/test_notify.c (test_subscribe): Use TEST_ALLOC_FAIL |
| 6509 | |
Scott James Remnant | 4b601d1 | 2007-02-03 18:20:00 +0000 | [diff] [blame] | 6510 | * init/control.c: Add needed attributes; tidy up formatting. |
| 6511 | (control_open): Don't let ENOMEM fail opening the control socket. |
| 6512 | * init/control.h: Add needed attributes. |
| 6513 | * init/tests/test_control.c (test_open): Test for failed allocation. |
| 6514 | * init/main.c (term_handler): Make sure we catch failure to open |
| 6515 | the control socket again. |
| 6516 | |
Scott James Remnant | d308b43 | 2007-02-03 17:36:41 +0000 | [diff] [blame] | 6517 | * TODO: Update |
| 6518 | |
Scott James Remnant | 272938f | 2007-02-03 17:35:11 +0000 | [diff] [blame] | 6519 | * init/cfgfile.c (cfg_watch_dir): Clean this up a bit; now we only |
| 6520 | output a warning if inotify failed for any reason other than not |
| 6521 | being supported AND walking worked. |
| 6522 | |
Scott James Remnant | d78d00e | 2007-02-03 17:27:32 +0000 | [diff] [blame] | 6523 | * init/cfgfile.c (cfg_watch_dir): Update to even newer watch API; |
| 6524 | our create_handler is now always called if inotify is successful, |
| 6525 | so we just need to fall back to walking the directory when it |
| 6526 | isn't -- if inotify isn't supported, don't even bother complaining. |
| 6527 | (cfg_create_modify_handler): Check the stat of the file visited to |
| 6528 | make sure it's a regular file. |
| 6529 | (cfg_visitor): Check the stat of the file visited to make sure it's |
| 6530 | a regular file. |
| 6531 | |
Scott James Remnant | bcbb112 | 2007-02-03 17:11:21 +0000 | [diff] [blame] | 6532 | * init/cfgfile.c: Update include to upstart/enum.h |
| 6533 | * init/job.c: Update include to upstart/enum.h |
| 6534 | * init/job.h: Update include to upstart/enum.h |
| 6535 | |
Scott James Remnant | 801f9e1 | 2007-02-03 17:10:06 +0000 | [diff] [blame] | 6536 | * logd/main.c: Add attribute to open_logging |
| 6537 | |
Scott James Remnant | cbd0cf8 | 2007-02-03 17:05:39 +0000 | [diff] [blame] | 6538 | * util/initctl.c: Split out the command functions into new files; |
| 6539 | * util/jobs.c: This gets the job-related commands |
| 6540 | * util/events.h: This gets the event-related commands |
| 6541 | * util/initctl.h, util/jobs.h, util/events.h: Headers |
| 6542 | * util/tests/test_jobs.c: Test suite for job-related commands. |
| 6543 | * util/tests/test_events.c: Test suite for event-related commands. |
| 6544 | * util/Makefile.am (initctl_SOURCES): Add new files. |
| 6545 | (TESTS): Build new test suites. |
| 6546 | (test_jobs_SOURCES, test_jobs_LDFLAGS, test_jobs_LDADD): |
| 6547 | Details for job-related commands test suite binary. |
| 6548 | (test_events_SOURCES, test_events_LDFLAGS, test_events_LDADD): |
| 6549 | Details for event-related commands test suite binary. |
| 6550 | * TODO: Remove item about splitting initctl now we've done it. |
| 6551 | |
Scott James Remnant | adfcc3f | 2007-02-03 12:24:07 +0000 | [diff] [blame] | 6552 | * TODO: Big update; strip anything we have a spec for. |
| 6553 | |
Scott James Remnant | 1157bbf | 2007-02-03 12:17:55 +0000 | [diff] [blame] | 6554 | * upstart/message.c (upstart_message_handle): Make sure that if we |
| 6555 | fail to parse a message, we don't leave strings around in memory. |
| 6556 | * upstart/tests/test_message.c (test_open): Check that we get a |
| 6557 | raised EADDRINUSE if we try an open a socket twice. |
| 6558 | (test_handle): Add lots of checks for things like NULL names and |
| 6559 | incomplete messages; as well as the obvious unknown message. |
| 6560 | (test_reader): Make sure that errors while handling messages are |
| 6561 | dealt with by logging it. |
| 6562 | |
Scott James Remnant | 9c44a42 | 2007-02-03 12:17:14 +0000 | [diff] [blame] | 6563 | * upstart/job.c, upstart/job.h, upstart/tests/test_job.c: Rename to |
| 6564 | enum.c, enum.h and tests/test_enum.c; since this just includes enums |
| 6565 | and convert functions really. |
| 6566 | * upstart/Makefile.am: Update. |
| 6567 | * upstart/libupstart.h: Update include. |
| 6568 | * upstart/tests/test_message.c: Update include. |
| 6569 | |
Scott James Remnant | 1e57ab2 | 2007-02-01 16:51:28 +0000 | [diff] [blame] | 6570 | 2007-02-01 Scott James Remnant <scott@netsplit.com> |
| 6571 | |
Scott James Remnant | 0f1d9b6 | 2007-02-01 18:20:00 +0000 | [diff] [blame] | 6572 | * logd/main.c (main): Ensure we error if daemonise fails. |
| 6573 | |
Scott James Remnant | 3691157 | 2007-02-01 18:18:27 +0000 | [diff] [blame] | 6574 | * compat/sysv/shutdown.c (main): Ensure that signals and timers |
| 6575 | are added, even if we run out of memory. |
| 6576 | |
Scott James Remnant | 9b705ee | 2007-02-01 17:34:39 +0000 | [diff] [blame] | 6577 | * upstart/tests/test_message.c: Change from assert to assert0 |
| 6578 | * upstart/tests/test_wire.c: Change from assert to assert0 |
| 6579 | * init/tests/test_notify.c: Change from assert to assert0 |
| 6580 | * init/tests/test_control.c: nih_io_message_send should always return |
| 6581 | a value greater than zero. |
| 6582 | |
Scott James Remnant | 91c6eb7 | 2007-02-01 17:19:32 +0000 | [diff] [blame] | 6583 | * upstart/tests/test_wire.c: Change to use assert instead of NIH_ZERO; |
| 6584 | the rationale here is that in test cases we just want to fail, not |
| 6585 | try again repeatedly. |
| 6586 | * upstart/tests/test_message.c: Likewise. |
| 6587 | |
Scott James Remnant | 9caf282 | 2007-02-01 17:04:34 +0000 | [diff] [blame] | 6588 | * init/tests/test_control.c: Use assert to ensure we get the expected |
| 6589 | return values of functions that raise errors. |
| 6590 | * init/tests/test_notify.c: Use assert to ensure we get the expected |
| 6591 | return values of functions that raise errors. |
| 6592 | |
Scott James Remnant | 1e57ab2 | 2007-02-01 16:51:28 +0000 | [diff] [blame] | 6593 | * init/cfgfile.c (cfg_watch_dir): Port to the new NihWatch API and |
| 6594 | use nih_dir_walk(). This also fixes the long-standing bug where we |
| 6595 | wouldn't watch the configuration directory if inotify was disabled. |
| 6596 | Drop both the parent and prefix members for now, until we clean this |
| 6597 | up later. |
| 6598 | (cfg_create_modify_handler): Wrap cfg_read_job after figuring out |
| 6599 | the job name. |
| 6600 | (cfg_job_name): Function to figure out the job name from a path. |
| 6601 | (cfg_visitor): Visitor function to handle initial parsing, figuring |
| 6602 | out the job name; otherwise identical to the standard handler. |
| 6603 | * init/cfgfile.h: Update prototype for cfg_watch_dir. |
| 6604 | * init/main.c (main): Update call to cfg_watch_dir. |
| 6605 | |
Scott James Remnant | bfd712d | 2007-01-31 12:13:25 +0000 | [diff] [blame] | 6606 | 2007-01-31 Scott James Remnant <scott@netsplit.com> |
| 6607 | |
| 6608 | * upstart/tests/test_message.c: Use TEST_ALLOC_FAIL to make sure |
| 6609 | allocations are handled properly. |
| 6610 | |
Scott James Remnant | 4482847 | 2007-01-30 11:53:33 +0000 | [diff] [blame] | 6611 | 2007-01-30 Scott James Remnant <scott@netsplit.com> |
| 6612 | |
Scott James Remnant | 2cc3654 | 2007-01-30 17:12:34 +0000 | [diff] [blame] | 6613 | * upstart/wire.c: Note that if any of the push functions fail, the |
| 6614 | entire buffer should be discarded. |
| 6615 | * upstart/tests/test_wire.c (test_push_int, test_push_unsigned) |
| 6616 | (test_push_string, test_push_header, test_push_pack): Us |
| 6617 | TEST_ALLOC_FAIL to ensure that failing to allocate memory is caught. |
| 6618 | |
Scott James Remnant | 1084c68 | 2007-01-30 15:17:41 +0000 | [diff] [blame] | 6619 | * upstart/tests/test_message.c (my_handler): Free the name and |
| 6620 | description after checking; they aren't otherwise. |
| 6621 | |
Scott James Remnant | dc8b329 | 2007-01-30 15:01:30 +0000 | [diff] [blame] | 6622 | * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Consume |
| 6623 | a copy of the va_list, so these can be called multiple times on the |
| 6624 | same list without ill effect. |
| 6625 | |
Scott James Remnant | 92d8744 | 2007-01-30 15:01:21 +0000 | [diff] [blame] | 6626 | * upstart/message.h: Add warn_unused_result attributes to |
| 6627 | upstart_message_handle and upstart_message_handle_using as they raise |
| 6628 | errors. |
| 6629 | |
Scott James Remnant | 2de2501 | 2007-01-30 14:57:27 +0000 | [diff] [blame] | 6630 | * upstart/wire.c: push functions return negative values to indicate |
| 6631 | insufficient memory. |
| 6632 | * upstart/wire.h: Add warn_unused_result attributes to push functions |
| 6633 | |
Scott James Remnant | 4ccebcf | 2007-01-30 14:51:17 +0000 | [diff] [blame] | 6634 | * upstart/tests/test_message.c: Guard calls to nih_io_buffer_push and |
| 6635 | nih_io_message_add_control with NIH_ZERO to ensure they succeed. |
| 6636 | * upstart/tests/test_wire.c: Guard calls to nih_io_buffer_push |
| 6637 | |
Scott James Remnant | 4482847 | 2007-01-30 11:53:33 +0000 | [diff] [blame] | 6638 | * HACKING: Update from libnih with new Documentation, |
| 6639 | Function Attributes and Test Cases sections. |
| 6640 | |
Scott James Remnant | 16a286f | 2007-01-10 15:38:33 +0000 | [diff] [blame] | 6641 | 2007-01-10 Scott James Remnant <scott@netsplit.com> |
| 6642 | |
Scott James Remnant | de44301 | 2007-01-10 18:45:40 +0000 | [diff] [blame] | 6643 | * init/main.c (crash_handler): s/SEGV/SIGSEGV/ |
| 6644 | |
Scott James Remnant | 505f928 | 2007-01-10 18:44:38 +0000 | [diff] [blame] | 6645 | * init/main.c (main): Rename variable |
| 6646 | |
Scott James Remnant | 56a4d06 | 2007-01-10 17:33:39 +0000 | [diff] [blame] | 6647 | * TODO: Update. |
| 6648 | |
Scott James Remnant | 78626fb | 2007-01-10 16:48:10 +0000 | [diff] [blame] | 6649 | * init/main.c (main): Change the way we clear the arguments; by |
| 6650 | deleting just the final NULL terminator, we fool the kernel into |
| 6651 | only returning one argument in cmdline. |
| 6652 | |
Scott James Remnant | 16a286f | 2007-01-10 15:38:33 +0000 | [diff] [blame] | 6653 | * init/main.c (segv_handler): Rename to crash_handler and handle |
| 6654 | SIGABRT as well, so we can catch assertion errors. Of course, in |
| 6655 | theory, with our high test converage this should never happen in |
| 6656 | practice <chortle> |
| 6657 | |
Scott James Remnant | 39ec35b | 2007-01-09 08:16:01 +0000 | [diff] [blame] | 6658 | 2007-01-09 Scott James Remnant <scott@netsplit.com> |
| 6659 | |
Scott James Remnant | 7f4db42 | 2007-01-09 20:51:08 +0000 | [diff] [blame] | 6660 | * init/main.c (main): Clear arguments so that upstart only ever |
| 6661 | appears as /sbin/init in ps, top, etc. |
| 6662 | |
Scott James Remnant | 8fd06de | 2007-01-09 20:38:27 +0000 | [diff] [blame] | 6663 | * TODO: Update. |
| 6664 | |
Scott James Remnant | 4d0481d | 2007-01-09 20:38:07 +0000 | [diff] [blame] | 6665 | * util/initctl.c: Add data pointer to functions and handle calls. |
| 6666 | |
Scott James Remnant | bcf9e97 | 2007-01-09 20:34:47 +0000 | [diff] [blame] | 6667 | * init/control.c: Add data pointer to all functions. |
| 6668 | * init/tests/test_control.c: Pass data pointer to |
| 6669 | upstart_message_handle_using() |
| 6670 | * init/tests/test_notify.c: Pass data pointer to |
| 6671 | upstart_message_handle_using() |
| 6672 | |
Scott James Remnant | 6aa008c | 2007-01-09 20:26:44 +0000 | [diff] [blame] | 6673 | * upstart/message.c (upstart_message_handle) |
| 6674 | (upstart_message_handle_using): Add a data pointer argument to these |
| 6675 | functions and pass it to the handler. |
| 6676 | (upstart_message_reader): Pass the io structure's data pointer. |
| 6677 | * upstart/message.h (UpstartMessageHandler): Add a data pointer to |
| 6678 | the message handler. |
| 6679 | * upstart/tests/test_message.c (test_handle, test_handle_using): |
| 6680 | Pass a data pointer to the function call and check it's passed |
| 6681 | to the handler correctly. |
| 6682 | (test_reader): Check that the io data pointer gets passed. |
| 6683 | |
Scott James Remnant | c7017d3 | 2007-01-09 18:44:58 +0000 | [diff] [blame] | 6684 | * init/tests/test_cfgfile.c (test_stanza_console, test_stanza_env) |
| 6685 | (test_stanza_umask, test_stanza_nice, test_stanza_limit): Finish off |
| 6686 | the newer style test cases. |
| 6687 | |
Scott James Remnant | e63ef80 | 2007-01-09 17:54:56 +0000 | [diff] [blame] | 6688 | * init/cfgfile.c (cfg_stanza_console, cfg_stanza_umask) |
| 6689 | (cfg_stanza_nice, cfg_stanza_limit, cfg_stanza_chroot) |
| 6690 | (cfg_stanza_chdir): Guard against duplicate uses of the stanzas. |
| 6691 | * init/tests/test_cfgfile.c (test_stanza_daemon) |
| 6692 | (test_stanza_respawn): Check that neither daemon or respawn override |
| 6693 | exec if they have no arguments. |
| 6694 | (test_stanza_script): Add missing function |
| 6695 | (test_stanza_chroot, test_stanza_chdir): Add tests for these simple |
| 6696 | stanzas. |
| 6697 | |
Scott James Remnant | 0cd393d | 2007-01-09 17:36:34 +0000 | [diff] [blame] | 6698 | * init/cfgfile.c: Change remaining uses of nih_error_raise and |
| 6699 | return to just nih_return_error. |
| 6700 | |
Scott James Remnant | c352b63 | 2007-01-09 17:31:41 +0000 | [diff] [blame] | 6701 | * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_daemon) |
| 6702 | (cfg_stanza_respawn, cfg_stanza_script): Disallow duplicates, |
| 6703 | both of command strings, scripts, limits and of just the flags. |
| 6704 | * init/tests/test_cfgfile.c (test_stanza_exec) |
| 6705 | (test_stanza_daemon, test_stanza_respawn, test_stanza_instance): |
| 6706 | Check the behaviour of these stanzas. |
| 6707 | |
Scott James Remnant | 94188d4 | 2007-01-09 16:43:58 +0000 | [diff] [blame] | 6708 | * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop): Disallow |
| 6709 | duplicate values for the script. |
| 6710 | * init/tests/test_cfgfile.c (test_stanza_start, test_stanza_stop): |
| 6711 | Test cases for those two functions. |
| 6712 | |
Scott James Remnant | 474a6ff | 2007-01-09 16:17:49 +0000 | [diff] [blame] | 6713 | * init/cfgfile.c (cfg_stanza_description, cfg_stanza_author) |
| 6714 | (cfg_stanza_version): Don't allow stanza to be duplicated anymore. |
| 6715 | * init/tests/test_cfgfile.c (test_stanza_description) |
| 6716 | (test_stanza_author, test_stanza_version): Test cases for these |
| 6717 | simple stanza; making sure duplication is not permitted. |
| 6718 | (test_stanza_on): Add a test case for this stanza too. |
| 6719 | |
Scott James Remnant | 49e8bb8 | 2007-01-09 15:57:59 +0000 | [diff] [blame] | 6720 | * init/cfgfile.c (cfg_stanza_kill): Guard against duplicate uses |
| 6721 | of the kill timeout stanza. |
| 6722 | * init/tests/test_cfgfile.c (test_stanza_kill): Test the complex |
| 6723 | kill stanza. |
| 6724 | (test_stanza_pid): Check duplicate usage results in an error. |
| 6725 | |
Scott James Remnant | 443ef2e | 2007-01-09 15:47:24 +0000 | [diff] [blame] | 6726 | * init/job.h (Job): Rename pidfile to pid_file and binary to pid_binary |
| 6727 | * init/job.c (job_new): Update names here too. |
| 6728 | * init/errors.h: Add a new "duplicate value" error. |
| 6729 | * init/cfgfile.c (cfg_read_job): Change name of variables, and catch |
| 6730 | the duplicate value error to add the line number. |
| 6731 | (cfg_stanza_pid): Change variable names, and clean this function up |
| 6732 | a little. Make it an error to use a stanza more than once. |
| 6733 | * init/tests/test_cfgfile.c (test_stanza_pid): Write a newer test |
| 6734 | case function for the pid stanza. |
| 6735 | |
Scott James Remnant | 34ff87d | 2007-01-09 09:00:30 +0000 | [diff] [blame] | 6736 | * init/cfgfile.c (cfg_stanza_normalexit): Use do/while instead of |
| 6737 | while, that we don't have to test has_token first as next_arg does |
| 6738 | that for us. |
| 6739 | |
Scott James Remnant | a735469 | 2007-01-09 08:56:02 +0000 | [diff] [blame] | 6740 | * init/cfgfile.c (cfg_stanza_normalexit): Change to peek at the next |
| 6741 | token to see whether it's missing or not, and then just fetch each |
| 6742 | next argument at a time. This is more efficient than parsing them |
| 6743 | all in one go, and also means we can report the error in the right |
| 6744 | place! |
| 6745 | * init/tests/test_cfgfile.c (test_stanza_normalexit): Since we've |
| 6746 | changed the function that parses the stanza, add a proper test case |
| 6747 | function for it, covering all the behaviours. |
| 6748 | |
Scott James Remnant | 92e7fda | 2007-01-09 08:40:13 +0000 | [diff] [blame] | 6749 | * init/job.c (job_new): Initialise the emits member to an empty list. |
| 6750 | * init/job.h (Job): Add the emits member as a list. |
| 6751 | * init/tests/test_job.c (test_new): Check the emits list starts off |
| 6752 | empty. |
| 6753 | * init/tests/test_cfgfile.c (test_stanza_emits): Test the new emits |
| 6754 | stanza; this function will also serve as a prototype for cleaning up |
| 6755 | the config tests. |
| 6756 | |
| 6757 | * init/cfgfile.c (cfg_stanza_emits): Add function to parse the new |
| 6758 | emits stanza. |
| 6759 | |
Scott James Remnant | 39ec35b | 2007-01-09 08:16:01 +0000 | [diff] [blame] | 6760 | * init/cfgfile.c (cfg_stanza_depends): Remove the depends stanza |
| 6761 | from the configuration file. Dependency support has never been used, |
| 6762 | and is to be replaced by a more flexible event/state configuration |
| 6763 | and blocking on the starting/stopping events. |
| 6764 | * init/tests/test_cfgfile.c: Remove references and tests for the |
| 6765 | depends stanza. |
| 6766 | * init/job.h: Remove the depends list from the job structure. |
| 6767 | * init/job.c (job_new): No depends list to initialise. |
| 6768 | (job_change_state): No dependencies to release |
| 6769 | (job_start): No dependencies to iterate; this removes a particularly |
| 6770 | hairy and complex interaction between state changes. Remove the |
| 6771 | dependency event. |
| 6772 | (job_release_depends): Drop this function. |
| 6773 | * init/tests/test_job.c (test_start, test_stop): Massively simplify |
| 6774 | these tests cases now we don't have dependencies to worry about. |
| 6775 | (test_release_depends): Drop tests |
| 6776 | |
Scott James Remnant | d4f5fb8 | 2007-01-08 23:25:23 +0000 | [diff] [blame] | 6777 | 2007-01-08 Scott James Remnant <scott@netsplit.com> |
| 6778 | |
| 6779 | * init/cfgfile.c: Rewrite using the nih_config API, rather than one |
| 6780 | huge function we now just have seperate handler functions for each |
| 6781 | stanza. We can also use more fine-grained parsing than slurping |
| 6782 | all args in and counting them. |
| 6783 | (cfg_read_job): Catch exceptions from the configuration parser and |
| 6784 | add the line number where the problem occurred to an output message. |
| 6785 | Parser errors are now fatal, and not ignored. |
| 6786 | * init/errors.h: Add a file containing errors raised within the init |
| 6787 | daemon codebase. |
| 6788 | * init/Makefile.am (init_SOURCES): Build with errors.h |
| 6789 | * init/tests/test_cfgfile.c: Update test cases now we don't expect |
| 6790 | a job to be returned if there's a parser error. |
| 6791 | |
| 6792 | * TODO: Update |
| 6793 | |
Scott James Remnant | 6638420 | 2007-01-06 14:23:18 +0000 | [diff] [blame] | 6794 | 2007-01-06 Scott James Remnant <scott@netsplit.com> |
| 6795 | |
Scott James Remnant | 4f96819 | 2007-01-06 20:31:13 +0000 | [diff] [blame] | 6796 | * logd/main.c (logging_reader): Fix inadvertent shadowing of the |
| 6797 | len parameter. |
| 6798 | |
Scott James Remnant | da10027 | 2007-01-06 20:24:18 +0000 | [diff] [blame] | 6799 | * compat/sysv/telinit.c: Oops, nearly forgot to port this to send |
| 6800 | the messages in the new way. |
| 6801 | * compat/sysv/shutdown.c (shutdown_now): Likewise, port this too. |
| 6802 | |
Scott James Remnant | 83a8652 | 2007-01-06 19:55:38 +0000 | [diff] [blame] | 6803 | * TODO: Update. |
| 6804 | |
Scott James Remnant | 6e94188 | 2007-01-06 14:38:57 +0000 | [diff] [blame] | 6805 | * util/initctl.c (handle_job_status): Output the process argument, |
| 6806 | not the pid argument which contains the origin of the message. |
| 6807 | |
Scott James Remnant | 17d6dca | 2007-01-06 14:33:30 +0000 | [diff] [blame] | 6808 | * upstart/message.c (upstart_message_handle): Raise a new unknown |
| 6809 | message error if we don't have a handler and a new illegal message |
| 6810 | error if the source is illegal. |
| 6811 | * upstart/tests/test_message.c (test_handle): Adjust tests to check |
| 6812 | for the new errors that we raise. |
| 6813 | * upstart/errors.h: Define strings for new errors. |
| 6814 | |
Scott James Remnant | 6638420 | 2007-01-06 14:23:18 +0000 | [diff] [blame] | 6815 | * util/initctl.c: Yet another makeover for this little program, |
| 6816 | port it to the new message/control framework using handler functions |
| 6817 | and NihIoMessage. This starts to make each action function look |
| 6818 | very similar, so there's method to this madness. |
| 6819 | |
Scott James Remnant | b4725d9 | 2007-01-05 13:10:21 +0000 | [diff] [blame] | 6820 | 2007-01-05 Scott James Remnant <scott@netsplit.com> |
| 6821 | |
Scott James Remnant | 3d6bb79 | 2007-01-05 22:33:43 +0000 | [diff] [blame] | 6822 | * logd/main.c (main): Make sure that we add the SIGTERM handler. |
| 6823 | |
Scott James Remnant | efbaafb | 2007-01-05 18:12:15 +0000 | [diff] [blame] | 6824 | * init/tests/test_job.c (test_run_script): This test case relies |
| 6825 | on there only being one file descriptor watch, which won't be true |
| 6826 | if the control socket has been opened because there's a message to |
| 6827 | go out. Make sure it's closed first. |
| 6828 | |
Scott James Remnant | be1941f | 2007-01-05 17:57:59 +0000 | [diff] [blame] | 6829 | * init/init.supp: Update supressions file now that control_init |
| 6830 | has been renamed to notify_init |
| 6831 | |
Scott James Remnant | 71cc4d8 | 2007-01-05 17:53:32 +0000 | [diff] [blame] | 6832 | * init/Makefile.am: Include notify.o from all tests. |
| 6833 | * init/job.c (job_change_state, job_kill_process, job_start) |
| 6834 | (job_stop): Use the new notify_job function name. |
| 6835 | * init/event.c (event_queue_run): Use the new notify_event function |
| 6836 | name. |
| 6837 | |
Scott James Remnant | fea6cb6 | 2007-01-05 17:49:13 +0000 | [diff] [blame] | 6838 | * init/control.c (control_error_handler): Handle ECONNREFUSED now |
| 6839 | that the process id is available to us. |
| 6840 | * init/tests/test_control.c (test_error_handler): Make sure children |
| 6841 | going away is handled properly. |
| 6842 | |
Scott James Remnant | 3dfb213 | 2007-01-05 17:44:48 +0000 | [diff] [blame] | 6843 | * upstart/message.c (upstart_message_new): Store the process id in |
| 6844 | the int_data message field. |
| 6845 | * upstart/tests/test_message.c (test_new): Check the int_data field |
| 6846 | is filled in. |
| 6847 | |
Scott James Remnant | 5d70295 | 2007-01-05 17:21:34 +0000 | [diff] [blame] | 6848 | * init/main.c (main): Guard against various things returning an error |
| 6849 | that we weren't catching. |
| 6850 | |
Scott James Remnant | 601a0e3 | 2007-01-05 17:06:31 +0000 | [diff] [blame] | 6851 | * init/tests/test_notify.c: Whitespace fix. |
| 6852 | |
Scott James Remnant | 15cd086 | 2007-01-05 17:06:20 +0000 | [diff] [blame] | 6853 | * init/control.c (control_watch_jobs, control_unwatch_jobs) |
| 6854 | (control_watch_events, control_unwatch_events): Restore functionality |
| 6855 | to subscribe and unsubscribe from job and event notifications. |
| 6856 | * init/tests/test_control.c (test_watch_jobs, test_unwatch_jobs) |
| 6857 | (test_watch_events, test_unwatch_events): Check that the subscription |
| 6858 | and unsubscription messages work. |
| 6859 | * init/Makefile.am (test_control_LDADD): Link to notify.o |
| 6860 | |
| 6861 | * init/control.c: Drop unused include of upstart/errors.h |
| 6862 | |
Scott James Remnant | 58cef57 | 2007-01-05 16:18:42 +0000 | [diff] [blame] | 6863 | * init/notify.c: Move functions that handle subscription and |
| 6864 | notification from control.c. Other than changing the names, we're |
| 6865 | keeping the API the same for now; expect it to change later when we |
| 6866 | add the ability to subscribe to individual jobs or events. |
| 6867 | (notify_init): initialise the subscriptions list; we don't have a |
| 6868 | separate send queue now that the control I/O is always asynchronous. |
| 6869 | * init/notify.h: Moved notification enum, structure and prototypes |
| 6870 | from control.h, changing the names so they match notify_* in the |
| 6871 | process. |
| 6872 | * init/Makefile.am (init_SOURCES): Build and link notify.c using |
| 6873 | notify.h |
| 6874 | (TESTS): Build the notify test suite binary. |
| 6875 | (test_notify_SOURCES, test_notify_LDFLAGS, test_notify_LDADD): Details |
| 6876 | for notify test suite binary. |
| 6877 | * init/tests/test_notify.c: Rewrite test cases in the manner of |
| 6878 | test_control.c so that we have one function for notify_job and |
| 6879 | one for notify_event, each of which contains the child process that |
| 6880 | receives the notification, |
| 6881 | |
Scott James Remnant | b1679c6 | 2007-01-05 15:49:54 +0000 | [diff] [blame] | 6882 | * init/control.c (control_open): Allow this to be called to obtain |
| 6883 | the control socket, which means we can make it static. |
| 6884 | * init/tests/test_control.c (test_open): Check that it works. |
| 6885 | |
Scott James Remnant | f7c6b06 | 2007-01-05 15:33:33 +0000 | [diff] [blame] | 6886 | * init/control.c, init/control.h, init/tests/test_control.c: Move |
| 6887 | functions that handle subscription and notification to new notify.c |
| 6888 | (control_init): Drop completely, no need to maintain a send queue now |
| 6889 | (control_open): Change to return an NihIo that uses the default |
| 6890 | control watcher, and our error handler. Split socket opening into |
| 6891 | (control_open_sock): which can be called from other functions. |
| 6892 | (control_close): Use nih_io_close() to close the socket and free the |
| 6893 | structure in one go. |
| 6894 | (control_reopen): Close the open control socket and open it again |
| 6895 | without destroying the NihIo structure, its queues or state. |
| 6896 | (control_close_handler): Handle the control socket going away |
| 6897 | (control_error_handler): Handle errors on the control socket, |
| 6898 | including the connection refused error that indicates a client went |
| 6899 | away. |
| 6900 | (control_handle): Split this into a miriad of small functions with |
| 6901 | a table to link them to the message type; this will make expanding |
| 6902 | each message handler much easier in future. |
| 6903 | * init/control.h: Update. |
| 6904 | * init/tests/test_control.c: Rewrite test cases to check the new |
| 6905 | handler functions; as a side-effect, this gets rid of the evil giant |
| 6906 | child/parent functions in favour of one test function per handler |
| 6907 | function. |
| 6908 | |
Scott James Remnant | b4725d9 | 2007-01-05 13:10:21 +0000 | [diff] [blame] | 6909 | * upstart/message.c (upstart_message_handle_using): Wrapper function |
| 6910 | around upstart_message_handle that ensures all messages as passed to |
| 6911 | a single function. |
| 6912 | * upstart/message.h: Update. |
| 6913 | * upstart/tests/test_message.c (test_handle_using): Make sure it |
| 6914 | calls the single function. |
| 6915 | |
Scott James Remnant | de3666f | 2007-01-04 23:00:07 +0000 | [diff] [blame] | 6916 | 2007-01-04 Scott James Remnant <scott@netsplit.com> |
| 6917 | |
| 6918 | * upstart/message.c (upstart_message_reader): Handle any errors |
| 6919 | that occurred while handling the message. |
| 6920 | |
Scott James Remnant | 92feed9 | 2007-01-02 15:27:47 +0000 | [diff] [blame] | 6921 | 2007-01-02 Scott James Remnant <scott@netsplit.com> |
| 6922 | |
Scott James Remnant | 7833bbf | 2007-01-02 20:57:23 +0000 | [diff] [blame] | 6923 | * upstart/message.c (upstart_message_handle): Check that the name |
| 6924 | argument is never NULL. |
| 6925 | (upstart_message_reader): Simple message reader function that can |
| 6926 | be associated with an I/O watch and handles each message received. |
| 6927 | * upstart/message.h: Add prototype. |
| 6928 | * upstart/tests/test_message.c (test_reader): Test the reader function. |
| 6929 | |
Scott James Remnant | 0e3b5fe | 2007-01-02 18:39:03 +0000 | [diff] [blame] | 6930 | * upstart/control.c: Rename to upstart/message.c |
| 6931 | * upstart/control.h: Rename to upstart/message.h |
| 6932 | * upstart/tests/test_control.c: Rename to upstart/tests/test_message.c |
| 6933 | * upstart/libupstart.h: Update includes. |
| 6934 | * upstart/wire.c: Include message.h |
| 6935 | * upstart/wire.h: Update includes. |
| 6936 | * upstart/tests/test_wire.c: Update includes. |
| 6937 | * upstart/errors.h: Rename UPSTART_INVALID_MESSAGE to |
| 6938 | UPSTART_MESSAGE_INVALID so that it's prefixed. |
| 6939 | * upstart/Makefile.am (libupstart_la_SOURCES) |
| 6940 | (upstartinclude_HEADERS, TESTS): Update filenames. |
| 6941 | |
Scott James Remnant | 2ad9a04 | 2007-01-02 18:29:49 +0000 | [diff] [blame] | 6942 | * upstart/control.c (upstart_message_new): New function that |
| 6943 | creates an NihIoMessage directly from its arguments, which are a type |
| 6944 | followed by a variable number of args depending on that type. |
| 6945 | (upstart_message_handler): Function to find a handler function for |
| 6946 | a particular message type and origin process. |
| 6947 | (upstart_message_handle): New function that takes an NihIoMessage |
| 6948 | and invokes a handler function with a variable number of args |
| 6949 | depending on the message type. |
| 6950 | (upstart_send_msg, upstart_send_msg_to, upstart_recv_msg): Drop these |
| 6951 | functions, leave it up to the caller to decide whether to send and |
| 6952 | receive the messages synchronously or asynchronously; now that the |
| 6953 | capability is in nih_io_*. |
| 6954 | * upstart/control.h (UpstartMsgType): Rename to UpstartMessageType. |
| 6955 | (UpstartMessageHandler): Function with variable number of arguments |
| 6956 | that handles a message received. |
| 6957 | (UpstartMsg): Drop this structure entirely, we'll encode or decode |
| 6958 | the wire format directly from or into a function call, rather than |
| 6959 | use an intermediate structure to marshal it. |
| 6960 | (UpstartMessage): New structure to make a table that can be passed |
| 6961 | to upstart_message_handle to determine which handler should be called. |
| 6962 | * upstart/tests/test_control.c: Test new behaviour. |
| 6963 | * upstart/wire.c (upstart_push_header, upstart_pop_header): Change |
| 6964 | structure name for type parameter. |
| 6965 | * upstart/wire.h: Update. |
| 6966 | * upstart/tests/test_wire.c: Update. |
| 6967 | |
Scott James Remnant | 92feed9 | 2007-01-02 15:27:47 +0000 | [diff] [blame] | 6968 | * configure.ac (AC_COPYRIGHT): Update copyright to 2007. |
| 6969 | |
Scott James Remnant | 67546d1 | 2006-12-29 13:08:32 +0000 | [diff] [blame] | 6970 | 2006-12-29 Scott James Remnant <scott@netsplit.com> |
| 6971 | |
| 6972 | * upstart/wire.c (upstart_write_int, upstart_write_unsigned) |
| 6973 | (upstart_write_string, upstart_write_header, upstart_write_packv) |
| 6974 | (upstart_write_pack): Rename to *_push_* |
| 6975 | (upstart_read_int, upstart_read_unsigned, upstart_read_string) |
| 6976 | (upstart_read_header, upstart_read_packv, upstart_read_pack): Rename |
| 6977 | to *_pop_*. |
| 6978 | All of the above modified to modify an NihIoMessage structure, |
| 6979 | instead of trying to carry around buffers ourself. |
| 6980 | * upstart/wire.h: Update to match above. |
| 6981 | * upstart/tests/test_wire.c: Update all tests to match the above |
| 6982 | changes. |
| 6983 | |
Scott James Remnant | d76e8e3 | 2006-12-21 18:34:31 +0000 | [diff] [blame] | 6984 | 2006-12-21 Scott James Remnant <scott@netsplit.com> |
| 6985 | |
Scott James Remnant | f922a98 | 2006-12-21 18:45:30 +0000 | [diff] [blame] | 6986 | * upstart/wire.c (upstart_read_packv, upstart_write_packv): Change |
| 6987 | nih_assert_notreached to nih_assert_not_reached. |
| 6988 | |
Scott James Remnant | d76e8e3 | 2006-12-21 18:34:31 +0000 | [diff] [blame] | 6989 | * init/job.c (job_run_script): Open the NihIo structure in stream mode. |
| 6990 | * logd/main.c (logging_watcher): Open the NihIo structure in |
| 6991 | stream mode. |
| 6992 | (logging_reader): Need to pass the length of the size_t as a pointer |
| 6993 | so that it can be modified if less is read. |
| 6994 | |
Scott James Remnant | a038523 | 2006-12-17 15:21:39 +0000 | [diff] [blame] | 6995 | 2006-12-17 Scott James Remnant <scott@netsplit.com> |
| 6996 | |
Scott James Remnant | 00cc688 | 2006-12-17 19:54:36 +0000 | [diff] [blame] | 6997 | * upstart/wire.c (upstart_write_packv, upstart_write_pack) |
| 6998 | (upstart_read_packv, upstart_read_pack): Functions to write a pack |
| 6999 | of different variables to the stream, or read them from it |
| 7000 | * upstart/wire.h: Add prototypes. |
| 7001 | * upstart/tests/test_wire.c (test_write_pack, test_read_pack): |
| 7002 | Check we can read and write a pack of variables at once. |
| 7003 | |
Scott James Remnant | 518e1c1 | 2006-12-17 18:12:14 +0000 | [diff] [blame] | 7004 | * upstart/wire.c (upstart_write_header, upstart_read_header): Drop |
| 7005 | the version from the header, we'll just keep the protocol always |
| 7006 | backwards compatible. |
| 7007 | * upstart/wire.h: Update. |
| 7008 | * upstart/tests/test_wire.c (test_write_header, test_read_header): |
| 7009 | Check that everything works. |
| 7010 | |
Scott James Remnant | 64e378f | 2006-12-17 17:24:44 +0000 | [diff] [blame] | 7011 | * upstart/wire.c (upstart_write_string, upstart_read_string): |
| 7012 | Transmit the length as an unsigned, and use 0xffffffff to mean NULL |
| 7013 | instead of zero so we can still transmit the empty string. |
| 7014 | * upstart/wire.h: Update. |
| 7015 | * upstart/tests/test_wire.c (test_write_string, test_read_string): |
| 7016 | Tests for the functions to make sure the wire is at it should be. |
| 7017 | |
Scott James Remnant | d6dde95 | 2006-12-17 17:00:56 +0000 | [diff] [blame] | 7018 | * upstart/wire.c (upstart_read_str, upstart_write_str): Rename to |
| 7019 | upstart_read_string and upstart_write_string. |
| 7020 | * upstart/wire.h: Update. |
| 7021 | |
Scott James Remnant | c71ab3b | 2006-12-17 16:58:28 +0000 | [diff] [blame] | 7022 | * upstart/wire.c (upstart_write_unsigned, upstart_read_unsigned): |
| 7023 | Functions to send unsigned values over the wire, which we'll use |
| 7024 | to get a bit extra for the string lengths. |
| 7025 | * upstart/wire.h: Update. |
| 7026 | * upstart/tests/test_wire.c (test_write_unsigned) |
| 7027 | (test_read_unsigned): Test the new functions. |
| 7028 | |
Scott James Remnant | 0218e3a | 2006-12-17 16:39:33 +0000 | [diff] [blame] | 7029 | * upstart/wire.c (upstart_write_ints, upstart_read_ints): Drop |
| 7030 | these functions, we'll go with something far more generic and |
| 7031 | useful. |
| 7032 | * upstart/wire.h: Remove prototypes. |
| 7033 | |
Scott James Remnant | 9ee4430 | 2006-12-17 16:37:59 +0000 | [diff] [blame] | 7034 | * upstart/wire.c (upstart_write_int, upstart_read_int): Transmit |
| 7035 | integers as signed 32-bit values in network byte order. |
| 7036 | * upstart/tests/test_wire.c (test_write_int, test_read_int): Test |
| 7037 | the functions to make sure the wire is at it should be, |
| 7038 | |
Scott James Remnant | 5cef53e | 2006-12-17 15:41:13 +0000 | [diff] [blame] | 7039 | * upstart/control.c (upstart_read_int, upstart_write_int) |
| 7040 | (upstart_read_ints, upstart_write_ints, upstart_read_str) |
| 7041 | (upstart_write_str, upstart_read_header, upstart_write_header): Move |
| 7042 | functions to new wire.c file. |
| 7043 | * upstart/wire.c: Source file to hold wire protocol functions. |
| 7044 | * upstart/wire.h: Prototypes. |
| 7045 | * upstart/tests/test_wire.c: (empty) test suite. |
| 7046 | * upstart/libupstart.h: Include wire.h |
| 7047 | * upstart/Makefile.am (libupstart_la_SOURCES): Build and link wire.c |
| 7048 | (upstartinclude_HEADERS): Install wire.h |
| 7049 | (TESTS): Build and run wire test suite. |
| 7050 | (test_wire_SOURCES, test_wire_LDFLAGS, test_wire_LDADD): Details for |
| 7051 | wire test suite binary. |
| 7052 | |
Scott James Remnant | a038523 | 2006-12-17 15:21:39 +0000 | [diff] [blame] | 7053 | * upstart/control.c (MAGIC): Change to "upstart\n", the final |
| 7054 | character was originally \0 and then was a " " for the 0.2 series. |
| 7055 | * upstart/tests/test_control.c (test_recv_msg): Change to match. |
| 7056 | |
Scott James Remnant | fb9412a | 2006-12-15 18:03:22 +0000 | [diff] [blame] | 7057 | 2006-12-15 Scott James Remnant <scott@netsplit.com> |
| 7058 | |
Scott James Remnant | 2e5fe2b | 2006-12-15 18:27:58 +0000 | [diff] [blame] | 7059 | * util/initctl.c, compat/sysv/telinit.c, compat/sysv/shutdown.c: |
| 7060 | Update all uses of the UpstartMsg structure to avoid the |
| 7061 | intermediate union that no longer exists. |
| 7062 | |
Scott James Remnant | fb52146 | 2006-12-15 18:24:57 +0000 | [diff] [blame] | 7063 | * init/control.c, init/tests/test_control.c: Update all uses of |
| 7064 | the UpstartMsg structure to avoid the intermediate union that no |
| 7065 | longer exists. |
| 7066 | |
Scott James Remnant | 99b9766 | 2006-12-15 18:15:22 +0000 | [diff] [blame] | 7067 | * upstart/control.h: Combine all the previous message structures |
| 7068 | into just one that has all of the fields anyway. |
| 7069 | * upstart/control.c, upstart/tests/test_control.c: Update all uses of |
| 7070 | the UpstartMsg structure to avoid the intermediate union that no |
| 7071 | longer exists. |
| 7072 | |
Scott James Remnant | d452ab1 | 2006-12-15 18:05:23 +0000 | [diff] [blame] | 7073 | * upstart/control.h (UPSTART_API_VERSION): Define API version macro |
| 7074 | to be public. |
| 7075 | * upstart/control.c (MSG_VERSION, upstart_send_msg_to): Replacing the |
| 7076 | previous MSG_VERSION macro here. |
| 7077 | |
Scott James Remnant | fb9412a | 2006-12-15 18:03:22 +0000 | [diff] [blame] | 7078 | * upstart/control.c (upstart_read_int, upstart_write_int) |
| 7079 | (upstart_read_ints, upstart_write_ints, upstart_read_str) |
| 7080 | (upstart_write_str, upstart_read_header, upstart_write_header): |
| 7081 | New functions to replace the old "write a struct" protocol with |
| 7082 | something a little more regimented and supportable. |
| 7083 | (IOVEC_ADD, IOVEC_READ, WireHdr, WireJobPayload, WireJobStatusPayload) |
| 7084 | (WireEventPayload): Remove these structures, use the functions |
| 7085 | instead. |
| 7086 | (upstart_send_msg_to): Call write functions intead of using macros, |
| 7087 | this makes the code somewhat neater. |
| 7088 | (upstart_recv_msg): Call read functions instead of using macros, |
| 7089 | again making the code somewhat neater. |
| 7090 | * upstart/tests/test_control.c (test_recv_msg): Change wire |
| 7091 | tests to match new protocol, and thus actually work properly, |
| 7092 | previously these were endian sensitive. |
| 7093 | |
Scott James Remnant | 27ebd79 | 2006-12-14 11:37:14 +0000 | [diff] [blame] | 7094 | 2006-12-14 Scott James Remnant <scott@netsplit.com> |
| 7095 | |
Scott James Remnant | 136dc6f | 2006-12-14 12:36:43 +0000 | [diff] [blame] | 7096 | * compat/sysv/shutdown.c (wall): Construct the wall message so that |
| 7097 | we don't put \r into a po file; for some reason, gettext hates that |
| 7098 | and bitches about it. Someone's confusing internationalisation with |
| 7099 | operating system portability, I expect. |
| 7100 | |
Scott James Remnant | f334f84 | 2006-12-14 11:46:14 +0000 | [diff] [blame] | 7101 | * util/man/initctl.8: Drop reference to start(8), as that's just |
| 7102 | a symlink to initctl now. |
| 7103 | |
Scott James Remnant | 8884743 | 2006-12-14 11:44:36 +0000 | [diff] [blame] | 7104 | * init/man/init.8: Link to initctl. |
| 7105 | |
Scott James Remnant | f6b237a | 2006-12-14 11:40:49 +0000 | [diff] [blame] | 7106 | * compat/sysv/reboot.c (main): Clear up help text a little. |
| 7107 | |
Scott James Remnant | 3b4b227 | 2006-12-14 11:39:05 +0000 | [diff] [blame] | 7108 | * HACKING: Correct some typos. |
| 7109 | |
Scott James Remnant | 27ebd79 | 2006-12-14 11:37:14 +0000 | [diff] [blame] | 7110 | * configure.ac (AC_INIT): Correct bug reporting address. |
| 7111 | |
Scott James Remnant | 1d8763a | 2006-12-13 17:49:38 +0000 | [diff] [blame] | 7112 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 7113 | |
Scott James Remnant | ecec0fe | 2006-12-13 21:55:28 +0000 | [diff] [blame] | 7114 | * configure.ac: Bump version to 0.3.2 |
| 7115 | |
Scott James Remnant | f642ffa | 2006-12-13 18:24:22 +0000 | [diff] [blame] | 7116 | * NEWS: Update. |
| 7117 | |
Scott James Remnant | 1d8763a | 2006-12-13 17:49:38 +0000 | [diff] [blame] | 7118 | * util/initctl.c (print_job_status): Drop the newline from the |
| 7119 | output. |
| 7120 | |
Scott James Remnant | 567cbdc | 2006-12-13 17:07:58 +0000 | [diff] [blame] | 7121 | 2006-12-13 Alex Smith <alex@alex-smith.me.uk> |
| 7122 | |
| 7123 | * util/initctl.c (print_job_status): Clean up initctl job status |
| 7124 | output, which was badly converted from printf to nih_message. |
| 7125 | |
Scott James Remnant | e2cf639 | 2006-12-13 17:02:20 +0000 | [diff] [blame] | 7126 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 7127 | |
| 7128 | * compat/sysv/man/shutdown.8: Add missing documentation on the |
| 7129 | format of TIME by copying it from --help output. |
| 7130 | |
Scott James Remnant | fec9056 | 2006-12-13 17:00:40 +0000 | [diff] [blame] | 7131 | 2006-12-13 Alex Smith <alex@alex-smith.me.uk> |
| 7132 | |
| 7133 | * init/process.c (process_setup_console): Actually send output to |
| 7134 | /dev/null instead of /dev/console, when CONSOLE_NONE. |
| 7135 | |
Scott James Remnant | f233c9d | 2006-12-13 16:45:35 +0000 | [diff] [blame] | 7136 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 7137 | |
Scott James Remnant | fbf7a5c | 2006-12-13 16:54:42 +0000 | [diff] [blame] | 7138 | * Makefile.am (EXTRA_DIST): Distribute the nih ChangeLog as well. |
| 7139 | |
Scott James Remnant | f233c9d | 2006-12-13 16:45:35 +0000 | [diff] [blame] | 7140 | * init/tests/test_job.c: Port to the new test framework. |
| 7141 | * init/job.c (job_set_idle_event): Fix a slight memory leak, |
| 7142 | repeated setting of the idle event never freed the previous one set. |
| 7143 | |
Scott James Remnant | 1abced4 | 2006-12-12 11:28:49 +0000 | [diff] [blame] | 7144 | 2006-12-12 Scott James Remnant <scott@netsplit.com> |
| 7145 | |
Scott James Remnant | fbad50c | 2006-12-12 18:47:43 +0000 | [diff] [blame] | 7146 | * init/tests/test_cfgfile.c: Port to the new test framework. |
| 7147 | |
Scott James Remnant | ef37223 | 2006-12-12 17:23:05 +0000 | [diff] [blame] | 7148 | * init/tests/test_control.c: Port to the new test framework. |
| 7149 | * init/init.supp: Suppress the list head allocated within control_init. |
| 7150 | |
Scott James Remnant | 2c2e01a | 2006-12-12 17:22:40 +0000 | [diff] [blame] | 7151 | * init/control.c (control_watcher): Need to save the pid when we |
| 7152 | get ECONNREFUSED, otherwise we lose it when we free the message. |
| 7153 | |
Scott James Remnant | 40f7d91 | 2006-12-12 15:31:35 +0000 | [diff] [blame] | 7154 | * init/tests/test_process.c: Port to the new test framework. |
| 7155 | * init/init.supp: Suppress the list head allocated within job_init. |
| 7156 | |
Scott James Remnant | fc45659 | 2006-12-12 14:09:45 +0000 | [diff] [blame] | 7157 | * init/init.supp: Include a valgrind suppressions file. |
| 7158 | * init/Makefile.am (EXTRA_DIST): Distribute the suppressions file. |
| 7159 | |
Scott James Remnant | 96c9b07 | 2006-12-12 14:07:30 +0000 | [diff] [blame] | 7160 | * init/tests/test_event.c: Port to the new test framework. |
| 7161 | |
Scott James Remnant | 237c7f6 | 2006-12-12 13:49:19 +0000 | [diff] [blame] | 7162 | * logd/Makefile.am, util/Makefile.am, compat/sys/Makefile.am |
| 7163 | (AM_CPPFLAGS): Add -I$(srcdir), necessary for testing "programs" |
| 7164 | that don't have usual library path semantics. |
| 7165 | |
Scott James Remnant | 2a35ab9 | 2006-12-12 13:23:10 +0000 | [diff] [blame] | 7166 | * upstart/tests/test_control.c: Port to the new test framework. |
| 7167 | * upstart/control.c (upstart_free): Drop this function, while not |
| 7168 | exposing libnih is a valiant effort, it already slips out because |
| 7169 | of the error handling. |
| 7170 | |
Scott James Remnant | 905dd27 | 2006-12-12 12:38:34 +0000 | [diff] [blame] | 7171 | * upstart/tests/test_job.c: Add missing include. |
| 7172 | |
Scott James Remnant | e77567f | 2006-12-12 12:25:46 +0000 | [diff] [blame] | 7173 | * upstart/tests/test_job.c: Port to the new test framework. |
| 7174 | (test_process_state_name): Check that this returns NULL. |
| 7175 | |
Scott James Remnant | b798306 | 2006-12-12 11:34:49 +0000 | [diff] [blame] | 7176 | * HACKING: Update location of download directory. Document |
| 7177 | requirement that all code have test cases. |
| 7178 | |
Scott James Remnant | 0c577ce | 2006-12-12 11:31:13 +0000 | [diff] [blame] | 7179 | * logd/main.c (open_logging): Likewise. |
| 7180 | |
Scott James Remnant | c654baf | 2006-12-12 11:30:44 +0000 | [diff] [blame] | 7181 | * init/control.c (control_open): No need to set ENOMEM, errno is |
| 7182 | always set anyway. |
| 7183 | |
Scott James Remnant | 1abced4 | 2006-12-12 11:28:49 +0000 | [diff] [blame] | 7184 | * configure.ac (AM_INIT_AUTOMAKE): Include nostdinc so we don't get |
| 7185 | Automake's broken default includes. |
| 7186 | * upstart/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 7187 | we don't need it. |
| 7188 | (DEFS, INCLUDES): Replace these variables with the combined |
| 7189 | (AM_CPPFLAGS): variable that declares everything. |
| 7190 | * init/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 7191 | we don't need it. |
| 7192 | (DEFS, INCLUDES): Replace these variables with the combined |
| 7193 | (AM_CPPFLAGS): variable that declares everything. |
| 7194 | * util/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 7195 | we don't need it. |
| 7196 | (DEFS, INCLUDES): Replace these variables with the combined |
| 7197 | (AM_CPPFLAGS): variable that declares everything. |
| 7198 | * compat/sysv/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 7199 | we don't need it. |
| 7200 | (DEFS, INCLUDES): Replace these variables with the combined |
| 7201 | (AM_CPPFLAGS): variable that declares everything. |
| 7202 | * logd/Makefile.am (DEFAULT_INCLUDES): Drop override now that |
| 7203 | we don't need it. |
| 7204 | (DEFS, INCLUDES): Replace these variables with the combined |
| 7205 | (AM_CPPFLAGS): variable that declares everything. |
| 7206 | |
Scott James Remnant | acec3b2 | 2006-11-02 16:36:53 +0000 | [diff] [blame] | 7207 | 2006-11-02 Scott James Remnant <scott@netsplit.com> |
| 7208 | |
| 7209 | * util/initctl.c (start_action): Remove break calls which shouldn't |
| 7210 | be there. |
| 7211 | |
Scott James Remnant | ea806b7 | 2006-10-18 15:01:00 +0100 | [diff] [blame] | 7212 | 2006-10-18 Sean E. Russell <ser@ser1.net> |
| 7213 | |
| 7214 | * init/main.c: Include sys/time.h |
| 7215 | * init/cfgfile.c: Include sys/time.h and sys/resource.h |
| 7216 | * init/job.c: Include sys/time.h and sys/resource.h |
| 7217 | |
Scott James Remnant | 6702ac1 | 2006-10-17 18:55:24 +0100 | [diff] [blame] | 7218 | 2006-10-17 Scott James Remnant <scott@netsplit.com> |
| 7219 | |
Scott James Remnant | d5758f4 | 2006-10-17 19:21:25 +0100 | [diff] [blame] | 7220 | * configure.ac: Bump version to 0.3.1 |
| 7221 | |
Scott James Remnant | fd029da | 2006-10-17 19:21:07 +0100 | [diff] [blame] | 7222 | * NEWS: Update. |
| 7223 | * TODO: Update. |
| 7224 | |
Scott James Remnant | 9f67cb8 | 2006-10-17 19:12:28 +0100 | [diff] [blame] | 7225 | * configure.ac (AM_GNU_GETTEXT_VERSION): Quote version number. |
| 7226 | |
Scott James Remnant | 4ebe87f | 2006-10-17 19:04:40 +0100 | [diff] [blame] | 7227 | * logd/Makefile.am (event.d/logd): Make the event.d sub-directory |
| 7228 | in case we're building outside of the source tree. |
| 7229 | |
Scott James Remnant | 6702ac1 | 2006-10-17 18:55:24 +0100 | [diff] [blame] | 7230 | * compat/sysv/runlevel.c (store): Don't break strict-aliasing rules |
| 7231 | by avoiding dereferencing type-punned pointer. Answers on a |
| 7232 | postcard, please. |
| 7233 | |
Scott James Remnant | 7f13301 | 2006-10-13 12:00:34 +0100 | [diff] [blame] | 7234 | 2006-10-13 Scott James Remnant <scott@netsplit.com> |
| 7235 | |
Scott James Remnant | ecbb2b5 | 2006-10-13 15:18:24 +0100 | [diff] [blame] | 7236 | * util/initctl.c (start_action, emit_action): Add missing \n |
| 7237 | |
Scott James Remnant | 4862298 | 2006-10-13 15:15:50 +0100 | [diff] [blame] | 7238 | * util/initctl.c: Rewrite using nih_command_parser. |
| 7239 | * util/man/initctl.8: Improve. |
| 7240 | |
| 7241 | * util/start.c: Remove, replaced by initctl. |
| 7242 | * util/man/start.8: Remove, replaced by initctl. |
| 7243 | * util/Makefile.am (sbin_PROGRAMS): Drop start, now just a symlink |
| 7244 | to initctl. |
| 7245 | (dist_man_MANS): Drop start.8, now a symlink to initctl.8 |
| 7246 | (install-exec-hook): Make symlinks to initctl, add start |
| 7247 | (install-data-hook): Make symlinks to initctl.8, add start.8 |
| 7248 | |
Scott James Remnant | b1d8a7d | 2006-10-13 13:57:31 +0100 | [diff] [blame] | 7249 | * initctl: Rename to util again, I don't want a separate directory |
| 7250 | for every single little tool; and we'll be shipping more than just |
| 7251 | initctl (e.g. a non-compat reboot). |
| 7252 | * configure.ac (AC_CONFIG_FILES): Make util/Makefile instead of |
| 7253 | initctl/Makefile. |
| 7254 | * Makefile.am (SUBDIRS): Descend into util, not initctl. |
| 7255 | |
Scott James Remnant | a48b4fe | 2006-10-13 13:49:46 +0100 | [diff] [blame] | 7256 | * compat/sysv/reboot.c: Remove long options where they didn't exist |
| 7257 | before. Write help text. |
| 7258 | * compat/sysv/man/reboot.8: Update. |
| 7259 | |
Scott James Remnant | 462734c | 2006-10-13 13:36:00 +0100 | [diff] [blame] | 7260 | * init/main.c (main): Formatting. |
| 7261 | * logd/main.c (main): Formatting. |
| 7262 | * logd/man/logd.8: Formatting. |
| 7263 | * compat/sysv/runlevel.c (main): Formatting. |
| 7264 | * compat/sysv/telinit.c (main): Formatting. |
| 7265 | * compat/sysv/man/shutdown.8: Remove long options. |
| 7266 | |
Scott James Remnant | eff01f1 | 2006-10-13 13:32:12 +0100 | [diff] [blame] | 7267 | * compat/sysv/shutdown.c: Remove -e/--event, it has no place in a |
| 7268 | compatibility tool. Get rid of long options that never existed |
| 7269 | before. Specify help text to describe the options. |
| 7270 | * compat/sysv/man/shutdown.8: Spruce up a bit. |
| 7271 | |
Scott James Remnant | 4a5cd21 | 2006-10-13 12:59:15 +0100 | [diff] [blame] | 7272 | * compat/sysv/telinit.c (main): Set help text to list the valid |
| 7273 | runlevels. |
| 7274 | * compat/sysv/man/telinit.8: Refine the notes to mention runlevel(8). |
| 7275 | |
Scott James Remnant | f781962 | 2006-10-13 12:54:43 +0100 | [diff] [blame] | 7276 | * compat/sysv/runlevel.c (main): Make the help text describe the |
| 7277 | options, rather than the behaviour. |
Scott James Remnant | 4a5cd21 | 2006-10-13 12:59:15 +0100 | [diff] [blame] | 7278 | * compat/sysv/man/runlevel.8: Flesh out a little more. |
Scott James Remnant | f781962 | 2006-10-13 12:54:43 +0100 | [diff] [blame] | 7279 | |
Scott James Remnant | 930e25a | 2006-10-13 12:28:05 +0100 | [diff] [blame] | 7280 | * configure.ac (AC_INIT): Change bug reporting address to the |
| 7281 | mailing list, since Launchpad doesn't accept random bugs without |
| 7282 | accounts and complicated control messages. |
| 7283 | * init/main.c, logd/main.c: Add a period to the synopsis. |
| 7284 | |
Scott James Remnant | a6ed7eb | 2006-10-13 12:14:45 +0100 | [diff] [blame] | 7285 | * init/main.c (main): Set the synopsis, and direct people to look |
| 7286 | at telinit in the --help output. |
| 7287 | * init/man/init.8: Flesh this out a little more, still a lot of |
| 7288 | explaining to do about jobs and events, but we'll wait until we've |
| 7289 | changed that code before documentating the behaviour. |
| 7290 | |
Scott James Remnant | 7f13301 | 2006-10-13 12:00:34 +0100 | [diff] [blame] | 7291 | * logd/main.c (main): Correct help text to describe the options, |
| 7292 | rather than what the program does. As per standard style. |
| 7293 | Don't become a daemon until the logging socket is open, and make |
| 7294 | that exclusive with waiting for SIGCONT. |
| 7295 | * logd/man/logd.8: Write some more extensive documentation, |
| 7296 | including describing the startup interlock and the socket protocol. |
| 7297 | * TODO: Plan to get rid of the signal interlock from logd. |
| 7298 | |
Scott James Remnant | 8985dd3 | 2006-10-12 15:26:29 +0100 | [diff] [blame] | 7299 | 2006-10-12 Scott James Remnant <scott@netsplit.com> |
| 7300 | |
| 7301 | * configure.ac: Expand AC_GNU_SOURCE so we get _GNU_SOURCE and so |
| 7302 | that gettext doesn't complain. |
| 7303 | (AM_GNU_GETTEXT_VERSION): Increase to 0.15 |
| 7304 | (AC_PREREQ): Increase to 2.60 |
| 7305 | * HACKING: Update autoconf and gettext requirements. |
| 7306 | |
Scott James Remnant | c16a9b4 | 2006-10-11 17:08:58 +0100 | [diff] [blame] | 7307 | 2006-10-11 Scott James Remnant <scott@netsplit.com> |
| 7308 | |
Scott James Remnant | 74a1144 | 2006-10-11 17:58:56 +0100 | [diff] [blame] | 7309 | * init/control.c (control_init): Pass NULL to nih_list_new. |
| 7310 | Clarify list item types. |
| 7311 | * init/event.c (event_init): Pass NULL to nih_list_new. |
| 7312 | * init/job.c (job_init): Pass NULL to nih_list_new. |
| 7313 | |
Scott James Remnant | c34c4be | 2006-10-11 17:56:34 +0100 | [diff] [blame] | 7314 | * init/main.c: Change nih_signal_add_callback to nih_signal_add_handler |
| 7315 | and NihSignalCb to NihSignalHandler. |
| 7316 | |
Scott James Remnant | 8b22740 | 2006-10-11 17:55:27 +0100 | [diff] [blame] | 7317 | * init/cfgfile.c, init/cfgfile.h, init/control.c, init/control.h, |
| 7318 | init/event.c, init/event.h, init/job.c, init/job.h, init/main.c, |
| 7319 | init/process.c: Clean up documentation strings and parent pointer |
| 7320 | types. |
| 7321 | |
Scott James Remnant | d033c86 | 2006-10-11 17:41:22 +0100 | [diff] [blame] | 7322 | * compat/sysv/shutdown.c: Change nih_signal_add_callback to |
| 7323 | nih_signal_add_handler. |
| 7324 | |
Scott James Remnant | 1ee0f48 | 2006-10-11 17:40:41 +0100 | [diff] [blame] | 7325 | * compat/sysv/reboot.c: Set synopsis text depending on command |
| 7326 | used (probably should use nih_command_parser?) |
| 7327 | * compat/sysv/runlevel.c: Set synopsis and help text, and correct |
| 7328 | usage. |
| 7329 | * compat/sysv/shutdown.c: Set synopsis text. |
| 7330 | * compat/sysv/telinit.c: Set synopsis text. |
| 7331 | |
Scott James Remnant | 3b73464 | 2006-10-11 17:22:33 +0100 | [diff] [blame] | 7332 | * compat/sysv/runlevel.c, compat/sysv/shutdown.c: Clean up |
| 7333 | documentation strings. |
| 7334 | |
Scott James Remnant | c6e4f00 | 2006-10-11 17:22:03 +0100 | [diff] [blame] | 7335 | * logd/main.c: Set synopsis and help text. |
| 7336 | |
Scott James Remnant | 5e31d74 | 2006-10-11 17:16:55 +0100 | [diff] [blame] | 7337 | * logd/main.c: Clean up documentation strings. |
| 7338 | Change nih_signal_add_callback to nih_signal_add_handler. |
| 7339 | |
Scott James Remnant | 4835938 | 2006-10-11 17:13:48 +0100 | [diff] [blame] | 7340 | * upstart/control.c, upstart/control.h, upstart/job.c: Clean up |
| 7341 | documentation strings and correct parent pointer type. |
| 7342 | |
Scott James Remnant | c16a9b4 | 2006-10-11 17:08:58 +0100 | [diff] [blame] | 7343 | * HACKING: Detail function documentation requirement and format. |
| 7344 | |
Scott James Remnant | 59093a8 | 2006-10-10 13:09:58 +0100 | [diff] [blame] | 7345 | 2006-10-10 Scott James Remnant <scott@netsplit.com> |
| 7346 | |
Scott James Remnant | 335947d | 2006-10-11 17:08:34 +0100 | [diff] [blame] | 7347 | * event.d/logd.in: Move to logd/event.d |
| 7348 | * event.d/Makefile.am: Remove |
| 7349 | * logd/Makefile.am: Create the logd job definition and install |
| 7350 | * Makefile.am (SUBDIRS): event.d directory has been removed. |
| 7351 | * configure.ac (AC_CONFIG_FILES): No longer make event.d/Makefile |
| 7352 | |
Scott James Remnant | 59093a8 | 2006-10-10 13:09:58 +0100 | [diff] [blame] | 7353 | * configure.ac: Check for --enable-compat, default to sysv if given |
| 7354 | or no compat if not given. |
| 7355 | * compat/sysv/Makefile.am: Don't build binaries or install manpages |
| 7356 | unless COMPAT_SYSV is defined. |
| 7357 | |
Scott James Remnant | 4515094 | 2006-10-06 16:36:27 +0100 | [diff] [blame] | 7358 | 2006-10-06 Scott James Remnant <scott@netsplit.com> |
| 7359 | |
| 7360 | * doc/upstart-logo.svg: Include the logo Alexandre designed. |
| 7361 | * doc/Makefile.am (EXTRA_DIST): Ship the logo in the tarball. |
| 7362 | * Makefile.am (SUBDIRS): Install under doc |
| 7363 | * configure.ac: Generate doc/Makefile |
| 7364 | * AUTHORS: Ensure he's credited fully. |
| 7365 | |
Scott James Remnant | 10b8c0e | 2006-09-27 21:27:38 +0100 | [diff] [blame] | 7366 | 2006-09-27 Scott James Remnant <scott@netsplit.com> |
| 7367 | |
Scott James Remnant | 44052a3 | 2006-09-28 00:04:32 +0100 | [diff] [blame] | 7368 | * event.d/Makefile.am (do_subst): Eliminate duplicate /s |
| 7369 | |
Scott James Remnant | 5222c40 | 2006-09-27 22:48:48 +0100 | [diff] [blame] | 7370 | * man/init.8: Move to init/man |
| 7371 | * init/Makefile.am: Update to install man page. |
| 7372 | * man/logd.8: Move to logd/man |
| 7373 | * logd/Makefile.am: Update to install man page. |
| 7374 | * man/initctl.8, man/start.8: Move to initctl/man |
| 7375 | * initctl/Makefile.am: Update to install man pages. |
| 7376 | * man/reboot.8, man/runlevel.8, man/shutdown.8, man/telinit.8: |
| 7377 | Move to compat/sysv/man |
| 7378 | * compat/sysv/Makefile.am: Update to install man pages. |
| 7379 | * man/Makefile.am: Remove |
| 7380 | * configure.ac (AC_CONFIG_FILES): Remove man/Makefile |
| 7381 | * Makefile.am (SUBDIRS): Don't build in man |
| 7382 | |
Scott James Remnant | 545cb8c | 2006-09-27 21:32:49 +0100 | [diff] [blame] | 7383 | * util: Rename to initctl |
| 7384 | * configure.ac (AC_CONFIG_FILES): Update. |
| 7385 | * Makefile.am (SUBDIRS): Update. |
| 7386 | |
Scott James Remnant | 960c82d | 2006-09-27 21:30:42 +0100 | [diff] [blame] | 7387 | * util/reboot.c: Move to compat/sysv |
| 7388 | * util/shutdown.c: Move to compat/sysv |
| 7389 | * util/Makefile.am: Update. |
| 7390 | * compat/sysv/Makefile.am: Update. |
| 7391 | |
Scott James Remnant | 10b8c0e | 2006-09-27 21:27:38 +0100 | [diff] [blame] | 7392 | * configure.ac: Replace macros with single call to NIH_INIT. |
| 7393 | Bump version to 0.3.0 to begin new development cycle. |
| 7394 | |
Scott James Remnant | e559199 | 2006-09-21 05:49:34 +0100 | [diff] [blame] | 7395 | 2006-09-21 Scott James Remnant <scott@netsplit.com> |
| 7396 | |
| 7397 | * logd/main.c: Revert the change that logged to the console, in |
| 7398 | practice this doesn't work so well. I want to get rid of logd |
| 7399 | in the long term, or at least just have it as a simple logging |
| 7400 | proxy, so giving it features seems wrong. |
| 7401 | |
Scott James Remnant | 9b58b84 | 2006-09-20 05:37:47 +0100 | [diff] [blame] | 7402 | 2006-09-20 Scott James Remnant <scott@netsplit.com> |
| 7403 | |
Scott James Remnant | 97f08fa | 2006-09-20 06:34:12 +0100 | [diff] [blame] | 7404 | * configure.ac: Bump version to 0.2.8 |
| 7405 | * NEWS: Updated. |
| 7406 | |
Scott James Remnant | e59c71e | 2006-09-20 06:14:32 +0100 | [diff] [blame] | 7407 | * logd/main.c (main): Check the kernel command-line for "quiet" |
| 7408 | (line_reader): Write to console unless silent or a daemon |
| 7409 | |
Scott James Remnant | 9b58b84 | 2006-09-20 05:37:47 +0100 | [diff] [blame] | 7410 | * man/Makefile.am (dist_man_MANS): Drop sulogin.8 |
| 7411 | * man/sulogin.8: Drop, we don't include an sulogin |
| 7412 | |
Scott James Remnant | 0fafba4 | 2006-09-20 01:36:29 +0100 | [diff] [blame] | 7413 | 2006-09-19 Michael Biebl <mbiebl@gmail.com> |
| 7414 | |
| 7415 | * event.d/Makefile.am (logd): Drop $(srcdir) |
| 7416 | * init/Makefile.am (init_SOURCES): Distribute paths.h |
| 7417 | |
Scott James Remnant | 58f165f | 2006-09-18 19:43:07 +0100 | [diff] [blame] | 7418 | 2006-09-18 Michael Biebl <mbiebl@gmail.com> |
| 7419 | |
| 7420 | * configure.ac: Check for sys/inotify.h |
| 7421 | |
Scott James Remnant | e371cab | 2006-09-18 16:16:00 +0100 | [diff] [blame] | 7422 | 2006-09-18 Scott James Remnant <scott@netsplit.com> |
| 7423 | |
| 7424 | * util/shutdown.c (warning_message): Adjust method of constructing |
| 7425 | the message to not confuse poor translators who think \r and \n are |
| 7426 | the same thing! |
| 7427 | |
Scott James Remnant | f2b1c05 | 2006-09-14 10:34:45 +0100 | [diff] [blame] | 7428 | 2006-09-14 Scott James Remnant <scott@netsplit.com> |
| 7429 | |
Scott James Remnant | b2e03d0 | 2006-09-14 11:20:13 +0100 | [diff] [blame] | 7430 | * init/job.c (job_change_state): Catch runaway respawns when we |
| 7431 | enter the running state, so we catch stop/start loops too. |
| 7432 | * init/tests/test_job.c (test_change_state): Update test. |
| 7433 | |
Scott James Remnant | b7714f7 | 2006-09-14 11:07:38 +0100 | [diff] [blame] | 7434 | * event.d/logd: Rename to logd.in |
| 7435 | * event.d/logd.in: Replace /sbin with @sbindir@ so we can transform |
| 7436 | * event.d/Makefile.am: Generate logd from logd.in |
| 7437 | |
Scott James Remnant | 7e6bdb3 | 2006-09-14 10:57:03 +0100 | [diff] [blame] | 7438 | * util/reboot.c: Don't hardcode the location of /sbin/shutdown |
| 7439 | * util/Makefile.am (DEFS): Use autoconf to seed it |
| 7440 | * util/shutdown.c (sysvinit_shutdown): Don't hardcode the location |
| 7441 | of /dev/initctl |
| 7442 | |
Scott James Remnant | e0d0dd1 | 2006-09-14 10:51:05 +0100 | [diff] [blame] | 7443 | * init/paths.h: Create a new configuration file that can contain |
| 7444 | all of the path definitions, and in particular, allow them to be |
| 7445 | overidden elsewhere. |
| 7446 | * init/Makefile.am (DEFS): Override definitions of CFG_DIR and |
| 7447 | TELINIT using autoconf |
| 7448 | * init/main.c: Include paths.h. Don't hardcode location of telinit |
| 7449 | * init/job.c: Include paths.h |
| 7450 | * init/process.c: Include paths.h |
| 7451 | * init/process.h: Remove definitions from here. |
| 7452 | |
Scott James Remnant | f2b1c05 | 2006-09-14 10:34:45 +0100 | [diff] [blame] | 7453 | * configure.ac: Bump version to 0.2.7 |
| 7454 | |
Scott James Remnant | 0b8f23f | 2006-09-13 16:51:38 +0100 | [diff] [blame] | 7455 | 2006-09-13 Scott James Remnant <scott@netsplit.com> |
| 7456 | |
Scott James Remnant | 948ab87 | 2006-09-14 10:34:34 +0100 | [diff] [blame] | 7457 | * NEWS: Updated. |
| 7458 | |
Scott James Remnant | 0b8f23f | 2006-09-13 16:51:38 +0100 | [diff] [blame] | 7459 | * TODO: More TODO. |
| 7460 | |
Scott James Remnant | 080dd8d | 2006-09-10 12:42:03 +0100 | [diff] [blame] | 7461 | 2006-09-10 Scott James Remnant <scott@netsplit.com> |
| 7462 | |
| 7463 | * util/reboot.c (main): Don't give -H with "halt". |
| 7464 | |
Scott James Remnant | d704286 | 2006-09-09 00:50:10 +0100 | [diff] [blame] | 7465 | 2006-09-09 Scott James Remnant <scott@netsplit.com> |
| 7466 | |
Scott James Remnant | edb9790 | 2006-09-09 05:48:42 +0100 | [diff] [blame] | 7467 | * configure.ac: Bump version to 0.2.6 |
| 7468 | |
Scott James Remnant | 760237e | 2006-09-09 05:38:32 +0100 | [diff] [blame] | 7469 | * NEWS: Update. |
| 7470 | * TODO: Update. |
| 7471 | |
Scott James Remnant | 5e267a4 | 2006-09-09 05:21:28 +0100 | [diff] [blame] | 7472 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Change |
| 7473 | the magic to be the package string. |
| 7474 | * upstart/tests/test_control.c (test_recv_msg): Update tests. |
| 7475 | |
Scott James Remnant | 17fec6e | 2006-09-09 05:05:42 +0100 | [diff] [blame] | 7476 | * util/initctl.c (main): Set the usage string. |
| 7477 | * util/shutdown.c (main): Set the usage string. |
| 7478 | * util/start.c (main): Set the usage string. |
| 7479 | * compat/sysv/runlevel.c (main): Set the usage string. |
| 7480 | * compat/sysv/telinit.c (main): Set the usage string. |
| 7481 | |
Scott James Remnant | abede80 | 2006-09-09 05:01:45 +0100 | [diff] [blame] | 7482 | * man/Makefile.am: Use install-data-hook and $(man8dir) |
| 7483 | * util/Makefile.am: Also use install-exec-hook |
| 7484 | |
Scott James Remnant | c6c2005 | 2006-09-09 04:58:11 +0100 | [diff] [blame] | 7485 | * Makefile.am (SUBDIRS): Install contents of the man directory |
| 7486 | * configure.ac (AC_CONFIG_FILES): Generate man/Makefile |
| 7487 | * man/Makefile.am: Install manpages in the appropriate places. |
| 7488 | * man/init.8, man/logd.8, man/initctl.8, man/reboot.8, |
| 7489 | * man/shutdown.8, man/start.8, man/sulogin.8, man/runlevel.8, |
| 7490 | * man/telinit.8: Include some basic manpages so we at least have |
| 7491 | some level of documentation. |
| 7492 | |
Scott James Remnant | 33e4711 | 2006-09-09 03:45:00 +0100 | [diff] [blame] | 7493 | * init/job.c (job_child_reaper): Don't check the exit status of |
| 7494 | a respawning job if the goal is to stop it. |
| 7495 | |
Scott James Remnant | 1889aa6 | 2006-09-09 03:41:53 +0100 | [diff] [blame] | 7496 | * compat/sysv/telinit.c (main): Generate events rather than |
| 7497 | starting and stopping jobs directly, the events are named |
| 7498 | "runlevel-X". 0, 1, 6 and s/S are shutdown events. |
| 7499 | |
Scott James Remnant | 515b2b9 | 2006-09-09 03:41:27 +0100 | [diff] [blame] | 7500 | * logd/main.c (main): Raise SIGSTOP before entering the main loop. |
| 7501 | * init/main.c (main): Interlock with logd. |
| 7502 | |
Scott James Remnant | 17eb905 | 2006-09-09 03:41:04 +0100 | [diff] [blame] | 7503 | * event.d/logd: Should not be a console owner, but should stop |
| 7504 | on shutdown. |
| 7505 | |
Scott James Remnant | 3475226 | 2006-09-09 01:38:02 +0100 | [diff] [blame] | 7506 | * init/process.c (process_setup_console): Revert part of the previous |
| 7507 | change, should just output to /dev/null if we don't have logd. |
| 7508 | |
Scott James Remnant | e553333 | 2006-09-09 01:36:07 +0100 | [diff] [blame] | 7509 | * configure.ac: Bump version to 0.2.5 |
| 7510 | |
Scott James Remnant | b4a1c2b | 2006-09-09 01:28:26 +0100 | [diff] [blame] | 7511 | * init/main.c (main): Start the logd job if it exists. |
| 7512 | |
| 7513 | * init/process.c (process_setup_console): Ignore ECONNREFUSED as |
| 7514 | that just means that logd isn't around, handle errors by falling |
| 7515 | back to opening the console. |
| 7516 | |
Scott James Remnant | 9fb20d4 | 2006-09-09 01:22:03 +0100 | [diff] [blame] | 7517 | * init/process.c (process_setup_console): Implement handling for |
| 7518 | CONSOLE_LOGGED and generally clean up the other handling. |
| 7519 | * init/process.h: Update. |
| 7520 | * init/main.c (main): Pass NULL for the job to setup console. |
| 7521 | * TODO: Update. |
| 7522 | |
Scott James Remnant | d704286 | 2006-09-09 00:50:10 +0100 | [diff] [blame] | 7523 | * logd/main.c: Implement the logging daemon, it accepts connections |
| 7524 | on a unix stream socket with the abstract name |
| 7525 | "/com/ubuntu/upstart/logd", expects the length of the name and the |
| 7526 | name to follow; then sequences of lines which are logged to |
| 7527 | /var/log/boot, or memory until that file can be opened. |
| 7528 | |
Scott James Remnant | 527b945 | 2006-09-08 17:15:07 +0100 | [diff] [blame] | 7529 | 2006-09-08 Scott James Remnant <scott@netsplit.com> |
| 7530 | |
Scott James Remnant | cb655e7 | 2006-09-08 17:49:20 +0100 | [diff] [blame] | 7531 | * util/shutdown.c (event_setter): Change the event names to |
| 7532 | distinguish between "shutdown -h" and "shutdown -h -H". |
| 7533 | |
Scott James Remnant | 90732d3 | 2006-09-08 17:33:19 +0100 | [diff] [blame] | 7534 | * init/job.c (job_handle_event): Allow jobs to react to their own |
| 7535 | events, this is how we'll do respawn eventually. |
| 7536 | * init/tests/test_job.c (test_handle_event): Remove test. |
| 7537 | |
Scott James Remnant | bb3cc3f | 2006-09-08 17:17:47 +0100 | [diff] [blame] | 7538 | * init/main.c (cad_handler, kbd_handler): Generate the new event |
| 7539 | names. |
| 7540 | * init/event.h (CTRLALTDEL_EVENT, KBDREQUEST_EVENT): Add definitions |
| 7541 | of these event names, change the ctrlaltdel event to just that. |
| 7542 | |
Scott James Remnant | 527b945 | 2006-09-08 17:15:07 +0100 | [diff] [blame] | 7543 | * logd/main.c (main): Add the code to daemonise, etc. |
| 7544 | |
Scott James Remnant | a17917d | 2006-09-07 00:18:28 +0100 | [diff] [blame] | 7545 | 2006-09-07 Scott James Remnant <scott@netsplit.com> |
| 7546 | |
Scott James Remnant | 214ebe8 | 2006-09-07 21:48:55 +0100 | [diff] [blame] | 7547 | * TODO: Long discussion today on #upstart, many improvements to the |
| 7548 | job and event model that make it more elegant. |
| 7549 | * AUTHORS: Include a list of thanks. |
| 7550 | |
Scott James Remnant | b828007 | 2006-09-07 03:19:00 +0100 | [diff] [blame] | 7551 | * util/shutdown.c (shutdown_now): If we get ECONNREFUSED when we |
| 7552 | try and send the shutdown event to init, it probably means we're |
| 7553 | still in sysvinit. So try that instead. |
| 7554 | (sysvinit_shutdown): Function to send a hand-crafted runlevel |
| 7555 | change message across /dev/initctl. |
| 7556 | |
Scott James Remnant | ae96906 | 2006-09-07 00:43:57 +0100 | [diff] [blame] | 7557 | * util/initctl.c (main): Add a shutdown command that takes an |
| 7558 | arbitrary event name to be issued after "shutdown". You'll |
| 7559 | nearly always want the /sbin/shutdown tool instead. |
| 7560 | |
Scott James Remnant | 987bcc4 | 2006-09-07 00:38:24 +0100 | [diff] [blame] | 7561 | * init/job.c (job_detect_idle): Only generate the stalled event |
| 7562 | if at least one job handles it in its start_events list. |
| 7563 | * init/tests/test_job.c (test_detect_idle): Make sure that works. |
| 7564 | |
Scott James Remnant | ea204d4 | 2006-09-07 00:30:53 +0100 | [diff] [blame] | 7565 | * init/event.h (STARTUP_EVENT, SHUTDOWN_EVENT, STALLED_EVENT): |
| 7566 | Macros to define the standard event names. |
| 7567 | * init/main.c (main): Use STARTUP_EVENT macro instead of "startup" |
| 7568 | * init/control.c (control_handle): Use SHUTDOWN_EVENT macro |
| 7569 | instead of "shutdown". |
| 7570 | * init/job.c (job_detect_idle): Use STALLED_EVENT macro instead |
| 7571 | of "stalled". |
| 7572 | |
Scott James Remnant | 84607df | 2006-09-07 00:27:22 +0100 | [diff] [blame] | 7573 | * init/job.c (job_detect_idle): Add some log messages for when we |
| 7574 | detect the idle or stalled states. |
| 7575 | (job_kill_process, job_kill_timer): Increase log verbosity. |
| 7576 | * init/event.c (event_queue_run): Log which events we're handling |
| 7577 | if --debug is given. |
| 7578 | |
Scott James Remnant | a17917d | 2006-09-07 00:18:28 +0100 | [diff] [blame] | 7579 | * compat/sysv/telinit.c (main): Send a shutdown command when |
| 7580 | requesting to enter runlevel 0 or runlevel 6, likewise for |
| 7581 | runlevel 1, s or S which all run "rc1" not "rcS". |
| 7582 | * init/main.c (main): When called directory (pid != 1) try and |
| 7583 | run telinit before complaining that we're not init. Make sure |
| 7584 | errors aren't lost. |
| 7585 | |
Scott James Remnant | f5c376c | 2006-09-04 16:25:04 +0100 | [diff] [blame] | 7586 | 2006-09-04 Johan Kiviniemi <johan@kiviniemi.name> |
Scott James Remnant | edcae30 | 2006-09-04 07:06:23 +0100 | [diff] [blame] | 7587 | |
Scott James Remnant | f5c376c | 2006-09-04 16:25:04 +0100 | [diff] [blame] | 7588 | * upstart/control.c (upstart_addr): Replace use of __builtin_offsetof |
| 7589 | with offsetof. |
| 7590 | * upstart/tests/test_control.c (test_recv_msg): Likewise. |
| 7591 | |
| 7592 | 2006-09-04 Scott James Remnant <scott@netsplit.com> |
| 7593 | |
Scott James Remnant | edcae30 | 2006-09-04 07:06:23 +0100 | [diff] [blame] | 7594 | * util/shutdown.c (main): Exit normally after sending the warning |
| 7595 | message if -k is given. |
| 7596 | |
Scott James Remnant | e94bd20 | 2006-09-01 00:48:36 +0100 | [diff] [blame] | 7597 | 2006-09-01 Scott James Remnant <scott@netsplit.com> |
Scott James Remnant | d4cdaca | 2006-08-31 00:47:11 +0100 | [diff] [blame] | 7598 | |
Scott James Remnant | 294cde7 | 2006-09-01 19:58:35 +0100 | [diff] [blame] | 7599 | * configure.ac: Bump version to 0.2.2 |
| 7600 | |
Scott James Remnant | 7663bfb | 2006-09-01 19:58:19 +0100 | [diff] [blame] | 7601 | * NEWS: Update. |
| 7602 | * configure.ac: Bump version to 0.2.1 |
| 7603 | |
Scott James Remnant | 6798214 | 2006-09-01 19:47:39 +0100 | [diff] [blame] | 7604 | * init/process.c (process_setup_console): Ensure that the console |
| 7605 | is always initialised to at least /dev/null |
| 7606 | * init/job.c (job_change_state): Initialise event to NULL. |
| 7607 | * init/event.c (event_read_state): Don't mask initialisation of |
| 7608 | other variable. |
| 7609 | * init/cfgfile.c (cfg_job_stanza, cfg_parse_script, cfg_next_token): |
| 7610 | Print lineno using %zi not %d |
| 7611 | * compat/sysv/runlevel.c (store): Cast pointer type of timeval. |
| 7612 | |
Scott James Remnant | 097b2a9 | 2006-09-01 19:30:37 +0100 | [diff] [blame] | 7613 | * init/main.c: Move the kernel headers include beneath the C |
| 7614 | library ones, so that compilation doesn't fail on !i386. |
| 7615 | * util/reboot.c: Likewise. |
| 7616 | |
Scott James Remnant | 28fcc92 | 2006-09-01 04:15:57 +0100 | [diff] [blame] | 7617 | * init/main.c (term_handler): Close the control connection if we |
| 7618 | re-exec init, otherwise it won't be able to bind. Drop debugging. |
| 7619 | |
Scott James Remnant | 6f46496 | 2006-09-01 04:10:20 +0100 | [diff] [blame] | 7620 | * init/main.c (term_handler): It always helps if we dup2 the |
| 7621 | right file descriptor. |
| 7622 | |
Scott James Remnant | 1db8804 | 2006-09-01 03:14:19 +0100 | [diff] [blame] | 7623 | * init/main.c: Use the TERM signal instead of USR1, as old init |
| 7624 | used that for something else. Also rather than passing across |
| 7625 | file descriptor numbers, use a fixed descriptor and just pass |
| 7626 | "--restart". When we get that option we need to unmask signals |
| 7627 | otherwise we sit there looking like a lemon. |
| 7628 | |
Scott James Remnant | e7a7326 | 2006-09-01 02:32:27 +0100 | [diff] [blame] | 7629 | * init/job.c (job_change_state): Don't free the event unless we |
| 7630 | generate one. |
| 7631 | |
Scott James Remnant | 12dd725 | 2006-09-01 02:27:04 +0100 | [diff] [blame] | 7632 | * NEWS: Update. |
| 7633 | |
Scott James Remnant | 694172a | 2006-09-01 02:26:45 +0100 | [diff] [blame] | 7634 | * init/cfgfile.c (cfg_watcher): Ignore any file with '.' or '~' |
| 7635 | |
Scott James Remnant | c6e63dd | 2006-09-01 02:16:43 +0100 | [diff] [blame] | 7636 | * TODO: Update. |
| 7637 | |
Scott James Remnant | 3401ab7 | 2006-09-01 02:14:47 +0100 | [diff] [blame] | 7638 | * init/main.c (main): Parse command-line arguments, specifically |
| 7639 | look for --state-fd which we'll use for reexec. Don't do a couple |
| 7640 | of things if we're passed this. |
| 7641 | (read_state): Parse the line-buffered state. |
| 7642 | * init/job.c (job_read_state, job_write_state): Job state |
| 7643 | serialisation so that we can re-exec ourselves. |
| 7644 | * init/job.h: Update. |
| 7645 | * init/tests/test_job.c: Test the serialisation. |
| 7646 | * init/event.c (event_read_state, event_write_state): And similar |
| 7647 | functions for serialising the event queue. |
| 7648 | * init/event.h: Update. |
| 7649 | * init/tests/test_event.c: Test the serialisation. |
| 7650 | * init/cfgfile.c (cfg_read_job): Fix a bug, need to subtract current |
| 7651 | time to get due time. |
| 7652 | |
Scott James Remnant | e94bd20 | 2006-09-01 00:48:36 +0100 | [diff] [blame] | 7653 | * upstart/job.c (job_goal_from_name, job_state_from_name) |
| 7654 | (process_state_from_name): Add opposite numbers that convert a |
| 7655 | string back into an enumeration. |
| 7656 | * upstart/job.h: Update. |
| 7657 | * upstart/tests/test_job.c: Test the new functions. |
| 7658 | |
| 7659 | 2006-08-31 Scott James Remnant <scott@netsplit.com> |
Scott James Remnant | 694172a | 2006-09-01 02:26:45 +0100 | [diff] [blame] | 7660 | |
Scott James Remnant | b7260a7 | 2006-08-31 22:08:56 +0100 | [diff] [blame] | 7661 | * init/job.h (Job): Add respawn_limit, respawn_interval, |
| 7662 | respawn_count and respawn_time members so that we can keep track of |
| 7663 | runaway processes. |
| 7664 | * init/job.c (job_catch_runaway): Increment the respawn_count |
| 7665 | within respawn_interval, or reset it if we go over. |
| 7666 | (job_new): Initialise respawn_limit and respawn_interval to sensible |
| 7667 | defaults. |
| 7668 | * init/tests/test_job.c (test_new): Check the defaults are set. |
| 7669 | (test_change_state): Check the respawning code works. |
| 7670 | * init/cfgfile.c (cfg_job_stanza): Parse the "respawn limit" stanza. |
| 7671 | * init/tests/test_cfgfile.c (test_read_job): Test the new stanza. |
| 7672 | |
Scott James Remnant | ff0d26a | 2006-08-31 20:49:43 +0100 | [diff] [blame] | 7673 | * init/process.c (process_setup_console): Remove the console reset |
| 7674 | code, it tends to just crash X and seems to do nothing interesting. |
| 7675 | * init/main.c (reset_console): Instead put it here and just do it |
| 7676 | on startup. |
| 7677 | |
Scott James Remnant | 25b263a | 2006-08-31 18:59:02 +0100 | [diff] [blame] | 7678 | * configure.ac: Bump version to 0.2.0 |
| 7679 | |
Scott James Remnant | 4b61be9 | 2006-08-31 17:08:44 +0100 | [diff] [blame] | 7680 | * util/Makefile.am (install-exec-local): Create symbolic links, |
| 7681 | not hard links. |
| 7682 | |
Scott James Remnant | af1404f | 2006-08-31 16:04:16 +0100 | [diff] [blame] | 7683 | * init/main.c: Can't catch STOP. |
| 7684 | |
Scott James Remnant | 242b50b | 2006-08-31 15:40:42 +0100 | [diff] [blame] | 7685 | * util/reboot.c: Pause init while shutting down or rebooting. |
| 7686 | |
Scott James Remnant | eabb780 | 2006-08-31 15:39:04 +0100 | [diff] [blame] | 7687 | * init/main.c (stop_handler): Catch STOP/TSTP and CONT. |
| 7688 | * init/event.c (event_queue_run): Don't run the event queue while |
| 7689 | paused. |
| 7690 | * init/job.c (job_detect_idle): Don't detect idle jobs while paused. |
| 7691 | |
Scott James Remnant | 1cd8d86 | 2006-08-31 15:17:16 +0100 | [diff] [blame] | 7692 | * util/reboot.c: if we get the -w argument ("only write to wtmp") |
| 7693 | we need to exit, and not behave as halt normally would. |
| 7694 | |
Scott James Remnant | ff63cf7 | 2006-08-31 04:39:34 +0100 | [diff] [blame] | 7695 | * compat/sysv/runlevel.c (main): Add missing newline. |
| 7696 | * compat/sysv/telinit.c (main): And here too. |
| 7697 | |
Scott James Remnant | 32de922 | 2006-08-31 04:34:27 +0100 | [diff] [blame] | 7698 | * init/main.c (main): Check for idle after the startup event queue |
| 7699 | has been run, otherwise we may just sit there. |
| 7700 | |
Scott James Remnant | 13ffffe | 2006-08-31 04:33:39 +0100 | [diff] [blame] | 7701 | * compat/sysv/Makefile.am (sbin_PROGRAMS): Build and install telinit |
| 7702 | (telinit_SOURCES, telinit_LDFLAGS, telinit_LDADD): Details for |
| 7703 | telinit binary. |
| 7704 | * compat/sysv/telinit.c: Trivial telinit program that just runs |
| 7705 | the appropriate rcX job. |
| 7706 | * compat/sysv/runlevel.c (main): Suggest help on illegal runlevel. |
| 7707 | |
Scott James Remnant | 40f0901 | 2006-08-31 04:21:49 +0100 | [diff] [blame] | 7708 | * util/Makefile.am: Tidy up. |
| 7709 | |
Scott James Remnant | 1247356 | 2006-08-31 04:21:05 +0100 | [diff] [blame] | 7710 | * configure.ac (AC_CONFIG_FILES): Create compat/sysv/Makefile |
| 7711 | * Makefile.am (SUBDIRS): Build things found in compat/sysv |
| 7712 | * compat/sysv/Makefile.am (sbin_PROGRAMS): Build and install runlevel |
| 7713 | (runlevel_SOURCES, runlevel_LDFLAGS, runlevel_LDADD): Details for |
| 7714 | runlevel binary. |
| 7715 | * compat/sysv/runlevel.c: Helper to store and retrieve the current |
| 7716 | "runlevel" from utmp/wtmp; as well as the reboot time. |
| 7717 | |
Scott James Remnant | d909cca | 2006-08-31 04:20:14 +0100 | [diff] [blame] | 7718 | * init/main.c (main): Drop debugging set. |
| 7719 | |
Scott James Remnant | cedd11a | 2006-08-31 02:59:29 +0100 | [diff] [blame] | 7720 | * init/job.c (job_change_state): As well as the job/state events, |
| 7721 | send the job event when a service is running or a task is stopping. |
| 7722 | * init/tests/test_job.c (test_change_state): Check the events get |
| 7723 | sent properly. |
| 7724 | |
Scott James Remnant | 44b684a | 2006-08-31 02:58:45 +0100 | [diff] [blame] | 7725 | * util/start.c: Write a simple utility to start, stop, or query |
| 7726 | the status of the named jobs. |
| 7727 | * util/Makefile.am (sbin_PROGRAMS): Build and install start |
| 7728 | (start_SOURCES, start_LDFLAGS, start_LDADD): Details for start |
| 7729 | (install-exec-local): Also install as stop and status. |
| 7730 | * util/reboot.c (main): Drop the debugging set. |
| 7731 | |
Scott James Remnant | b8ed2d1 | 2006-08-31 02:15:48 +0100 | [diff] [blame] | 7732 | * init/cfgfile.c (cfg_job_stanza): Correct nih_alloc error. |
| 7733 | |
Scott James Remnant | a6125ae | 2006-08-31 02:14:25 +0100 | [diff] [blame] | 7734 | * init/process.c (process_setup_environment): Guard memory alloc. |
| 7735 | * init/job.c (job_set_idle_event): Likewise. |
| 7736 | (job_change_state): And here too. |
| 7737 | (job_run_command): Likewise. |
| 7738 | * init/control.c (control_send): Likewise. |
| 7739 | * init/cfgfile.c: And throughout this file. |
| 7740 | * upstart/control.c (upstart_recv_msg): And once here too. |
| 7741 | |
Scott James Remnant | 0b358ab | 2006-08-31 02:07:32 +0100 | [diff] [blame] | 7742 | * upstart/control.h: Abolish the separate halt, reboot and poweroff |
| 7743 | messages and replace with a single shutdown message that takes |
| 7744 | an event name (for the idle event issued afterwards). |
| 7745 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Handle |
| 7746 | the new shutdown event type by just treating it as an event. |
| 7747 | * upstart/tests/test_control.c (test_messages): Update tests. |
| 7748 | * init/job.c (job_set_idle_event): Store a copy of the idle event |
| 7749 | name. |
| 7750 | * init/control.c (control_send): Copy the shutdown event name. |
| 7751 | (control_handle): Replace individual handling with the new |
| 7752 | single event. |
| 7753 | * init/tests/test_control.c (test_watcher): Update. |
| 7754 | * util/initctl.c: Drop handling for things that shutdown does now. |
| 7755 | * util/shutdown.c: Send the UPSTART_SHUTDOWN event and let the user |
| 7756 | specify anything they want, just give defaults. |
| 7757 | |
Scott James Remnant | ff5efb9 | 2006-08-31 01:45:19 +0100 | [diff] [blame] | 7758 | This is quite a big change and abolishes level events entirely, |
| 7759 | along with the event history. We now just treat events as a |
| 7760 | transient queue of strings that go past, may cause things to change, |
| 7761 | but are otherwise forgotten. This turns out to be much easier to |
| 7762 | understand and has no real loss of power. |
| 7763 | |
| 7764 | * init/event.c: Vastly simplify; gone are the separate notions of |
| 7765 | edge and level events, instead we just treat them as one-shot |
| 7766 | things that go past and are forgotten about. |
| 7767 | * init/event.h (Event): Remove value member. |
| 7768 | Update prototypes. |
| 7769 | * init/tests/test_event.c: Update. |
| 7770 | * init/job.c (job_change_state): Change the event pattern to be |
| 7771 | one that includes the job name and a description of the transition |
| 7772 | instead of the new state. |
| 7773 | (job_detect_idle): Call event_queue rather than event_queue_edge. |
| 7774 | * init/tests/test_job.c: Update. |
| 7775 | * init/cfgfile.c (cfg_job_stanza): Drop "when" and "while". |
| 7776 | * init/tests/test_cfgfile.c (test_read_job): Drop mentions of |
| 7777 | "when" and "while". |
| 7778 | * init/control.c (control_send, control_handle): Drop cases for |
| 7779 | level events. |
| 7780 | (control_handle_event): Don't include a level in the event. |
| 7781 | * init/tests/test_control.c: Update |
| 7782 | * init/main.c: Call event_queue rather than event_queue_edge. |
| 7783 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Change |
| 7784 | event handling so that only a name is read. |
| 7785 | * upstart/control.h: Remove value/level event structures. |
| 7786 | * upstart/tests/test_control.c (test_messages): Update. |
| 7787 | * upstart/job.c (process_state_name): Not used for events, adjust |
| 7788 | documentation so it doesn't lie. |
| 7789 | * util/initctl.c (main): Drop the set function, simplify trigger. |
| 7790 | * util/shutdown.c (shutdown_now): Call UPSTART_EVENT_QUEUE for |
| 7791 | shutdown into maintenance mode. |
| 7792 | |
Scott James Remnant | fcbee2d | 2006-08-31 00:49:36 +0100 | [diff] [blame] | 7793 | * init/control.c (control_handle): Place a message in the syslog |
| 7794 | before halting, powering off or rebooting. |
| 7795 | |
Scott James Remnant | d4cdaca | 2006-08-31 00:47:11 +0100 | [diff] [blame] | 7796 | * util/shutdown.c: Adjust so that the warning message is sent out |
| 7797 | if shutdown is immediate, and when it actually happens. Include |
| 7798 | the hostname as wall does. |
| 7799 | |
Scott James Remnant | 255c5f2 | 2006-08-30 16:05:01 +0100 | [diff] [blame] | 7800 | 2006-08-30 Scott James Remnant <scott@netsplit.com> |
| 7801 | |
Scott James Remnant | 5be5566 | 2006-08-30 19:13:25 +0100 | [diff] [blame] | 7802 | * TODO: Update. |
| 7803 | |
Scott James Remnant | 4a9245f | 2006-08-30 19:13:00 +0100 | [diff] [blame] | 7804 | * util/shutdown.c: Implement shutdown utility along the same lines |
| 7805 | as the sysvinit one, but with rather different code. |
| 7806 | |
Scott James Remnant | 2a71aaa | 2006-08-30 16:34:06 +0100 | [diff] [blame] | 7807 | * util/initctl.c (main): Call setuid on the effective user id so |
| 7808 | that we can be made setuid root and executable by a special group. |
| 7809 | * util/reboot.c (main): Likewise. |
| 7810 | |
Scott James Remnant | 70cc229 | 2006-08-30 16:06:03 +0100 | [diff] [blame] | 7811 | * util/initctl.c (main): Check the effective rather than the real |
| 7812 | user id, if we're effectively root, that's good enough. |
| 7813 | |
Scott James Remnant | 255c5f2 | 2006-08-30 16:05:01 +0100 | [diff] [blame] | 7814 | * util/reboot.c: Implement reboot/halt/poweroff utility. |
| 7815 | * util/Makefile.am (sbin_PROGRAMS): Build and install reboot |
| 7816 | (reboot_SOURCES, reboot_LDFLAGS, reboot_LDADD): Details for reboot |
| 7817 | (install-exec-local): Create hardlinks to reboot for halt and poweroff. |
| 7818 | |
Scott James Remnant | dc8877d | 2006-08-29 16:56:48 +0100 | [diff] [blame] | 7819 | 2006-08-29 Scott James Remnant <scott@netsplit.com> |
| 7820 | |
| 7821 | * init/main.c (main): Actually run the idle-detect function. |
| 7822 | * init/job.c (job_detect_idle): Interrupt the main loop, otherwise |
| 7823 | we may end up waiting for a signal before we process the event |
| 7824 | we just issued. |
| 7825 | |
Scott James Remnant | f43bdf3 | 2006-08-27 18:20:29 +0100 | [diff] [blame] | 7826 | 2006-08-27 Scott James Remnant <scott@netsplit.com> |
| 7827 | |
Scott James Remnant | 4715848 | 2006-08-27 22:37:10 +0100 | [diff] [blame] | 7828 | * util/shutdown.c: Template main function. |
| 7829 | * util/Makefile.am (sbin_PROGRAMS): Build and install the |
| 7830 | shutdown binary. |
| 7831 | (shutdown_SOURCES, shutdown_LDFLAGS, shutdown_LDADD): Details for |
| 7832 | the shutdown binary |
| 7833 | |
Scott James Remnant | 70a6ec6 | 2006-08-27 22:23:50 +0100 | [diff] [blame] | 7834 | * util/initctl.c (main): Add commands for halt, poweroff and reboot. |
| 7835 | |
Scott James Remnant | 0c7e72a | 2006-08-27 22:22:53 +0100 | [diff] [blame] | 7836 | * init/event.c (event_queue_run): Remove the parameters. |
| 7837 | * init/event.h: Update. |
| 7838 | * init/main.c (main): Update. |
| 7839 | * init/tests/test_control.c (test_watcher): Update. |
| 7840 | * init/tests/test_job.c (test_detect_idle): Update. |
| 7841 | |
Scott James Remnant | 96ae9e4 | 2006-08-27 22:15:34 +0100 | [diff] [blame] | 7842 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Deal |
| 7843 | with halting, rebooting and powering off; or at least the appropriate |
| 7844 | messages. |
| 7845 | * upstart/control.h: Add control message structures for halting, |
| 7846 | powering off and rebooting the machine. |
| 7847 | * upstart/tests/test_control.c (test_messages): Run the tests. |
| 7848 | * init/control.c (control_handle): Add handling for halt, power off |
| 7849 | and reboot that issue the shutdown event and arrange for the halt, |
| 7850 | poweroff or reboot to be issued the next time the system is idle. |
| 7851 | * init/tests/test_control.c (test_watcher): Test the events. |
| 7852 | |
Scott James Remnant | 01a3708 | 2006-08-27 21:51:00 +0100 | [diff] [blame] | 7853 | * TODO: Update. |
| 7854 | |
Scott James Remnant | e02892b | 2006-08-27 21:49:44 +0100 | [diff] [blame] | 7855 | * init/job.c (job_detect_idle): Function to detect when the system is |
| 7856 | stalled or idle. |
| 7857 | * init/job.h: Update |
| 7858 | * init/tests/test_job.c (test_detect_idle): Test the new function. |
| 7859 | |
Scott James Remnant | 6a8508c | 2006-08-27 19:10:44 +0100 | [diff] [blame] | 7860 | * util/initctl.c (main): Handle the list command. |
| 7861 | |
Scott James Remnant | a9476ad | 2006-08-27 19:07:23 +0100 | [diff] [blame] | 7862 | * TODO: Update. |
| 7863 | |
Scott James Remnant | 4da474d | 2006-08-27 19:06:35 +0100 | [diff] [blame] | 7864 | * upstart/control.c (WireJobStatusPayload): add description to the |
| 7865 | job status payload. |
| 7866 | (upstart_send_msg_to, upstart_recv_msg): Send and receieve the |
| 7867 | description over the wire. |
| 7868 | * upstart/control.h (UpstartJobStatusMsg): add a description field |
| 7869 | * upstart/tests/test_control.c: Update test cases. |
| 7870 | * init/control.c (control_handle): Include the job description in |
| 7871 | the message. |
| 7872 | (control_send): Copy the description when we put the message on |
| 7873 | the queue. |
| 7874 | (control_handle_job): Copy the description here too |
| 7875 | * init/tests/test_control.c: Update test cases. |
| 7876 | |
Scott James Remnant | 84f5e93 | 2006-08-27 18:49:25 +0100 | [diff] [blame] | 7877 | * init/job.c (job_list): Add a function to return the job list. |
| 7878 | * init/job.h: Update. |
| 7879 | * init/control.c (control_handle): Handle the JOB_LIST message |
| 7880 | by sending back a list of job status messages followed by the |
| 7881 | JOB_LIST_END message. |
| 7882 | * init/tests/test_control.c (test_watcher_child): Check the |
| 7883 | JOB_LIST message works properly. |
| 7884 | |
Scott James Remnant | f4ad6d1 | 2006-08-27 18:40:01 +0100 | [diff] [blame] | 7885 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Handle |
| 7886 | the JOB_LIST and JOB_LIST_END messages which have no payload. |
| 7887 | * upstart/control.h: Add enums and structures for job list messages. |
| 7888 | * upstart/tests/test_control.c (test_messages): Update tests. |
| 7889 | |
Scott James Remnant | f497081 | 2006-08-27 18:27:19 +0100 | [diff] [blame] | 7890 | * init/main.c (main): Check that we're both uid and process #1 |
| 7891 | |
Scott James Remnant | f43bdf3 | 2006-08-27 18:20:29 +0100 | [diff] [blame] | 7892 | * init/main.c (main): Stop handling SIGTERM, we never want people |
| 7893 | to kill init. Handle SIGINT and SIGWINCH through the ordinary |
| 7894 | handler and SIGSEGV through a direct handler. |
| 7895 | (segv_handler): Write a sensible core dump handler, we use a child |
| 7896 | to dump core while we carry on in the parent hopefully stepping over |
| 7897 | the bad instruction. |
| 7898 | (cad_handler): Generate the control-alt-delete event. |
| 7899 | (kbd_handler): Generate the kbdrequest event. |
| 7900 | |
Scott James Remnant | 33e64d0 | 2006-08-25 14:44:32 +0200 | [diff] [blame] | 7901 | 2006-08-25 Scott James Remnant <scott@netsplit.com> |
| 7902 | |
Scott James Remnant | 2167925 | 2006-08-25 16:22:13 +0200 | [diff] [blame] | 7903 | * configure.ac: Bump version to 0.1.2 |
| 7904 | * NEWS: Update. |
| 7905 | |
Scott James Remnant | fef12b5 | 2006-08-25 16:16:45 +0200 | [diff] [blame] | 7906 | * TODO: Update. |
| 7907 | |
Scott James Remnant | 94d0098 | 2006-08-25 15:38:22 +0200 | [diff] [blame] | 7908 | * init/process.c (process_setup_environment): Inherit the PATH |
| 7909 | and TERM environment variables from the init process, so the |
| 7910 | console works properly. |
| 7911 | * init/process.h (PATH): Declare a default value for this variable |
| 7912 | * init/main.c (main): Set the value of PATH to the default. |
| 7913 | * init/tests/test_process.c (child): Update test case. |
| 7914 | |
Scott James Remnant | 33e64d0 | 2006-08-25 14:44:32 +0200 | [diff] [blame] | 7915 | * NEWS: Update. |
| 7916 | * configure.ac: Bump version to 0.1.1 |
| 7917 | |
Scott James Remnant | 68ccc9e | 2006-08-24 00:10:41 +0200 | [diff] [blame] | 7918 | 2006-08-24 Scott James Remnant <scott@netsplit.com> |
| 7919 | |
Scott James Remnant | 279d435 | 2006-08-24 15:33:19 +0200 | [diff] [blame] | 7920 | * init/cfgfile.h (CFG_DIR): Change configuration directory to |
| 7921 | /etc/event.d -- it's not been used by anyone, but is similar to |
| 7922 | other directories that have which is a good precedent. |
| 7923 | * event.d/Makefile.am (eventdir, dist_event_DATA): Install files |
| 7924 | into the new directory name. |
| 7925 | * Makefile.am (SUBDIRS): Rename sub directory |
| 7926 | * configure.ac (AC_CONFIG_FILES): Rename generated Makefile |
| 7927 | |
Scott James Remnant | 937192c | 2006-08-24 02:57:50 +0200 | [diff] [blame] | 7928 | * init/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 7929 | directories so out of tree builds work. |
| 7930 | * logd/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 7931 | directories so out of tree builds work. |
| 7932 | * upstart/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 7933 | directories so out of tree builds work. |
| 7934 | (upstartinclude_HEADERS): Install errors.h |
| 7935 | * util/Makefile.am (DEFAULT_INCLUDES): Set to include the right |
| 7936 | directories so out of tree builds work. |
| 7937 | |
| 7938 | * Makefile.am (SUBDIRS): Add m4 to the list |
| 7939 | * configure.ac (AC_CONFIG_FILES): Generate m4/Makefile |
| 7940 | * upstart/Makefile.am (upstartinclude_HEADERS): Add errors.h |
| 7941 | |
| 7942 | * upstart/control.c (upstart_open): |
| 7943 | |
Scott James Remnant | e4c3d55 | 2006-08-24 02:34:01 +0200 | [diff] [blame] | 7944 | * init/control.c (control_open): Raise the error before |
| 7945 | performing other actions so errno is not lost. |
Scott James Remnant | 7355009 | 2006-08-24 02:27:03 +0200 | [diff] [blame] | 7946 | |
Scott James Remnant | e4c3d55 | 2006-08-24 02:34:01 +0200 | [diff] [blame] | 7947 | * TODO: Update.o |
Scott James Remnant | f8b776b | 2006-08-24 00:36:15 +0200 | [diff] [blame] | 7948 | * init/cfgfile.c (cfg_next_token): Don't count quote characters |
| 7949 | unless we're actually planning to dequote the file, otherwise we |
| 7950 | end up allocating short. |
| 7951 | |
Scott James Remnant | 9e17fc0 | 2006-08-24 00:28:10 +0200 | [diff] [blame] | 7952 | * init/control.c (control_close): Free the io_watch using list_free |
| 7953 | in case a destructor has been set. |
| 7954 | * init/tests/test_control.c: Initialise the type of the message, and |
| 7955 | free job correctly. |
| 7956 | |
Scott James Remnant | 68ccc9e | 2006-08-24 00:10:41 +0200 | [diff] [blame] | 7957 | * upstart/tests/test_control.c: Fix overwrite of buffer. |
| 7958 | * init/tests/test_job.c: Clean up not-freed job. |
| 7959 | |
Scott James Remnant | c961ce3 | 2006-08-23 19:46:29 +0200 | [diff] [blame] | 7960 | 2006-08-23 Scott James Remnant <scott@netsplit.com> |
| 7961 | |
Scott James Remnant | 013e972 | 2006-08-23 23:00:14 +0200 | [diff] [blame] | 7962 | * init/tests/test_event.c: free the entry allocated and initialise |
| 7963 | the return values. |
| 7964 | |
Scott James Remnant | c961ce3 | 2006-08-23 19:46:29 +0200 | [diff] [blame] | 7965 | * init/cfgfile.c (cfg_skip_token): Drop this function; we'll |
| 7966 | make sure *pos is pointing at the start of the thing we want |
| 7967 | to parse, not the first token. Update the other functions |
| 7968 | accordingly. |
| 7969 | (cfg_read_job): Implement function to look over a job file and |
| 7970 | parse all of the stanzas that are found. Also sanity checks the |
| 7971 | job afterwards and deals with reloading existing jobs. |
| 7972 | (cfg_job_stanza): Function that parses an individual stanza, |
| 7973 | calling out to the other parse functions; this is the main config |
| 7974 | file parser! |
| 7975 | (cfg_parse_args, cfg_parse_command): Drop requirement that filename |
| 7976 | and lineno be passed, so we can be called to reparse arguments after |
| 7977 | we've already done so. |
| 7978 | (cfg_parse_script): Remove requirement that it be called at the |
| 7979 | start of the entire stanza, and instead at the start of the script. |
| 7980 | When hitting EOF, return the script so far, not NULL. |
| 7981 | (cfg_parse_args): Correct bug where we didn't check sufficient |
| 7982 | characters while skipping whitespace. |
| 7983 | (cfg_next_token): Correct bug where we didn't copy the character |
| 7984 | after a slash into the text, instead of just not copying the slash. |
| 7985 | Adjust line numbers to match the fact that it's zero based now. |
| 7986 | * init/cfgfile.h: Define prototype. |
| 7987 | * init/tests/test_cfgfile.c (test_read_job): Pretty thoroughly |
| 7988 | test the config file parser code. |
| 7989 | |
Scott James Remnant | 0c58ed0 | 2006-08-22 11:42:19 +0200 | [diff] [blame] | 7990 | 2006-08-22 Scott James Remnant <scott@netsplit.com> |
| 7991 | |
Scott James Remnant | 214168f | 2006-08-22 18:52:51 +0200 | [diff] [blame] | 7992 | * init/cfgfile.c (cfg_tokenise): Rename to cfg_next_token. |
| 7993 | (cfg_skip_token): Code to skip whitespace, token and whitespace. |
| 7994 | (cfg_parse_args): Function to parse an argument list. |
| 7995 | (cfg_next_token): Extend to support the removal of quotes and |
| 7996 | slashes from the token. |
| 7997 | |
Scott James Remnant | 21590a2 | 2006-08-22 17:40:48 +0200 | [diff] [blame] | 7998 | * init/cfgfile.c (cfg_parse_script): Pass filename and lineno and |
| 7999 | increment the latter as we go. |
| 8000 | (cfg_script_end): Pass and increment lineno. |
| 8001 | |
Scott James Remnant | eed2e8d | 2006-08-22 17:31:07 +0200 | [diff] [blame] | 8002 | * init/cfgfile.c: Correct a missing semi-colon in prototypes. |
| 8003 | (cfg_parse_command): Function to parse any stanza that requires |
| 8004 | a command and arguments list, e.g. exec/respawn/daemon. We don't |
| 8005 | want to require that the list be quoted, etc. and do want to allow |
| 8006 | it to be folded over lines. |
| 8007 | (cfg_tokenise): Function used by the above to tokenise the file, |
| 8008 | handling things like \, quoted strings and newlines, etc. Can be |
| 8009 | used both to determine the length of the token and to copy it. |
| 8010 | |
Scott James Remnant | fcc98ad | 2006-08-22 12:28:19 +0200 | [diff] [blame] | 8011 | * init/cfgfile.c (cfg_read_script): Rename to cfg_parse_script. |
| 8012 | |
Scott James Remnant | fd32dd3 | 2006-08-22 11:46:01 +0200 | [diff] [blame] | 8013 | * init/cfgfile.c (cfg_read_script): Function to parse a script |
| 8014 | fragment ("foo script\n....end script\n") from the job file, which |
| 8015 | is the most complex form we can find. Write it assuming the file is |
| 8016 | in a character array which may not be NULL terminated (ie. a mmap'd |
| 8017 | file). |
| 8018 | (cfg_script_end): Used by the above to detect the end of the |
| 8019 | fragment. |
| 8020 | * init/cfgfile.h: Empty header file. |
| 8021 | * init/Makefile.am (init_SOURCES): Build and link cfgfile.c |
| 8022 | using the cfgfile.h header |
| 8023 | (TESTS): Build and run the config file test cases. |
| 8024 | (test_cfgfile_SOURCES, test_cfgfile_LDFLAGS, test_cfgfile_LDADD): |
| 8025 | Details for config file test case binary. |
| 8026 | |
Scott James Remnant | 0c58ed0 | 2006-08-22 11:42:19 +0200 | [diff] [blame] | 8027 | * init/main.c (main): Remove the calls to the unfinished config |
| 8028 | file code. |
| 8029 | |
Scott James Remnant | 6ce4481 | 2006-08-21 08:46:32 +0200 | [diff] [blame] | 8030 | 2006-08-21 Scott James Remnant <scott@netsplit.com> |
| 8031 | |
Scott James Remnant | 027dd7b | 2006-08-21 09:01:25 +0200 | [diff] [blame] | 8032 | * init/main.c: Add missing include for unistd.h |
| 8033 | * init/process.c (process_setup_console): Drop use of job. |
| 8034 | * util/initctl.c (main): Check that we're run as root. |
| 8035 | |
Scott James Remnant | 77e8db3 | 2006-08-21 08:47:50 +0200 | [diff] [blame] | 8036 | * init/main.c (main): Write the main function |
| 8037 | |
Scott James Remnant | 6ecceb8 | 2006-08-21 08:47:23 +0200 | [diff] [blame] | 8038 | * init/event.c (event_queue_cb): Rename to event_queue_run. |
| 8039 | * init/event.h: Update. |
| 8040 | |
Scott James Remnant | 6ce4481 | 2006-08-21 08:46:32 +0200 | [diff] [blame] | 8041 | * init/process.c (process_setup_console): Become an exported |
| 8042 | function that includes the code to reset a console. |
| 8043 | |
Scott James Remnant | 5befd93 | 2006-08-19 19:24:54 +0100 | [diff] [blame] | 8044 | 2006-08-19 Scott James Remnant <scott@netsplit.com> |
| 8045 | |
Scott James Remnant | cd39a7c | 2006-08-19 20:02:17 +0100 | [diff] [blame] | 8046 | * logd/main.c (main): Write the basic main function. |
| 8047 | |
Scott James Remnant | 3bcd15e | 2006-08-19 19:50:12 +0100 | [diff] [blame] | 8048 | * util/initctl.c (main): Fill in the details to give us a basic |
| 8049 | test client. |
| 8050 | |
Scott James Remnant | 3dc965c | 2006-08-19 19:25:23 +0100 | [diff] [blame] | 8051 | * TODO: Update. |
| 8052 | |
Scott James Remnant | 5befd93 | 2006-08-19 19:24:54 +0100 | [diff] [blame] | 8053 | * util/initctl.c (main): Provide the most basic main function. |
| 8054 | * util/Makefile.am (sbin_PROGRAMS): Build the initctl binary |
| 8055 | * Makefile.am (SUBDIRS): Build the utilities. |
| 8056 | * configure.ac (AC_CONFIG_FILES): Generate the util Makefile. |
| 8057 | |
Scott James Remnant | 1fe38a8 | 2006-08-18 17:06:25 +0100 | [diff] [blame] | 8058 | 2006-08-18 Scott James Remnant <scott@netsplit.com> |
| 8059 | |
Scott James Remnant | c265961 | 2006-08-18 22:19:47 +0100 | [diff] [blame] | 8060 | * init/Makefile.am (test_job_LDADD): Remove the duplicate link. |
| 8061 | |
Scott James Remnant | d5e0705 | 2006-08-18 20:39:30 +0100 | [diff] [blame] | 8062 | * TODO: Update. |
| 8063 | |
Scott James Remnant | a060bb7 | 2006-08-18 20:16:55 +0100 | [diff] [blame] | 8064 | * init/job.c (job_handle_child): Rename to job_child_reaper. |
| 8065 | * init/job.h: Update. |
| 8066 | * init/tests/test_job.c: Update function names. |
| 8067 | |
Scott James Remnant | 829dc08 | 2006-08-18 20:10:02 +0100 | [diff] [blame] | 8068 | * init/control.c (control_cb): Rename to control_watcher |
| 8069 | * init/tests/test_control.c: Update function names. |
| 8070 | |
Scott James Remnant | ddc3e28 | 2006-08-18 18:49:50 +0100 | [diff] [blame] | 8071 | * TODO: Update. |
| 8072 | |
Scott James Remnant | c2cac3f | 2006-08-18 17:17:57 +0100 | [diff] [blame] | 8073 | * Makefile.am (SUBDIRS): Install the rc.d files. |
| 8074 | * configure.ac (AC_CONFIG_FILES): Generate the rc.d Makefile. |
| 8075 | * rc.d/Makefile.am (rcdir): Define rcdir to be /etc/rc.d |
| 8076 | (dist_rc_DATA): Install the logd file into that directory. |
| 8077 | * rc.d/logd: Write a simple service definition for the log daemon, |
| 8078 | this saves us hardcoding any information about it into init; it'll |
| 8079 | just need to know the name. |
| 8080 | |
Scott James Remnant | 1fe38a8 | 2006-08-18 17:06:25 +0100 | [diff] [blame] | 8081 | * Makefile.am (SUBDIRS): Build the logd daemon |
| 8082 | * configure.ac (AC_CONFIG_FILES): Generate the logd Makefile. |
| 8083 | * logd/Makefile.am (sbin_PROGRAMS): Install the logd binary into |
| 8084 | the sbin directory by default. |
| 8085 | (logd_SOURCES): Build and link main.c |
| 8086 | * logd/main.c (main): Add basic main function for testing purposes. |
| 8087 | |
Scott James Remnant | b981443 | 2006-08-16 02:11:51 +0100 | [diff] [blame] | 8088 | 2006-08-16 Scott James Remnant <scott@netsplit.com> |
| 8089 | |
Scott James Remnant | c5da6fd | 2006-08-16 18:06:49 +0100 | [diff] [blame] | 8090 | * init/job.c (job_start): Ignore self-dependencies; over-document |
| 8091 | why the dependency event prodding has a surprise in its tail. |
| 8092 | (job_change_state): Move the job_release_depends call to here. |
| 8093 | |
Scott James Remnant | 133a7a3 | 2006-08-16 17:45:51 +0100 | [diff] [blame] | 8094 | * init/event.c (event_queue_cb): Add event consumer/dispatcher. |
Scott James Remnant | 13e5dbf | 2006-08-16 17:48:01 +0100 | [diff] [blame] | 8095 | * init/event.h: Update. |
Scott James Remnant | 133a7a3 | 2006-08-16 17:45:51 +0100 | [diff] [blame] | 8096 | |
Scott James Remnant | 3772bc6 | 2006-08-16 17:41:34 +0100 | [diff] [blame] | 8097 | * init/control.c (control_send): Make the event code clearer. |
| 8098 | (control_handle): Handle the changed event semantics. |
| 8099 | (control_handle_event): Issue the new event type. |
| 8100 | * init/tests/test_control.c: Update tests. |
| 8101 | |
Scott James Remnant | caee5b5 | 2006-08-16 17:32:12 +0100 | [diff] [blame] | 8102 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Adjust |
| 8103 | marshal code to match. |
| 8104 | * upstart/control.h: Update all structures appropriately to the |
| 8105 | previous changes. |
| 8106 | * upstart/tests/test_control.c: Update. |
| 8107 | |
Scott James Remnant | 4d4389d | 2006-08-16 17:19:20 +0100 | [diff] [blame] | 8108 | * init/job.c (job_change_state): Change call to event_trigger_level |
| 8109 | to event_queue_level. |
| 8110 | |
Scott James Remnant | 51664d7 | 2006-08-16 17:17:58 +0100 | [diff] [blame] | 8111 | * init/event.c (event_trigger_edge, event_trigger_level): Place |
| 8112 | the event on the event_queue rather than directly triggering it. |
| 8113 | Rename to event_queue_edge and event_queue_level respectively. |
| 8114 | * init/event.h: Update. |
| 8115 | * init/tests/test_event.c: Update test cases. |
| 8116 | |
Scott James Remnant | 4ddc86e | 2006-08-16 16:17:48 +0100 | [diff] [blame] | 8117 | * init/job.c (job_handle_event): Add another sanity check, jobs |
| 8118 | should not be able to react to their own events; that's just silly. |
| 8119 | * init/tests/test_job.c (test_handle_event): Check that the new |
| 8120 | condition does the right thing. |
| 8121 | |
Scott James Remnant | 930f3e0 | 2006-08-16 16:13:03 +0100 | [diff] [blame] | 8122 | * init/job.c (job_change_state): Make it illegal for a job to exist |
| 8123 | without either a command or script or both. This is for sanity |
| 8124 | reasons, allowing no primary process makes no sense and can lead |
| 8125 | to event loops if someone is feeling nefarious. |
| 8126 | * init/tests/test_job.c (test_change_state): Drop test on behaviour |
| 8127 | we've just outlawed. |
| 8128 | |
Scott James Remnant | 7dd047e | 2006-08-16 13:43:50 +0100 | [diff] [blame] | 8129 | * init/job.c (job_start): Only announce the change if we're still |
| 8130 | in the waiting state, we could have moved on to running already. |
| 8131 | |
Scott James Remnant | f9261ba | 2006-08-16 13:40:05 +0100 | [diff] [blame] | 8132 | * init/job.c (job_start): If holding the job, at least announce |
| 8133 | the goal change to subscribed clients. |
| 8134 | |
Scott James Remnant | 853cc77 | 2006-08-16 13:34:51 +0100 | [diff] [blame] | 8135 | * TODO: Update. |
| 8136 | |
Scott James Remnant | fdb8259 | 2006-08-16 13:31:49 +0100 | [diff] [blame] | 8137 | * init/job.c (job_start): Check for dependencies before starting |
| 8138 | the process, if we have any that aren't running we stay in waiting |
| 8139 | until they are. Any that aren't even starting get poked with a |
| 8140 | dependency event to see whether that wakes them up. |
| 8141 | * init/tests/test_job.c (test_start): Test paths through new |
| 8142 | dependency code. |
| 8143 | |
Scott James Remnant | 278150a | 2006-08-16 12:56:34 +0100 | [diff] [blame] | 8144 | * init/job.c (job_run_process): Once we've got an active process |
| 8145 | in the running state, release our dependencies. |
| 8146 | |
Scott James Remnant | 6d4104d | 2006-08-16 12:50:39 +0100 | [diff] [blame] | 8147 | * init/job.c (job_release_depends): Function to release any waiting |
| 8148 | dependencies on the given job. |
| 8149 | * init/job.h: Update. |
| 8150 | * init/tests/test_job.c (test_release_depends): Test the behaviour |
| 8151 | of the function on its own. |
| 8152 | |
Scott James Remnant | 1da1dad | 2006-08-16 12:18:50 +0100 | [diff] [blame] | 8153 | * init/job.h (Job): Add depends list field |
| 8154 | (JobName): New structure to hold the name of a job. |
| 8155 | * init/job.c (job_new): Initialise the depends list. |
| 8156 | * init/tests/test_job.c (test_new): Make sure the depends list is |
| 8157 | initialised properly. |
| 8158 | |
Scott James Remnant | 37eee03 | 2006-08-16 12:10:49 +0100 | [diff] [blame] | 8159 | * init/job.c (job_next_state): Return JOB_STARTING if we're in |
| 8160 | JOB_WAITING and the goal is JOB_START. This is only called when |
| 8161 | there's some change, and I don't want to hard-code the goal there. |
| 8162 | (job_start): Don't hardcode JOB_STARTING, instead just use the next |
| 8163 | state. |
| 8164 | * init/tests/test_job.c (test_next_state): Adjust test case. |
| 8165 | |
Scott James Remnant | c3d3ead | 2006-08-16 09:00:50 +0100 | [diff] [blame] | 8166 | * init/control.c (control_subscribe): Allow the current |
| 8167 | subscription to be found by passing NOTIFY_NONE. |
| 8168 | (control_handle): Don't remove an existing subscription to jobs, |
| 8169 | a GUI will probably want a permanent one to keep the status up to |
| 8170 | date. |
| 8171 | |
Scott James Remnant | b9a568c | 2006-08-16 08:57:46 +0100 | [diff] [blame] | 8172 | * init/job.c (job_kill_process, job_kill_timer): Don't hardcode |
| 8173 | JOB_STOPPING here, instead move to the next logical state. |
| 8174 | (job_kill_process): Notify subscribed processes that we killed |
| 8175 | the job. |
| 8176 | (job_start, job_stop): Notify subscribed processes of a change of |
| 8177 | goal that doesn't result in an immediate state change. |
| 8178 | |
Scott James Remnant | 8dbc601 | 2006-08-16 08:57:38 +0100 | [diff] [blame] | 8179 | * init/event.c (event_trigger_edge, event_trigger_level): Swap |
| 8180 | order so that events are announced before processed. |
| 8181 | |
Scott James Remnant | 2816125 | 2006-08-16 08:41:48 +0100 | [diff] [blame] | 8182 | * init/control.c (control_handle): Handle requests to watch and |
| 8183 | unwatch jobs and events. |
| 8184 | * init/tests/test_control.c (test_cb_child, test_cb): Check that |
| 8185 | subscriptions work. |
| 8186 | |
Scott James Remnant | b6d55bf | 2006-08-16 08:24:16 +0100 | [diff] [blame] | 8187 | * init/tests/test_control.c (test_cb_child): Add a sleep to avoid |
| 8188 | a race that upsets gdb, have tried this with a STOP/CONT interlock |
| 8189 | but can't seem to find where the child should reach first. |
| 8190 | |
Scott James Remnant | 5612b23 | 2006-08-16 08:21:06 +0100 | [diff] [blame] | 8191 | * init/job.c (job_change_state): Notify the control handler. |
| 8192 | * init/event.c (event_trigger_edge, event_trigger_level): Pass |
| 8193 | event to the control handler. |
| 8194 | * init/tests/test_control.c (test_cb_child): Expect to receive |
| 8195 | job status events as well. |
| 8196 | * init/Makefile.am (test_event_LDADD, test_process_LDADD) |
| 8197 | (test_job_LDADD): Add control.o to the linkage. |
| 8198 | |
Scott James Remnant | 9e0626a | 2006-08-16 08:17:07 +0100 | [diff] [blame] | 8199 | * init/control.c (control_cb): Don't display an error for |
| 8200 | ECONNREFUSED, just remove any subscriptions. |
| 8201 | * init/tests/test_control.c (test_handle_job, test_handle_error): |
| 8202 | Clean up our subscriptions properly. |
| 8203 | |
Scott James Remnant | 3c465c8 | 2006-08-16 07:40:24 +0100 | [diff] [blame] | 8204 | * init/control.c (control_handle_job): Function to send out an |
| 8205 | UPSTART_JOB_STATUS message to subscribed processes whenever a |
| 8206 | job state changes. |
| 8207 | (control_handle_event): Function to send out an |
| 8208 | UPSTART_EVENT_TRIGGERED message to subscribed processes whenever |
| 8209 | an event is triggered. |
| 8210 | * init/control.h: Update. |
| 8211 | * init/tests/test_control.c (test_handle_job, test_handle_event): |
| 8212 | Check that the functions work properly. |
| 8213 | |
Scott James Remnant | 16dadc5 | 2006-08-16 07:27:40 +0100 | [diff] [blame] | 8214 | * init/control.c (control_handle): Handle messages that trigger |
| 8215 | edge and level events; subscribe the process to receive notification |
| 8216 | of job changes during the event. |
| 8217 | * init/tests/test_control.c (test_cb_child): Check that the messages |
| 8218 | are handled properly (without subscription check). |
| 8219 | |
Scott James Remnant | a7ba72a | 2006-08-16 07:11:30 +0100 | [diff] [blame] | 8220 | * init/control.c (control_cb): Unsubscribe a process if it stops |
| 8221 | listening. |
| 8222 | |
Scott James Remnant | 2c9669c | 2006-08-16 07:10:05 +0100 | [diff] [blame] | 8223 | * init/control.c (control_send): Copy the pointers in the new |
| 8224 | event messages. |
| 8225 | * init/tests/test_control.c (test_send): Check the pointers are |
| 8226 | copied across correctly. |
| 8227 | |
Scott James Remnant | 15d61c6 | 2006-08-16 06:55:58 +0100 | [diff] [blame] | 8228 | * init/control.c (control_subscribe): Add function to handle |
| 8229 | processes that want to subscribe to changes. |
| 8230 | (control_init): Initialise the subscriptions list. |
| 8231 | * init/control.h: Add structures and prototypes. |
| 8232 | * init/tests/test_control.c (test_subscribe): Test the function. |
| 8233 | |
Scott James Remnant | 8692f76 | 2006-08-16 06:21:13 +0100 | [diff] [blame] | 8234 | * upstart/control.h (UpstartMsgType): add messages for triggering |
| 8235 | edge and level events, receiving the trigger for an event and for |
| 8236 | watching jobs and events. |
| 8237 | (UpstartEventTriggerEdgeMsg, UpstartEventTriggerLevelMsg) |
| 8238 | (UpstartEventTriggeredMsg, UpstartWatchJobsMsg) |
| 8239 | (UpstartUnwatchJobsMsg, UpstartWatchEventsMsg): |
| 8240 | (UpstartUnwatchEventsMsg): Add structures for the new messages. |
| 8241 | (UpstartMsg): And add them to the union. |
| 8242 | * upstart/control.c (WireEventPayload): The event messages can all |
| 8243 | share a wire payload type; the watch messages don't need any special |
| 8244 | payload. |
| 8245 | (upstart_send_msg_to): Add the payloads onto the wire. |
| 8246 | (upstart_recv_msg): And take the payloads back off the wire. |
| 8247 | * upstart/tests/test_control.c (test_messages): Test the new |
| 8248 | message types. |
| 8249 | |
Scott James Remnant | 8ed97eb | 2006-08-16 05:46:44 +0100 | [diff] [blame] | 8250 | * upstart/control.h (UpstartJobStatusMsg): add a process id. |
| 8251 | * upstart/control.c (WireJobStatusPayload): and here too. |
| 8252 | (upstart_send_msg_to): copy the process id onto the wire. |
| 8253 | (upstart_recv_msg): copy the process id from the wire. |
| 8254 | * init/control.c (control_handle): Fill in the pid from the job. |
| 8255 | * upstart/tests/test_control.c (test_messages): Check the pid gets |
| 8256 | passed across the wire properly. |
| 8257 | |
Scott James Remnant | 7d91431 | 2006-08-16 05:37:50 +0100 | [diff] [blame] | 8258 | * init/control.c (control_cb): Disable the poll for write once the |
| 8259 | send queue becomes empty. |
| 8260 | |
Scott James Remnant | 59707c2 | 2006-08-16 05:32:20 +0100 | [diff] [blame] | 8261 | * upstart/Makefile.am (libupstart_la_SOURCES): Correct ordering. |
| 8262 | |
Scott James Remnant | a98c8b8 | 2006-08-16 05:32:02 +0100 | [diff] [blame] | 8263 | * init/control.c (control_handle): Add missing break. |
| 8264 | |
Scott James Remnant | b5c7a30 | 2006-08-16 05:24:55 +0100 | [diff] [blame] | 8265 | * upstart/job.c (job_goal_name, process_state_name): For completeness |
| 8266 | add these two functions as well. |
| 8267 | * upstart/job.h: Update. |
| 8268 | * upstart/tests/test_job.c (test_goal_name) |
| 8269 | (test_process_state_name): Test the new functions. |
| 8270 | |
Scott James Remnant | 20b15ad | 2006-08-16 05:20:02 +0100 | [diff] [blame] | 8271 | * init/job.c (job_state_name): Move this utility function from here |
| 8272 | * upstart/job.c (job_state_name): to here so all clients can use |
| 8273 | it. |
| 8274 | * init/job.h: Update. |
| 8275 | * upstart/job.h: Update. |
| 8276 | * init/tests/test_job.c (test_state_name): Move the test case from here |
| 8277 | * upstart/tests/test_job.c: to here as well. |
| 8278 | * upstart/Makefile.am (libupstart_la_SOURCES): Build and link job.c |
| 8279 | (TESTS): Run the job test cases |
| 8280 | (test_job_SOURCES, test_job_LDFLAGS, test_job_LDADD): Details for |
| 8281 | job test case binary. |
| 8282 | * init/Makefile.am (test_job_LDADD, test_process_LDADD) |
| 8283 | (test_event_LDADD): Link to libupstart.la |
| 8284 | |
Scott James Remnant | 7a5c667 | 2006-08-16 05:01:13 +0100 | [diff] [blame] | 8285 | * init/control.c: Code to handle the server end of the control |
| 8286 | socket, a bit more complex than a client as we want to avoid |
| 8287 | blocking on malcious clients. |
| 8288 | * init/control.h: Prototypes. |
| 8289 | * init/tests/test_control.c: Test the control code. |
| 8290 | * init/Makefile.am (init_SOURCES): Build and link control.c |
| 8291 | using the control.h header |
| 8292 | (init_LDADD): Link to libupstart as well |
| 8293 | (TESTS): Build and run the control test suite. |
| 8294 | (test_control_SOURCES, test_control_LDFLAGS, test_control_LDADD): |
| 8295 | Details for control test suite binary. |
| 8296 | |
Scott James Remnant | b7cbda5 | 2006-08-16 04:53:38 +0100 | [diff] [blame] | 8297 | * upstart/control.c: Add a way to disable the safety checks. |
| 8298 | * upstart/tests/test_control.c (test_free): Fix bad test case. |
| 8299 | |
Scott James Remnant | 71d4d84 | 2006-08-16 04:29:21 +0100 | [diff] [blame] | 8300 | * upstart/control.c (upstart_recv_msg): fixed bogus return type |
| 8301 | for recvmsg from size_t to ssize_t so we don't infiniloop on error. |
| 8302 | |
Scott James Remnant | 2bda383 | 2006-08-16 03:41:10 +0100 | [diff] [blame] | 8303 | * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Avoid |
| 8304 | job_start as the short-cut for assigning name, as that might become |
| 8305 | a more complex message eventually. Use job_query instead. |
| 8306 | |
Scott James Remnant | d154b95 | 2006-08-16 03:39:35 +0100 | [diff] [blame] | 8307 | * upstart/control.c (upstart_free): Add wrapper function around |
| 8308 | nih_free so we're a proper library and don't expose libnih too much |
| 8309 | (upstart_recv_msg): Stash the sender pid in an argument. |
| 8310 | * upstart/control.h: Update. |
| 8311 | * upstart/tests/test_control.c (test_recv_msg): Test pid is |
| 8312 | returned properly. |
| 8313 | (test_free): Test the nih_free wrapper. |
| 8314 | |
Scott James Remnant | dc0eb44 | 2006-08-16 02:40:29 +0100 | [diff] [blame] | 8315 | * init/job.c (job_run_script): Document future FIXME. |
| 8316 | |
Scott James Remnant | 2f55853 | 2006-08-16 02:24:55 +0100 | [diff] [blame] | 8317 | * init/exent.h, init/job.h, init/process.h: Fix up headers. |
| 8318 | |
Scott James Remnant | 45aab69 | 2006-08-16 02:23:27 +0100 | [diff] [blame] | 8319 | * upstart/control.c, upstart/control.h, upstart/errors.h, |
| 8320 | upstart/job.h, upstart/libupstart.h: Fix up headers. |
| 8321 | |
Scott James Remnant | 8c16cc8 | 2006-08-16 02:13:40 +0100 | [diff] [blame] | 8322 | * upstart/control.c: Write the code to handle the control socket |
| 8323 | and communication over it; turns out this was possible to write so |
| 8324 | that both ends are handled in the same code. |
| 8325 | * upstart/control.h: Structures and prototypes. |
| 8326 | * upstart/tests/test_control.c: Test the new code. |
| 8327 | |
Scott James Remnant | 729d922 | 2006-08-16 02:12:23 +0100 | [diff] [blame] | 8328 | * upstart/Makefile.am (libupstart_la_LIBADD): Link to libnih |
| 8329 | |
Scott James Remnant | b981443 | 2006-08-16 02:11:51 +0100 | [diff] [blame] | 8330 | * upstart/errors.h: Header file containing errors raised by |
| 8331 | libupstart. |
| 8332 | * upstart/libupstart.h: Include errors.h |
| 8333 | |
Scott James Remnant | 342451a | 2006-08-15 00:08:20 +0100 | [diff] [blame] | 8334 | 2006-08-15 Scott James Remnant <scott@netsplit.com> |
| 8335 | |
Scott James Remnant | 0a8e347 | 2006-08-15 23:54:14 +0100 | [diff] [blame] | 8336 | * init/event.h: Add missing attribute for event_new() |
| 8337 | |
Scott James Remnant | 6f12887 | 2006-08-15 23:54:05 +0100 | [diff] [blame] | 8338 | * init/job.h (JobGoal, JobState, ProcessState, ConsoleType): Move |
| 8339 | the enums from here |
| 8340 | * upstart/job.h: into here so that we can use them across the |
| 8341 | control socket. |
| 8342 | |
Scott James Remnant | e583179 | 2006-08-15 21:46:21 +0100 | [diff] [blame] | 8343 | * Makefile.am (SUBDIRS): Build the libupstart library |
| 8344 | * configure.ac (AC_CONFIG_FILES): Generate upstart/Makefile |
| 8345 | * upstart/Makefile.am: Makefile for sub-directory |
| 8346 | * upstart/libupstart.ver: Linker version script. |
| 8347 | * upstart/libupstart.h: "Include everything" header file. |
| 8348 | |
Scott James Remnant | 26a8eec | 2006-08-15 05:46:27 +0100 | [diff] [blame] | 8349 | * TODO: Update. |
| 8350 | |
Scott James Remnant | 1f8619c | 2006-08-15 05:45:38 +0100 | [diff] [blame] | 8351 | * init/job.c (job_handle_child): Warn when processes are killed |
| 8352 | or exit with an abnormal status. Warn when respawning. |
| 8353 | |
Scott James Remnant | eb5ad27 | 2006-08-15 05:43:05 +0100 | [diff] [blame] | 8354 | * init/job.c (job_handle_child): Respawn processes that were not |
| 8355 | supposed to have died. |
| 8356 | * init/tests/test_job.c (test_handle_child): Test the respawn code. |
| 8357 | |
Scott James Remnant | 77c926d | 2006-08-15 05:22:08 +0100 | [diff] [blame] | 8358 | * TODO: Update. |
| 8359 | |
Scott James Remnant | 429cd67 | 2006-08-15 05:09:51 +0100 | [diff] [blame] | 8360 | * init/event.c (event_trigger_edge, event_trigger_level): Call |
| 8361 | job_handle_event so that we actually do something useful. |
| 8362 | * init/Makefile.am (test_event_LDADD): Link to process.o and job.o |
| 8363 | now that event.c calls code from job. |
| 8364 | |
Scott James Remnant | 355e1b6 | 2006-08-15 05:07:24 +0100 | [diff] [blame] | 8365 | * init/job.c (job_start_event): Function to start a job if an event |
| 8366 | matches. |
| 8367 | (job_stop_event): Function to stop a job if an event matches. |
| 8368 | (job_handle_event): Iterate the job list and dispatch the given event, |
| 8369 | causing jobs to be stopped or started using the above two functions. |
| 8370 | * init/job.h: Update. |
| 8371 | * init/tests/test_job.c: Test the new functions. |
| 8372 | |
Scott James Remnant | 923400d | 2006-08-15 04:27:44 +0100 | [diff] [blame] | 8373 | * init/job.c (job_new): Initialise start_events and stop_events to |
| 8374 | an empty list. |
| 8375 | * init/job.h (Job): Add start_events and stop_events list heads. |
| 8376 | * init/tests/test_job.c (test_new): Check the lists are initialised |
| 8377 | correctly to the empty list. |
| 8378 | |
Scott James Remnant | 865534f | 2006-08-15 04:22:06 +0100 | [diff] [blame] | 8379 | * init/event.c (event_match): Function to check events for equality. |
| 8380 | * init/event.h: Update. |
| 8381 | * init/tests/test_event.c (test_match): Test function. |
| 8382 | |
Scott James Remnant | 97137a7 | 2006-08-15 04:07:08 +0100 | [diff] [blame] | 8383 | * init/job.c (job_change_state): Trigger the level event with the |
| 8384 | same name as the job, with the value taken from the state. |
| 8385 | * init/tests/test_job.c (test_change_state): Check the event |
| 8386 | gets set to the right values as we go. |
| 8387 | * init/Makefile.am (test_job_LDADD, test_process_LDADD): Link to |
| 8388 | event.o now that job.c uses code from there. |
| 8389 | |
Scott James Remnant | 3b35a52 | 2006-08-15 04:01:32 +0100 | [diff] [blame] | 8390 | * init/event.c (event_change_value): Rename event_set_value to this |
| 8391 | as we intended in the first place; makes it more consistent with job. |
| 8392 | Always change the value. |
| 8393 | (event_trigger_edge): Add a high-level function to trigger an edge |
| 8394 | event. |
| 8395 | (event_trigger_level): And another to trigger a level event with |
| 8396 | a given value, this inherits the "don't change it" functionality |
| 8397 | that was in event_set_value. |
| 8398 | * init/event.h: Update. |
| 8399 | * init/tests/test_event.c: Test new behaviours and functions. |
| 8400 | |
Scott James Remnant | 4fef073 | 2006-08-15 01:45:02 +0100 | [diff] [blame] | 8401 | * init/event.c: Add simple code to keep track of events, whether |
| 8402 | they have been recorded or not and their current value if any. |
| 8403 | * init/event.h: Structures and prototypes. |
| 8404 | * init/tests/test_event.c: Test cases for event code. |
| 8405 | * init/Makefile.am (init_SOURCES): Build and link event.c using event.h |
| 8406 | (TESTS): Run the event test suite. |
| 8407 | (test_event_SOURCES, test_event_LDFLAGS, test_event_LDADD): Details |
| 8408 | for event test suite binary. |
| 8409 | |
Scott James Remnant | 38fc8ff | 2006-08-15 00:43:26 +0100 | [diff] [blame] | 8410 | * init/job.c (job_run_process, job_kill_process, job_kill_timer): |
| 8411 | Downgrade error messages to warning as they're not fatal. |
| 8412 | (job_change_state): Change info message to be more regular. |
| 8413 | |
Scott James Remnant | f033fb0 | 2006-08-15 00:37:33 +0100 | [diff] [blame] | 8414 | * init/job.c (job_start): A very simple, but very necessary, function. |
| 8415 | Set the goal of the given job to JOB_START and kick it off. |
| 8416 | (job_stop): And its companion, cause a running job to be stopped. |
| 8417 | * init/job.h: Update. |
| 8418 | * init/tests/test_job.c: Test the functions. |
| 8419 | |
Scott James Remnant | 342451a | 2006-08-15 00:08:20 +0100 | [diff] [blame] | 8420 | * init/job.c (job_handle_child): Child handler to kick jobs into |
| 8421 | the next state when their process dies. |
| 8422 | * init/job.h: Update. |
| 8423 | * init/tests/test_job.c (test_handle_child): Test the handler |
| 8424 | directly by just invoking it with various job states. |
| 8425 | |
Scott James Remnant | 1c463b9 | 2006-08-14 14:46:17 +0100 | [diff] [blame] | 8426 | 2006-08-14 Scott James Remnant <scott@netsplit.com> |
| 8427 | |
Scott James Remnant | 51c827d | 2006-08-14 23:06:00 +0100 | [diff] [blame] | 8428 | * init/tests/test_process.c (test_kill): Use select rather than |
| 8429 | poll for consistency with other test cases. |
| 8430 | |
Scott James Remnant | e6e4a73 | 2006-08-14 23:04:53 +0100 | [diff] [blame] | 8431 | * init/job.c (job_kill_process): Add function to send the active |
| 8432 | process of a job the TERM signal, and then set a timer to follow |
| 8433 | up with the KILL signal if the job doesn't get cleaned up in time. |
| 8434 | (job_kill_timer): Timer callback to send the KILL signal; this |
| 8435 | does the same job as the child handler and puts the job into the |
| 8436 | next state as there's no point waiting around now. |
| 8437 | * init/job.h: Update. |
| 8438 | * init/tests/test_job.c (test_kill_process): Test both functions |
| 8439 | in one test case (as one is just the bottom half of the other). |
| 8440 | |
Scott James Remnant | 6868f65 | 2006-08-14 21:42:45 +0100 | [diff] [blame] | 8441 | * init/tests/test_process.c (test_spawn): Use the right thing in |
| 8442 | the test case filename and unlink it to make sure. |
| 8443 | |
Scott James Remnant | 85df942 | 2006-08-14 21:41:39 +0100 | [diff] [blame] | 8444 | * init/job.c (job_change_state): Write the principal state gate |
| 8445 | function, called once a state has been left to enter the given new |
| 8446 | state (which one should determine with job_next_state). Spawns |
| 8447 | the necessary processes or moves to the next appropriate state. |
| 8448 | * init/job.h: Update. |
| 8449 | * init/tests/test_job.c: Test the state changes. |
| 8450 | |
Scott James Remnant | ba44b8b | 2006-08-14 20:06:28 +0100 | [diff] [blame] | 8451 | * init/job.c (job_run_process): Internal function to call |
| 8452 | process_spawn and update the job structure. |
| 8453 | (job_run_command): Simple(ish) wrapper for the above to split |
| 8454 | a command by whitespace, or use a shell if it needs more complex |
| 8455 | argument processing. |
| 8456 | (job_run_script): More complex wrapper that uses a shell to execute |
| 8457 | verbatim script, either using -c or a /dev/fd/NN and feeding the |
| 8458 | shell down a pipe to it. |
| 8459 | * init/job.h: Update. |
| 8460 | * init/tests/test_job.c: Test the new functions. |
| 8461 | |
Scott James Remnant | 156f548 | 2006-08-14 19:09:55 +0100 | [diff] [blame] | 8462 | * init/Makefile.am (init_SOURCES, TESTS): Reorder so that process.c, |
| 8463 | which is arguably lower level, comes first. |
| 8464 | (test_job_LDADD): Link the process code. |
| 8465 | (test_process_LDADD): Swap the order. |
| 8466 | |
Scott James Remnant | 00bcc93 | 2006-08-14 19:07:28 +0100 | [diff] [blame] | 8467 | * TODO: Update. |
| 8468 | |
Scott James Remnant | 1c463b9 | 2006-08-14 14:46:17 +0100 | [diff] [blame] | 8469 | * init/process.c (process_spawn): Correct typo (progress -> process), |
| 8470 | thanks Johan. |
| 8471 | |
Scott James Remnant | 43534ca | 2006-08-12 14:52:01 +0100 | [diff] [blame] | 8472 | 2006-08-12 Scott James Remnant <scott@netsplit.com> |
| 8473 | |
Scott James Remnant | 3030cc2 | 2006-08-12 15:18:55 +0100 | [diff] [blame] | 8474 | * init/process.c (process_spawn): Correct formatting of function. |
| 8475 | * init/process.h (SHELL): Define the location of the shell, all in |
| 8476 | the spirit of not hard-coding stuff like this. |
| 8477 | |
Scott James Remnant | 43534ca | 2006-08-12 14:52:01 +0100 | [diff] [blame] | 8478 | * init/job.c (job_new): Initialise all structure members to zero |
| 8479 | as this doesn't happen automatically. |
| 8480 | |
Scott James Remnant | 60b03e3 | 2006-08-10 00:59:00 +0100 | [diff] [blame] | 8481 | 2006-08-10 Scott James Remnant <scott@netsplit.com> |
| 8482 | |
| 8483 | * init/job.h (job_state_name): Declare as a const function. |
| 8484 | |
Scott James Remnant | 143a857 | 2006-08-09 17:37:00 +0100 | [diff] [blame] | 8485 | 2006-08-09 Scott James Remnant <scott@netsplit.com> |
| 8486 | |
Scott James Remnant | d945d2e | 2006-08-09 23:47:44 +0100 | [diff] [blame] | 8487 | * init/job.c (job_next_state): State transition logic; this uses |
| 8488 | our departure from the specification (the goal) so that the state |
| 8489 | can always be currently accurate rather than suggestive. |
| 8490 | (job_state_name): Cute function to convert enum into a name. |
| 8491 | * init/job.h: Update. |
| 8492 | * init/tests/test_job.c (test_next_state): Test the transitions. |
| 8493 | (test_state_name): And the return values. |
| 8494 | |
Scott James Remnant | 5fa1567 | 2006-08-09 23:23:17 +0100 | [diff] [blame] | 8495 | * TODO: Add file to keep track of things. |
| 8496 | |
Scott James Remnant | dbc7861 | 2006-08-09 23:22:45 +0100 | [diff] [blame] | 8497 | * init/job.c: Include nih/macros.h and nih/list.h |
| 8498 | * init/process.c: Include order fixing, include nih/macros.h |
| 8499 | * init/tests/test_job.c: Include nih/macros.h and nih/list.h |
| 8500 | * init/tests/test_process.c: Include nih/list.h |
| 8501 | |
Scott James Remnant | 03853ed | 2006-08-09 23:11:59 +0100 | [diff] [blame] | 8502 | * init/job.c: Include order fixing. |
| 8503 | (job_find_by_name): Function to find a job by its (unique) name. |
| 8504 | (job_find_by_pid): Function to find a job by the pid of its process. |
| 8505 | * init/job.h: Update. |
| 8506 | * init/tests/test_job.c (test_find_by_name, test_find_by_pid): Test |
| 8507 | new functions. |
| 8508 | |
Scott James Remnant | 143a857 | 2006-08-09 17:37:00 +0100 | [diff] [blame] | 8509 | * init/process.c (process_spawn): Spawn a process using the job |
| 8510 | details to set up the environment, etc. |
| 8511 | (process_setup_console): Set up the console according to the job. |
| 8512 | (process_setup_limits): Set up the limits according to the job. |
| 8513 | (process_setup_environment): Set up the environment according to |
| 8514 | the job. |
| 8515 | (process_kill): Simple function to send a kill signal or raise an |
| 8516 | error; mostly just a wrapper without any particular logic. |
| 8517 | * init/process.h: Prototypes and macros. |
| 8518 | * init/tests/test_process.c: Test cases. |
| 8519 | * init/Makefile.am (init_SOURCES): Build and link process.c and |
| 8520 | its header file. |
| 8521 | (TESTS): Run the process test suite. |
| 8522 | (test_process_SOURCES, test_process_LDFLAGS, test_process_LDADD): |
| 8523 | Details for process test sutie binary. |
| 8524 | |
Scott James Remnant | 29abda0 | 2006-08-08 15:01:24 +0100 | [diff] [blame] | 8525 | 2006-08-08 Scott James Remnant <scott@netsplit.com> |
| 8526 | |
Scott James Remnant | 31ee263 | 2006-08-08 15:06:02 +0100 | [diff] [blame] | 8527 | * init/job.c (job_new): nih_list_free is necessary. |
| 8528 | * init/tests/test_job.c (test_new): Free job when done. |
| 8529 | |
Scott James Remnant | 29abda0 | 2006-08-08 15:01:24 +0100 | [diff] [blame] | 8530 | * init/job.h: Header file to contain the definition of the Job |
| 8531 | structure and associated typedefs, etc. |
| 8532 | (JobGoal): In a divergence from the specification, we introduced a |
| 8533 | "goal" for a job which tells us which way round the state machine |
| 8534 | we're going (towards start, or towards stop). |
| 8535 | (JobState): Which means this always holds the current state, even |
| 8536 | if we're trying to get out of this state (ie. if we've sent the TERM |
| 8537 | signal to the running process, we're still in the running state until |
| 8538 | it's actually been reaped). |
| 8539 | (ProcessState): And in another divergence, we keep the state of the |
| 8540 | process so we know whether we need to force a state transition or |
| 8541 | can just expect one because something transient is happening. |
| 8542 | * init/job.c (job_new): Function to allocate a Job structure, set |
| 8543 | the pointers to NULL and other important members to sensible |
| 8544 | defaults. |
| 8545 | (job_init): Initialise the list of jobs. |
| 8546 | * init/tests/test_job.c: Test suite. |
| 8547 | * init/Makefile.am (init_SOURCES): Compile and link job.c using |
| 8548 | its header file. |
| 8549 | (TESTS): Run the job test suite. |
| 8550 | (test_job_SOURCES, test_job_LDFLAGS, test_job_LDADD): Details for the |
| 8551 | job test suite binary. |
| 8552 | |
Scott James Remnant | b933bc9 | 2006-08-02 02:29:25 +0100 | [diff] [blame] | 8553 | 2006-08-02 Scott James Remnant <scott@netsplit.com> |
| 8554 | |
Scott James Remnant | 6c7667a | 2006-08-02 02:43:12 +0100 | [diff] [blame] | 8555 | * configure.ac: Check for C99 |
| 8556 | |
Scott James Remnant | b933bc9 | 2006-08-02 02:29:25 +0100 | [diff] [blame] | 8557 | * HACKING: Document dependency on libnih. |
| 8558 | |
Scott James Remnant | a780d6c | 2006-07-27 18:40:51 +0100 | [diff] [blame] | 8559 | 2006-07-27 Scott James Remnant <scott@netsplit.com> |
| 8560 | |
| 8561 | * init/Makefile.am (DEFS): Append to the default DEFS list, rather |
| 8562 | than overriding, otherwise we lose HAVE_CONFIG_H |
| 8563 | |
Scott James Remnant | b6270dd | 2006-07-13 02:16:38 +0100 | [diff] [blame] | 8564 | 2006-07-13 Scott James Remnant <scott@netsplit.com> |
| 8565 | |
Scott James Remnant | 1bb3514 | 2006-07-13 02:30:58 +0100 | [diff] [blame] | 8566 | * HACKING: Correct incorrect Bazaar URL. |
| 8567 | |
Scott James Remnant | b6270dd | 2006-07-13 02:16:38 +0100 | [diff] [blame] | 8568 | * AUTHORS: Change e-mail address to ubuntu.com. |
| 8569 | * HACKING: Update Bazaar and Release URLS. |
| 8570 | * configure.ac (AC_COPYRIGHT): Change copyright to Canonical Ltd. |
| 8571 | (AC_INIT): Change bug submission address to Launchpad. |
| 8572 | * init/main.c: Update header to use Canonical copyright and |
| 8573 | credit me as author. |
| 8574 | |
Scott James Remnant | 5074884 | 2006-05-16 21:02:31 +0100 | [diff] [blame] | 8575 | 2006-05-16 Scott James Remnant <scott@netsplit.com> |
| 8576 | |
| 8577 | * init/main.c: Add the simplest template main.c |
| 8578 | * init/Makefile.am: Add template Makefile.am that builds init from |
| 8579 | main.c and links to libnih statically |
| 8580 | * configure.ac (AC_CONFIG_FILES): Configure nih and init subdirs. |
| 8581 | * Makefile.am (SUBDIRS): Recurse into nih and init subdirs. |
| 8582 | |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 8583 | 2006-05-14 Scott James Remnant <scott@netsplit.com> |
| 8584 | |
| 8585 | * ChangeLog: Initial project infrastructure created. |