lp:~jamesodhunt/upstart/upstream-session-support

Created by James Hunt and last modified
Get this branch:
bzr branch lp:~jamesodhunt/upstart/upstream-session-support
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

1261. By James Hunt

* init/man/init.5: Update for User Jobs.
* init/man/init.8: Mention $HOME/.init/ for User Jobs.

1260. By James Hunt

* TESTING.sessions:
  - Added missing "set -x" call to force log output.
  - Formatting.
  - Added remaining expected outcomes.

1259. By James Hunt

* TESTING.sessions: Added missing awk param.

1258. By James Hunt

Add session support. Note that there are no automatically runnable and
explicit tests yet. However, see TESTING.sessions.

* TESTING.sessions: ASCII (reStructuredText) document explaining
  how to run manual tests for session support (for chroots).
* dbus/Upstart.conf: Simplified to support allowing users to invoke
  all methods (since Upstart now isolates commands by user).
* init/Makefile.am: Added session.[ch] files.
* init/session.c: New file. Note that session_from_dbus() will disable sessions
  (by returning the NULL session) if environment variable "UPSTART_NO_SESSIONS"
  is set to any value (used by tests).
* init/session.h: New file.
* init/parse_job.h: parse_job(): Add session pointer to prototype.
* init/parse_job.c:
  - parse_job(): Add session parameter.
  - Update calls to job_class_new() to pass session pointer.
* init/job.c: job_new(): Crucial change to ensure chroot sessions have
  a unique D-Bus name (LP:#728531).
* init/job_class.c:
  - job_class_new(): Add session parameter and session support.
  - job_class_remove(): Add session parameter to prototype.
  - job_class_consider(): Only consider jobs from the appropriate session.
  - job_class_reconsider(): Only consider jobs from the appropriate session.
  - job_class_start(): Disallow out-of-session modification.
  - job_class_stop(): Disallow out-of-session modification.
  - job_class_restart(): Disallow out-of-session modification.
* init/main.c: Add "--no-sessions" command-line option to disable
  sessions and revert to traditional behaviour.
* init/job_class.h:
  - job_class_new(): Add session pointer to prototype.
  - JobClass: Add session member.
* init/job_process.c: job_process_spawn():
  - Call chroot(2) for chroot sessions.
  - Call setuid(2) for user session jobs.
* init/job.c:
  - job_emit_event(): Set session for event.
  - job_start(): Disallow out-of-session modification.
  - job_stop(): Disallow out-of-session modification.
  - job_restart(): Disallow out-of-session modification.
* init/event.h: Event: Add session member.
* init/event.c:
  - event_new(): initialize session to NULL.
  - event_pending_handle_jobs(): Add session handling.
  - event_finished(): Set session for failure event.
* init/control.c:
  - control_get_job_by_name(): Add session handling.
  - control_get_all_jobs(): Add session handling.
  - control_emit_event(): Add session handling.
* init/conf.c:
  - conf_source_new(): Initialise session to NULL.
  - conf_reload_path(): Pass session to parse_job().
  - conf_select_job(): Add session parameter.
* init/conf.h:
  - ConfSource: Add session member.
  - conf_select_job(): Add session parameter to prototype.
* All tests updated to set "UPSTART_NO_SESSIONS".

1257. By James Hunt

Merge from upstream.

1256. By James Hunt

Updated tests using parse_job() so that we provide the NULL session.

1255. By James Hunt

Merge from Upstream.

1254. By James Hunt

* init/Makefile.am: Added session object to all test apps that need it.
* init/conf.c:
  - conf_source_new(): Explicitly set session pointer to NULL.
  - conf_select_job(): Addition of Session parameter.
* init/conf.h: Updated prototype for conf_select_job().
* init/control.c:
  - control_get_job_by_name(): Formatting and extra comments.
    Explicit set class to NULL. Modify logic to allow for multiple
    JobClass objects in job_classes hash with different associated Sessions.
  - control_get_all_jobs(): Added test on session object to avoid
    possible NULL pointer dereference.
* init/job.c: job_new(): Fix for nasty OOM scenario when an attempt is made
  to start a chroot job with same name as running single-instance non-chroot
  job. Previously, the path for a chrooted Job was set from the (nul) instance
  name of its parent JobClass. However, since that job instance name already
  existed outside the chroot and was already D-Bus registered,
  nih_dbus_object_new() (which allocates storage and is called by
  job_register()) returned NULL and kept doing so due to being called
  within NIH_MUST(). This resulted in OOM due to an as-yet unidentified
  D-Bus bug (possibly a leak in find_subtree_recurse()).
* init/job_class.c:
  - Added session paramter to job_class_remove() prototype.
  - job_class_new(): Updated function comment header.
  - job_class_consider(): Handle multiple jobs with same name
    (but different session) in job_classes hash.
  - job_class_reconsider(): Handle multiple jobs with same name
    (but different session) in job_classes hash.
  - job_class_remove(): Handle incorrect session.
* init/job_process.c: job_process_spawn(): Updated for sessions and
  chroots.
* init/job_process.h: New enums for:
  - JOB_PROCESS_ERROR_SETUID
  - JOB_PROCESS_ERROR_SETGID
* init/main.c:
  - Added extern for disable_sessions variable.
  - Addition of new command-line option "--no-sessions" to
    disable chroot+user sessions (providing a "traditional" Upstart
    environment).
* init/man/init.8: Updated for "--no-sessions".
* init/parse_job.c: Updated parse_job() header for @session.
* init/session.c:
  - Added disable_sessions variable, set via main().
  - session_from_dbus(): Added ability to disable sessions
    (disable_sessions variable or UPSTART_NO_SESSIONS environment
    variable - required for tests) and improved comments.
* init/session.h: Added summary table to Session comment header.
* Updated all tests by:
  - Setting UPSTART_NO_SESSIONS variable.
  - Adding missing session parameter for job_class_new(),
    conf_select_job() and parse_job().

1253. By James Hunt

Merge from upstream.

1252. By Scott James Remnant (Canonical)

better d-bus naming than %p

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