-
Committer:
James Hunt
-
Date:
2011-02-15 11:51:42 UTC
-
Revision ID:
james.hunt@ubuntu.com-20110215115142-8cl9ypw1yvk4ryxf
* contrib/utils/initctl2dot.py: Simply Python script to convert new initctl
output to GraphViz dot format. Example usage:
initctl2dot.py > upstart.dot && dot -Tpng -o upstart.png upstart.dot
* dbus/upstart.h: Whitespace fix.
* init/control.c:
- control_handle_bus_type(): New function to allow selection of
session bus via env var "UPSTART_USE_SESSION_BUS" (for testing).
- control_bus_open(): Connect to either D-Bus system bus or session bus.
* init/control.h: New define for USE_SESSION_BUS_ENV.
* init/man/init.8: Update for --confdir and --session.
* init/main.c:
- Addition of --session and --confdir command-line option (required for
test framework to test changes to initctl).
- handle_confdir(): New function to select alternate confdir using env
var "UPSTART_CONFDIR" (for testing).
* init/paths.h:
- Renamed CONDIR to DEFAULT_CONFDIR to make its use clearer now it can be changed.
- Renamed CONFILE to DEFAULT_CONFFILE for parity with DEFAULT_CONFDIR.
- Added define for CONFDIR_ENV.
* util/initctl.c:
- Addition of --session command-line option (required for test framework to test
visualisation changes to initctl).
- Changed 'system_bus' variable to 'use_dbus' since now we can use either D-Bus bus type.
- Added 'dbus_bus_type' which encodes D-Bus bus type to use.
- Added 'verbose_detail' and 'enumerate_events' variables to
- Created new functions:
- job_class_condition_handler(): Handler function to retrieve job conditions.
- job_class_condition_err_handler(): Handler error function for
job_class_condition_handler().
- job_class_parse_events(): Convert RPN "start on" and "stop on" conditions to
human-readable format.
- job_class_show_emits(): Display events which job emits.
- job_class_show_conditions(): Make D-Bus calls to retrieve "start on" and
"stop on" conditions.
- dbus_bus_type_setter(): Used by option parser to distinguish system/session
D-Bus bus type.
- Updated upstart_open() to handle multiple D-Bus bus types.
- Changed following functions to error with message if initctl run as
non-root user (without this, you get a very cryptic D-Bus error):
- start_action()
- stop_action()
- restart_action()
- reload_configuration_action()
- log_priority_action()
- status_action() and list_action() modified to call:
- job_class_show_emits()
- job_class_show_conditions()
* util/initctl.h: New file providing stack-handling functionality for RPN parsing.
* util/initctl.8: Updated for --session, and --detail/-d and
--enumerate/-e options to status and list commands.
* util/tests/test_initctl.c:
- new macros START_UPSTART, STOP_UPSTART, RUN_COMMAND, CREATE_FILE and DELETE_FILE.
These are required since due to the changes in initctl.c, we
actually need to run the initctl binary directly (as that is where all
the emits/start on/stop on parsing occurs). The test stategy adopted is to run
(a second instance of! :-) Upstart as a non-privileged user
connected to the session bus and using an alternate config
directory. Then, by invoking initctl, again connecting to the session
bus, we test the parsing functionality directly.
- test_status_and_list_action_detail(): New function to test '-d' and
'-e' options for status and list commands.
- updated all remaining functions to use 'use_dbus' rather than 'system_bus'.