lp:~jamesodhunt/upstart/bug-1079715
- Get this branch:
- bzr branch lp:~jamesodhunt/upstart/bug-1079715
Branch merges
- Steve Langasek: Needs Fixing
-
Diff: 1119 lines (+722/-64)10 files modifieddbus/com.ubuntu.Upstart.xml (+4/-0)
init/Makefile.am (+9/-2)
init/control.c (+62/-0)
init/control.h (+5/-0)
init/job_class.c (+36/-28)
init/session.h (+2/-1)
init/state.c (+111/-20)
init/state.h (+12/-0)
init/tests/data/upstart-1.6.json (+1/-0)
init/tests/test_state.c (+480/-13)
- Steve Langasek: Needs Fixing
-
Diff: 1119 lines (+722/-64)10 files modifieddbus/com.ubuntu.Upstart.xml (+4/-0)
init/Makefile.am (+9/-2)
init/control.c (+62/-0)
init/control.h (+5/-0)
init/job_class.c (+36/-28)
init/session.h (+2/-1)
init/state.c (+111/-20)
init/state.h (+12/-0)
init/tests/data/upstart-1.6.json (+1/-0)
init/tests/test_state.c (+480/-13)
Branch information
Recent revisions
- 1395. By James Hunt
-
* init/control.c: control_
get_state( ):
- Simplified session check.
- Changed error message to refer to 'state', not 'restart'.
- Don't call control_bus_flush() since it's not technically required
in this non-re-exec scenario.
* init/state.c: state_write_file():
- Added comment.
- Check write for EINTR, not EAGAIN/EWOULDBLOCK. - 1394. By James Hunt
-
* dbus/com.
ubuntu. Upstart. xml: Added 'GetState' method that returns
internal state in JSON format.
* init/Makefile.am:
- Added TEST_DATA_DIR to allow tests to find data files.
- Added test data files to distribution.
* init/control.c: control_get_state( ): Implementation for D-Bus
'GetState' method.
* init/control.h: Prototype for control_get_state( ).
* init/state.c:
- state_serialise_blocked: Remove static to allow tests to access them.
- state_deserialise_blocked: Remove static to allow tests to access them.
- state_read_objects( ): Attempt to write the state to file
STATE_FILE if deserialisation fails as an aid
to diagnosing the cause of the failure.
* init/state.h: Define STATE_FILE ('/var/log/upstart/ upstart. state') .
* init/tests/test_state. c:
- TestDataFile: New type to represent data files.
- test_data_files: Array of data files to test.
- test_blocking():
- New tests:
- "BLOCKED_JOB serialisation and deserialisation".
- "BLOCKED_EVENT serialisation and deserialisation".
- Removed test now handled by test_upstart1_6_upgrade( ):
"BLOCKED_JOB iwth no JSON session object".
- test_upgrade(): Iterate test_data_files, processing data files.
- test_upstart1_6_upgrade( ): Test for handling Upstart 1.6
serialisation format.
- main(): Call test_upgrade().
* init/tests/data/upstart- 1.6.json: Test data used by test_state.c for
upgrade testing. - 1393. By James Hunt
-
* init/tests/
test_state. c: test_blocked():
- Improved comments.
- New test: "ensure BLOCKED_JOB with non-NULL session is ignored". - 1392. By James Hunt
-
* init/state.c: state_deseriali
se_blocked( ): Set session to NULL to
handle Upstart-1.6 serialisation.
* init/tests/test_job_ process. c: child(): Remove unused variables in and
buffer.
* init/tests/test_state. c: test_blocking(): Additional tests to check
that it is possible to deserialise Upstart 1.6 JSON format (which does
not include the "session" JSON attribute for blocked objects. New
tests:
- "BLOCKED_JOB with no JSON session object".
- "BLOCKED_JOB with JSON session object". - 1390. By James Hunt
-
* init/job_class.c:
- job_class_consider( ): Removed redundant braces.
- job_class_reconsider( ): Removed redundant braces.
- job_class_add_safe( ): Consider session before asserting
(LP: #1079715).
- job_class_serialise( ):
- Explicitly disallow user and chroot sessions
from being serialised since this scenario is not supported
(due to our not serialising ConfSource objects yet).
- job_class_deserialise( ):
- Check session as early as possible.
- Removed NIH_MUST() to allow check on job_class_new().
- Assert that we do not have user and chroot sessions to deal with.
- Fix potential invalid free if error occurs before JobClass
is created.
- job_class_deserialise_ all():
- Explicitly ignore attempted deserialisation of user and chroot
sessions.
- Removed invalid comment.
* init/session.h: Comment.
* init/state.c:
- state_deserialise_resolve_ deps():
- Ignore classes associated with a user or chroot session.
- Specify new session parameter to state_get_job().
- state_serialise_blocked( ): Encode session index for BLOCKED_JOB.
- state_deserialise_blocked( ): Extract session from index index for
BLOCKED_JOB to pass to state_get_job().
- state_get_job(): Add @session parameter to allow exact job match. - 1388. By James Hunt
-
* init/job_process.c: job_process_
log_path( ): Make chroot jobs log
inside the chroot (LP: #1079710).
* init/man/init.5:
- State that jobs started from within a chroot are distinct from jobs
specifying the chroot stanza.
- State explicitly where chroot output is logged. - 1387. By Steve Langasek
-
don't test the blocked/ignored signal list in a spawned job; this is not
testing the upstart code but the characteristics of the system, and the test
is wrong because it assumes the signal lists in /proc/self/status fit in an
unsigned long int - patently untrue on mips, where we have 128 signals for
historical reasons. - 1386. By Steve Langasek
-
fix test which was accidentally relying on a variable persisting after
it's gone out of scope.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:upstart