lp:~jamesodhunt/upstart/bug-1079715

Created by James Hunt and last modified
Get this branch:
bzr branch lp:~jamesodhunt/upstart/bug-1079715
Only James Hunt can upload to this branch. If you are James Hunt please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
James Hunt
Project:
upstart
Status:
Merged

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_deserialise_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".

1391. By James Hunt

* init/state.c: state_get_job(): Initialised class to ensure
  defined behaviour.

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.

1389. By Steve Langasek

simplify code: avoid extra unnecessary strdup

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
This branch contains Public information 
Everyone can see this information.

Subscribers