Differences between revisions 5 and 6
Revision 5 as of 2009-07-14 10:11:28
Size: 13128
Editor: scott
Comment:
Revision 6 as of 2011-08-26 04:10:16
Size: 13128
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

  • <!>

    Until 1.0, the Upstart D-Bus Interface is considered unstable and subject to change, thus the use of versioned interface names.

    Compatible versions:
    init (upstart 0.6.0)

Connecting to Upstart

The init daemon is available on the system bus with the well-known name com.ubuntu.Upstart, this is the preferred method for applications to communicate with the daemon since the D-Bus security policy allows non-superusers to request read-only information.

Since the D-Bus system bus daemon may not always be available, the initctl, telinit and shutdown utilities included with Upstart use an alternate method. It is not recommended that most software use this, however there may be situations in which it is useful. A private D-Bus connection to the address unix:abstract=/com/ubuntu/upstart may be made, no well-known name is required. The same objects as published on the system bus are available from this connection, however access is for superusers only.

Manager object

Path:

/com/ubuntu/Upstart

Since:

init (upstart 0.6.0)

The manager object is the primary communication point for the init daemon. One of the primary uses for the manager object is to look up jobs by name, or enumerate all of the jobs. The secondary use is the emission of events.

Methods

com.ubuntu.Upstart0_6.GetJobByName

Since:

init (upstart 0.6.0)

Access:

default context

com.ubuntu.Upstart0_6.GetJobByName (in String name,
                                    out ObjectPath job)

Looks up a job by name, returning the path of the job object. The job object represents the on disk configuration of a job, not a running instance, however the running instances are obtained from the job objects. See Job objects below.

While it's technically possible to extrapolate the path of a job object from its name, you should not do this as the encoding is always subject to change. Always use this method instead.

Errors

com.ubuntu.Upstart0_6.Error.UnknownJob: the job name given was not known.

com.ubuntu.Upstart0_6.GetAllJobs

Since:

init (upstart 0.6.0)

Access:

default context

com.ubuntu.Upstart0_6.GetAllJobs (out <Array of ObjectPath> jobs)

Returns a list of all currently registered job objects. Job objects represent the on disk configuration of a job, not a running instance, however the running instances are obtained from the job objects. See Job objects below.

com.ubuntu.Upstart0_6.EmitEvent

Since:

init (upstart 0.6.0)

Access:

root

com.ubuntu.Upstart0_6.EmitEvent (in String name,
                                 in <Array of String> env,
                                 in Boolean wait)

Causes an event to be emitted, which may result in jobs automatically starting and stopping. The event name should be provided, along with an array of strings containing KEY=VALUE pairs denoting the accompanying environment for the event. These environment variables will be exported into any jobs started or stopped by the event.

When wait is TRUE, this method call will not return until all side-effects of the event (services finishing starting, tasks finishing running, jobs stopping) have completed. When wait is FALSE, the method call will return once Upstart has queued the event.

Signals

com.ubuntu.Upstart0_6.JobAdded

Since:

init (upstart 0.6.0)

com.ubuntu.Upstart0_6.JobAdded (ObjectPath job)

This signal is emitted when a new job object is registered. The job object represents the on disk configuration of a job, not a running instance, however the running instances are obtained from the job objects. See Job objects below.

You tend to see this signal when a configuration file is created or changed.

com.ubuntu.Upstart0_6.JobRemoved

Since:

init (upstart 0.6.0)

com.ubuntu.Upstart0_6.JobRemoved (ObjectPath job)

This signal is emitted when a job object is unregistered. The job object represents the on disk configuration of a job, not a running instance, however the running instances are obtained from the job objects. See Job objects below.

You tend to see this signal when a configuration file is changed or deleted.

Properties

com.ubuntu.Upstart0_6.version

Since:

init (upstart 0.6.0)

Read Access:

default context

READ String com.ubuntu.Upstart0_6.version

This property contains the version of the init daemon as a string. Since the D-Bus interface is unstable, you should retrieve the value of this property before communicating.

com.ubuntu.Upstart0_6.log_priority

Since:

init (upstart 0.6.0)

Read Access:

default context

Write Access:

root

READWRITE String com.ubuntu.Upstart0_6.log_priority

This property may be used to change the priority of log messages that Upstart will output to the system log, it may also be used to obtain the current setting. Valid values are fatal, error, warn, message, info and debug.

Job objects

Since:

init (upstart 0.6.0)

Job objects represent the configuration of a job, not the running instances, however the running instances are obtained from the job objects.

Methods

com.ubuntu.Upstart0_6.Job.GetInstance

Since:

init (upstart 0.6.0)

Access:

default context

com.ubuntu.Upstart0_6.Job.GetInstance (in <Array of String> env
                                       out ObjectPath instance)

Looks up an instance by the environment with which it was started, returning the path of the instance object. The instance object represents a running instance of a job. See Instance objects below.

This is possible because Upstart generates the name of an instance from the environment; this is actually the preferred method of looking up instances.

com.ubuntu.Upstart0_6.Job.GetInstanceByName

Since:

init (upstart 0.6.0)

Access:

default context

com.ubuntu.Upstart0_6.Job.GetInstanceByName (in String name,
                                             out ObjectPath instance)

Looks up an instance by name, returning the path of the instance object. The instance object represents a running instance of a job. See Instance objects below.

While it's technically possible to extrapolate the path of a instance object from its name, you should not do this as the encoding is always subject to change. Always use this method instead.

Errors

com.ubuntu.Upstart0_6.Error.UnknownInstance: the instance name given was not known.

com.ubuntu.Upstart0_6.Job.GetAllInstances

Since:

init (upstart 0.6.0)

Access:

default context

com.ubuntu.Upstart0_6.Job.GetAllInstances (out <Array of ObjectPath> instances)

Returns a list of all currently registered job objects. Instance object represent running instances of a job. See Instance objects below.

com.ubuntu.Upstart0_6.Job.Start

Since:

init (upstart 0.6.0)

Access:

root

com.ubuntu.Upstart0_6.Job.Start (in <Array of String> env,
                                 in Boolean wait,
                                 out ObjectPath instance)

Starts a new instance of the job, or restarts an existing stopping instance of the job, based on the env argument which should be an array of strings containing KEY=VALUE pairs denoting the accompanying environment for the job.

When wait is TRUE, this method call will not return until the job has finished (services finishing starting, tasks finishing running). When wait is FALSE, the method call will return once Upstart has queued the command.

The object path of the instance object is returned.

com.ubuntu.Upstart0_6.Job.Stop

Since:

init (upstart 0.6.0)

Access:

root

com.ubuntu.Upstart0_6.Job.Stop (in <Array of String> env,
                                in Boolean wait)

Stops an existing instance of the job based on the env argument which should be an array of strings containing KEY=VALUE pairs denoting the accompanying environment for the job.

When wait is TRUE, this method call will not return until the job has been stopped. When wait is FALSE, the method call will return once Upstart has queued the command.

com.ubuntu.Upstart0_6.Job.Restart

Since:

init (upstart 0.6.0)

Access:

root

com.ubuntu.Upstart0_6.Job.Restart (in <Array of String> env,
                                   in Boolean wait,
                                   out ObjectPath instance)

Restarts an existing instance of the job based on the env argument which should be an array of strings containing KEY=VALUE pairs denoting the accompanying environment for the job.

When wait is TRUE, this method call will not return until the job has been restarted. When wait is FALSE, the method call will return once Upstart has queued the command.

This will not cause a new instance to start, it only restarts an existing instance.

Signals

com.ubuntu.Upstart0_6.Job.InstanceAdded

Since:

init (upstart 0.6.0)

com.ubuntu.Upstart0_6.Job.InstanceAdded (ObjectPath instance)

This signal is emitted when a new job instance is created. The instance object represents a running instance of a job. See Instance objects below.

You tend to see this signal when a job is started for the first time.

com.ubuntu.Upstart0_6.Job.InstanceRemoved

Since:

init (upstart 0.6.0)

com.ubuntu.Upstart0_6.Job.InstanceRemoved (ObjectPath instance)

This signal is emitted when a job instance is destroyed. The instance object represents a running instance of a job. See Instance objects below.

You tend to see this signal when a job is stopped.

Properties

com.ubuntu.Upstart0_6.Job.name

Since:

init (upstart 0.6.0)

Read Access:

default context

READ String com.ubuntu.Upstart0_6.Job.name

com.ubuntu.Upstart0_6.Job.description

Since:

init (upstart 0.6.0)

Read Access:

default context

READ String com.ubuntu.Upstart0_6.Job.description

com.ubuntu.Upstart0_6.Job.author

Since:

init (upstart 0.6.0)

Read Access:

default context

READ String com.ubuntu.Upstart0_6.Job.author

com.ubuntu.Upstart0_6.Job.version

Since:

init (upstart 0.6.0)

Read Access:

default context

READ String com.ubuntu.Upstart0_6.Job.version

Instance objects

Since:

init (upstart 0.6.0)

Instance objects represent the running instances of a job; beware that if there are no running instances, there will be no instance objects.

Methods

com.ubuntu.Upstart0_6.Instance.Start

Since:

init (upstart 0.6.0)

Access:

root

com.ubuntu.Upstart0_6.Instance.Start (in Boolean wait)

com.ubuntu.Upstart0_6.Instance.Stop

Since:

init (upstart 0.6.0)

Access:

root

com.ubuntu.Upstart0_6.Instance.Stop (in Boolean wait)

com.ubuntu.Upstart0_6.Instance.Restart

Since:

init (upstart 0.6.0)

Access:

root

com.ubuntu.Upstart0_6.Instance.Restart (in Boolean wait)

Signals

Properties

com.ubuntu.Upstart0_6.Instance.name

Since:

init (upstart 0.6.0)

Read Access:

default context

READ String com.ubuntu.Upstart0_6.Instance.name

com.ubuntu.Upstart0_6.Instance.goal

Since:

init (upstart 0.6.0)

Read Access:

default context

READ String com.ubuntu.Upstart0_6.Instance.goal

com.ubuntu.Upstart0_6.Instance.state

Since:

init (upstart 0.6.0)

Read Access:

default context

READ String com.ubuntu.Upstart0_6.Instance.state

com.ubuntu.Upstart0_6.Instance.processes

Since:

init (upstart 0.6.0)

Read Access:

default context

READ <Array of Struct<String Int32>> com.ubuntu.Upstart0_6.Instance.processes

-- CategoryDoc

DBusInterface (last edited 2011-08-26 04:10:16 by localhost)