-
Committer:
James Hunt
-
Date:
2012-02-14 16:47:34 UTC
-
mto:
(1182.14.108 upstart)
-
mto:
This revision was merged to the branch mainline in
revision
1379.
-
Revision ID:
james.hunt@ubuntu.com-20120214164734-ta1diobv19tjk9m4
* dbus/com.ubuntu.Upstart.xml:
- added 'FlushEarlyJobLog' method.
* init/control.c:
- control_flush_early_job_log(): New function to flush early job log.
* init/job_process.c:
- job_process_terminated(): Call log_handle_unflushed() to potentially
add log object to unflushed list (the early job log) in certain
scenarios.
* init/log.c:
- log_flushed: bool indicating successful flush of early job log.
- log_unflushed_files: the "early job log" list.
- log_new(): Call log_unflushed_init() and initialize new log members.
- log_flush():
- Only call log_read_watch() conditionally now.
- Update for new log_file_open() return value.
- log_io_reader(): Update for new log_file_open() return value.
- log_io_error_handler(): Set remote_closed for the benefit of
log_flushed() (to avoid flushing multiple times).
- log_file_open: Now saves errno value from open(2).
- log_read_watch(): Removed log->unflushed->len assert since it was
erroneous: even if unflushed data exists, it will be written in
order when log_io_reader() calls log_file_write().
- log_unflushed_init(): New function to initialise the
log_unflushed_files list.
- log_handle_unflushed(): New function that potentially adds log
object to the log_unflushed_files list to allow the data to be
flushed _after_ the parent object has been destroyed.
- log_clear_unflushed(): New function to clear the
log_unflushed_files list by attempting to flush the data to disk.
* init/log.h:
- Added new Log members: detached, remote_closed and open_errno.
- Updated documentation.
- Added prototypes for new functions: log_handle_unflushed(),
log_clear_unflushed() and log_unflushed_init().
* init/tests/test_job_process.c:
- test_run():
- Call log_unflushed_init().
- Corrected grammar in error messages for "ensure sane fds" tests.
- "with single line command writing fast and exiting": Call
nih_child_add_watch().
- test_spawn():
- Call log_unflushed_init().
- "simple test": More memorable log file name, added call
to log_handle_unflushed(), added missing nih_free().
- "with multi-line script and 'console log'": More memorable log
file name.
- "with single-line script and 'console log'": More memorable log file
name.
- "read single null bytes with 'console log'": More memorable log
file name, call log_handle_unflushed(), added missing nih_free().
* init/tests/test_log.c:
- Comments.
- test_log_new(): Call log_unflushed_init().
- "object checks with uid 0": Add extra checks.
- "writing a new log file with uid 0": Call log_handle_unflushed()
and associated checks.
- New test "ensure logger flushes cached data on request"
- "ensure log written when directory created accessible with uid 0":
- Call log_handle_unflushed().
* util/initctl.c:
- flush_early_job_log_action(): New function to flush the early job
log.
- commands: Added new command flush-early-job-log.
* util/man/initctl.8: Updated for new flush-early-job-log command.
* util/tests/test_initctl.c:
- STOP_UPSTART(): Check return from kill(2).
- test_show_config(): Adding missing rmdir(2).
- test_check_config(): Adding missing rmdir(2).
- test_flush_early_job_log(): New function embodying new test
"with job ending before log disk writeable".