lp://staging/~jamesodhunt/upstart/upstream-session-support
- Get this branch:
- bzr branch lp://staging/~jamesodhunt/upstart/upstream-session-support
Branch merges
- Upstart Developers: Pending requested
-
Diff: 13125 lines (+6395/-1019)56 files modifiedChangeLog (+219/-0)
Makefile.am (+1/-1)
TESTING.sessions (+264/-0)
conf/rc-sysinit.conf (+2/-0)
configure.ac (+3/-2)
contrib/bash_completion/upstart (+96/-36)
dbus/Upstart.conf (+6/-36)
dbus/upstart.h (+1/-1)
init/Makefile.am (+12/-0)
init/conf.c (+10/-5)
init/conf.h (+5/-2)
init/control.c (+73/-10)
init/control.h (+15/-1)
init/environ.c (+0/-1)
init/environ.h (+0/-1)
init/event.c (+10/-0)
init/event.h (+5/-1)
init/job.c (+44/-3)
init/job.h (+1/-1)
init/job_class.c (+113/-23)
init/job_class.h (+5/-1)
init/job_process.c (+59/-1)
init/job_process.h (+4/-3)
init/main.c (+234/-136)
init/man/init.5 (+131/-41)
init/man/init.8 (+32/-4)
init/parse_job.c (+4/-2)
init/parse_job.h (+4/-3)
init/paths.h (+25/-2)
init/session.c (+279/-0)
init/session.h (+87/-0)
init/tests/test_blocked.c (+4/-1)
init/tests/test_conf.c (+15/-13)
init/tests/test_control.c (+15/-11)
init/tests/test_environ.c (+3/-1)
init/tests/test_event.c (+28/-25)
init/tests/test_event_operator.c (+3/-0)
init/tests/test_job.c (+71/-76)
init/tests/test_job_class.c (+56/-65)
init/tests/test_job_process.c (+34/-30)
init/tests/test_parse_conf.c (+3/-0)
init/tests/test_parse_job.c (+263/-260)
init/tests/test_process.c (+3/-0)
init/tests/test_system.c (+3/-0)
po/upstart.pot (+292/-148)
scripts/Makefile.am (+25/-0)
scripts/init-checkconf.sh (+248/-0)
scripts/initctl2dot.py (+571/-0)
scripts/man/init-checkconf.8 (+73/-0)
scripts/man/initctl2dot.8 (+87/-0)
util/Makefile.am (+1/-1)
util/initctl.c (+1014/-17)
util/initctl.h (+458/-0)
util/man/initctl.8 (+200/-34)
util/reboot.c (+0/-1)
util/tests/test_initctl.c (+1181/-19)
Branch information
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. - 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" . - 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().
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp://staging/upstart