интерфейс D-Bus системы systemd (The D-Bus interface of systemd)
UNIT OBJECTS
node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
interface org.freedesktop.systemd1.Unit {
methods:
Start(in s mode,
out o job);
Stop(in s mode,
out o job);
Reload(in s mode,
out o job);
Restart(in s mode,
out o job);
TryRestart(in s mode,
out o job);
ReloadOrRestart(in s mode,
out o job);
ReloadOrTryRestart(in s mode,
out o job);
EnqueueJob(in s job_type,
in s job_mode,
out u job_id,
out o job_path,
out s unit_id,
out o unit_path,
out s job_type,
out a(uosos) affected_jobs);
Kill(in s whom,
in i signal);
ResetFailed();
SetProperties(in b runtime,
in a(sv) properties);
Ref();
Unref();
Clean(in as mask);
Freeze();
Thaw();
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Id = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as Names = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s Following = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as Requires = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as Requisite = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as Wants = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as BindsTo = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as PartOf = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as RequiredBy = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as RequisiteOf = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as WantedBy = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as BoundBy = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as ConsistsOf = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as Conflicts = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as ConflictedBy = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as Before = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as After = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as OnFailure = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as OnFailureOf = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as OnSuccess = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as OnSuccessOf = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as Triggers = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as TriggeredBy = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as PropagatesReloadTo = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as ReloadPropagatedFrom = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as PropagatesStopTo = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as StopPropagatedFrom = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as JoinsNamespaceOf = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as SliceOf = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as RequiresMountsFor = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as Documentation = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Description = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s LoadState = '...';
readonly s ActiveState = '...';
readonly s FreezerState = '...';
readonly s SubState = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s FragmentPath = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s SourcePath = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as DropInPaths = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s UnitFileState = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s UnitFilePreset = '...';
readonly t StateChangeTimestamp = ...;
readonly t StateChangeTimestampMonotonic = ...;
readonly t InactiveExitTimestamp = ...;
readonly t InactiveExitTimestampMonotonic = ...;
readonly t ActiveEnterTimestamp = ...;
readonly t ActiveEnterTimestampMonotonic = ...;
readonly t ActiveExitTimestamp = ...;
readonly t ActiveExitTimestampMonotonic = ...;
readonly t InactiveEnterTimestamp = ...;
readonly t InactiveEnterTimestampMonotonic = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b CanStart = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b CanStop = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b CanReload = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b CanIsolate = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as CanClean = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b CanFreeze = ...;
readonly (uo) Job = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b StopWhenUnneeded = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b RefuseManualStart = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b RefuseManualStop = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b AllowIsolate = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b DefaultDependencies = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s OnSuccessJobMode = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s OnFailureJobMode = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b IgnoreOnIsolate = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b NeedDaemonReload = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly as Markers = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t JobTimeoutUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t JobRunningTimeoutUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s JobTimeoutAction = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s JobTimeoutRebootArgument = '...';
readonly b ConditionResult = ...;
readonly b AssertResult = ...;
readonly t ConditionTimestamp = ...;
readonly t ConditionTimestampMonotonic = ...;
readonly t AssertTimestamp = ...;
readonly t AssertTimestampMonotonic = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("invalidates")
readonly a(sbbsi) Conditions = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("invalidates")
readonly a(sbbsi) Asserts = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly (ss) LoadError = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b Transient = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b Perpetual = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t StartLimitIntervalUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u StartLimitBurst = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s StartLimitAction = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s FailureAction = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly i FailureActionExitStatus = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s SuccessAction = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly i SuccessActionExitStatus = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s RebootArgument = '...';
readonly ay InvocationID = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s CollectMode = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly as Refs = ['...', ...];
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
Methods
Start()
, Stop()
, Reload()
, Restart()
, TryRestart()
,
ReloadOrRestart()
, ReloadOrTryRestart()
, Kill()
, ResetFailed()
,
and SetProperties()
implement the same operation as the
respective methods on the Manager object (see above). However,
these methods operate on the unit object and hence do not take a
unit name parameter. Invoking the methods directly on the Manager
object has the advantage of not requiring a GetUnit()
call to get
the unit object for a specific unit name. Calling the methods on
the Manager object is hence a round trip optimization.
Properties
Id contains the primary name of the unit.
Names contains all names of the unit, including the primary name
that is also exposed in Id.
Following either contains the empty string or contains the name
of another unit that this unit follows in state. This is used for
some device units which reflect the unit state machine of another
unit, and which other unit this is might possibly change.
Requires, RequiresOverridable, Requisite, RequisiteOverridable,
Wants, BindsTo, RequiredBy, RequiredByOverridable, WantedBy,
BoundBy, Conflicts, ConflictedBy, Before, After, OnFailure,
Triggers, TriggeredBy, PropagatesReloadTo, and RequiresMountsFor
contain arrays which encode the dependencies and their inverse
dependencies (where this applies) as configured in the unit file
or determined automatically.
Description contains the human readable description string for
the unit.
SourcePath contains the path to a configuration file this unit is
automatically generated from in case it is not a native unit (in
which case it contains the empty string). For example, all mount
units generated from /etc/fstab have this field set to
/etc/fstab.
Documentation contains a string array with URLs of documentation
for this unit.
LoadState contains a state value that reflects whether the
configuration file of this unit has been loaded. The following
states are currently defined: "loaded", "error", and "masked".
"loaded" indicates that the configuration was successfully
loaded. "error" indicates that the configuration failed to load.
The LoadError field (see below) contains information about the
cause of this failure. "masked" indicates that the unit is
currently masked out (i.e. symlinked to /dev/null or empty). Note
that the LoadState is fully orthogonal to the ActiveState (see
below) as units without valid loaded configuration might be
active (because configuration might have been reloaded at a time
where a unit was already active).
ActiveState contains a state value that reflects whether the unit
is currently active or not. The following states are currently
defined: "active", "reloading", "inactive", "failed",
"activating", and "deactivating". "active" indicates that unit
is active (obviously...). "reloading" indicates that the unit is
active and currently reloading its configuration. "inactive"
indicates that it is inactive and the previous run was successful
or no previous run has taken place yet. "failed" indicates that
it is inactive and the previous run was not successful (more
information about the reason for this is available on the unit
type specific interfaces, for example for services in the Result
property, see below). "activating" indicates that the unit has
previously been inactive but is currently in the process of
entering an active state. Conversely "deactivating" indicates
that the unit is currently in the process of deactivation.
SubState encodes states of the same state machine that
ActiveState covers, but knows more fine-grained states that are
unit-type-specific. Where ActiveState only covers six high-level
states, SubState covers possibly many more low-level
unit-type-specific states that are mapped to the six high-level
states. Note that multiple low-level states might map to the same
high-level state, but not vice versa. Not all high-level states
have low-level counterparts on all unit types. At this point the
low-level states are not documented here, and are more likely to
be extended later on than the common high-level states explained
above.
FragmentPath contains the unit file path this unit was read from,
if there is one (if not, it contains the empty string).
UnitFileState encodes the install state of the unit file of
FragmentPath. It currently knows the following states: "enabled",
"enabled-runtime", "linked", "linked-runtime", "masked",
"masked-runtime", "static", "disabled", and "invalid". "enabled"
indicates that a unit file is permanently enabled.
"enable-runtime" indicates the unit file is only temporarily
enabled and will no longer be enabled after a reboot (that means,
it is enabled via /run/ symlinks, rather than /etc/). "linked"
indicates that a unit is linked into /etc/ permanently.
"linked-runtime" indicates that a unit is linked into /run/
temporarily (until the next reboot). "masked" indicates that the
unit file is masked permanently. "masked-runtime" indicates that
it is masked in /run/ temporarily (until the next reboot).
"static" indicates that the unit is statically enabled, i.e.
always enabled and doesn't need to be enabled explicitly.
"invalid" indicates that it could not be determined whether the
unit file is enabled.
InactiveExitTimestamp, InactiveExitTimestampMonotonic,
ActiveEnterTimestamp, ActiveEnterTimestampMonotonic,
ActiveExitTimestamp, ActiveExitTimestampMonotonic,
InactiveEnterTimestamp, and InactiveEnterTimestampMonotonic
contain CLOCK_REALTIME
and CLOCK_MONOTONIC
64-bit microsecond
timestamps of the last time a unit left the inactive state,
entered the active state, exited the active state, or entered an
inactive state. These are the points in time where the unit
transitioned "inactive"/"failed" → "activating", "activating" →
"active", "active" → "deactivating", and finally "deactivating" →
"inactive"/"failed". The fields are 0 in case such a transition
has not yet been recorded on this boot.
CanStart, CanStop, and CanReload encode as booleans whether the
unit supports the start, stop or reload operations. Even if a
unit supports such an operation, the client might not necessary
have the necessary privileges to execute them.
CanIsolate encodes as a boolean whether the unit may be started
in isolation mode.
Job encodes the job ID and job object path of the job currently
scheduled or executed for this unit, if there is any. If no job
is scheduled or executed, the job id field will be 0.
StopWhenUnneeded, RefuseManualStart, RefuseManualStop,
AllowIsolate, DefaultDependencies, OnFailureIsolate,
IgnoreOnIsolate, IgnoreOnSnapshot map directly to the
corresponding configuration booleans in the unit file.
DefaultControlGroup contains the main control group of this unit
as a string. This refers to a group in systemd's own
"name=systemd" hierarchy, which systemd uses to watch and
manipulate the unit and all its processes.
NeedDaemonReload is a boolean that indicates whether the
configuration file this unit is loaded from (i.e. FragmentPath
or SourcePath) has changed since the configuration was read and
hence whether a configuration reload is recommended.
Markers is an array of string flags that can be set using
SetUnitProperties()
to indicate that the service should be
reloaded or restarted. Currently known values are "needs-restart"
and "needs-reload". Package scripts may use the first to mark
units for later restart when a new version of the package is
installed. Configuration management scripts may use the second to
mark units for a later reload when the configuration is adjusted.
Those flags are not set by the manager, except to unset as
appropriate when when the unit is stopped, restarted, or
reloaded.
JobTimeoutUSec maps directly to the corresponding configuration
setting in the unit file.
ConditionTimestamp and ConditionTimestampMonotonic contain the
CLOCK_REALTIME
/CLOCK_MONOTONIC
microsecond timestamps of the last
time the configured conditions of the unit have been checked or 0
if they have never been checked. Conditions are checked when a
unit is requested to start.
ConditionResult contains the condition result of the last time
the configured conditions of this unit were checked.
Conditions contains all configured conditions of the unit. For
each condition, five fields are given: condition type (e.g.
ConditionPathExists), whether the condition is a trigger
condition, whether the condition is reversed, the right hand side
of the condition (e.g. the path in case of ConditionPathExists),
and the status. The status can be 0, in which case the condition
hasn't been checked yet, a positive value, in which case the
condition passed, or a negative value, in which case the
condition failed. Currently only 0, +1, and -1 are used, but
additional values may be used in the future, retaining the
meaning of zero/positive/negative values.
LoadError contains a pair of strings. If the unit failed to load
(as encoded in LoadState, see above), then this will include a
D-Bus error pair consisting of the error ID and an explanatory
human readable string of what happened. If it loaded
successfully, this will be a pair of empty strings.
Transient contains a boolean that indicates whether the unit was
created as a transient unit (i.e. via CreateTransientUnit()
on
the manager object).
Security
Similarly to methods on the Manager object, read-only access is
allowed for everyone. All operations are allowed for clients with
the CAP_SYS_ADMIN
capability or when the
org.freedesktop.systemd1.manage-units privilege is granted by
polkit.