Merge authors: James Hunt (jamesodhunt) Related merge proposals: https://code.launchpad.net/~jamesodhunt/upstart/bug-1120660/+merge/147712 proposed by: James Hunt (jamesodhunt) ------------------------------------------------------------ revno: 1441 [merge] fixes bug: https://launchpad.net/bugs/1120660 committer: Steve Langasek <[email protected]> branch nick: upstream timestamp: Fri 2013-03-01 00:42:36 -0800 message: Merge lp:~jamesodhunt/upstart/bug-1120660 modified: ChangeLog init/log.c
-- lp:upstart https://code.launchpad.net/~upstart-devel/upstart/trunk Your team Upstart Reviewers is subscribed to branch lp:upstart. To unsubscribe from this branch go to https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'ChangeLog' --- ChangeLog 2013-02-27 11:46:04 +0000 +++ ChangeLog 2013-03-01 08:42:36 +0000 @@ -73,6 +73,13 @@ - test_usage(): Added extra checks and tidyup. - main(): Added call to test_quiesce(). +2013-02-11 James Hunt <[email protected]> + + * init/log.c: log_serialise(): Handle re-exec scenario where + jobs producing output have finished but where log data cannot + be persisted (for example where disk is full or log directory + is inaccessible). (LP: #1120660) + 2013-02-08 James Hunt <[email protected]> * dbus/com.ubuntu.Upstart.xml: Added 'EndSession' method. === modified file 'init/log.c' --- init/log.c 2013-01-21 16:24:48 +0000 +++ init/log.c 2013-02-11 16:53:58 +0000 @@ -854,14 +854,8 @@ if (! json) return NULL; - if (! log || (! log->io && log->unflushed && ! log->unflushed->len)) { - /* Create a "placeholder" log object for non-existent - * log objects and for those that are no longer usable. - */ - if (! state_set_json_string_var (json, "path", NULL)) - goto error; - return json; - } + if (! log || (! log->io && log->unflushed && ! log->unflushed->len)) + goto placeholder; /* Attempt to flush any cached data */ if (log->unflushed && log->unflushed->len) { @@ -874,7 +868,12 @@ (void)log_file_write (log, NULL, 0); } - nih_assert (log->io); + /* Job associated with log has ended. If we failed to write + * unflushed data above, it will now be lost as we cannot + * create a valid serialisation without an associated NihIo. + */ + if (! log->io) + goto placeholder; if (! state_set_json_int_var_from_obj (json, log, fd)) goto error; @@ -918,6 +917,14 @@ return json; +placeholder: + /* Create a "placeholder" log object for non-existent + * log objects and for those that are no longer usable. + */ + if (! state_set_json_string_var (json, "path", NULL)) + goto error; + return json; + error: json_object_put (json); return NULL;
-- upstart-devel mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/upstart-devel
