3 <link rel="stylesheet" type="text/css" href="doc.css">
7 <a name="The.afm-system-daemon"></a>
8 <h1>The afm-system-daemon</h1>
16 <li><a href="#The.afm-system-daemon">The afm-system-daemon</a>
18 <li><a href="#Foreword">Foreword</a></li>
19 <li><a href="#Introduction">Introduction</a></li>
20 <li><a href="#Starting..strong.afm-system-daemon..strong.">Starting <strong>afm-system-daemon</strong></a></li>
21 <li><a href="#The.D-Bus.interface">The D-Bus interface</a>
23 <li><a href="#Overview.of.the.dbus.interface">Overview of the dbus interface</a></li>
24 <li><a href="#The.protocol.over.D-Bus">The protocol over D-Bus</a>
26 <li><a href="#Method.org.AGL.afm.system.install">Method org.AGL.afm.system.install</a></li>
27 <li><a href="#Method.org.AGL.afm.system.uninstall">Method org.AGL.afm.system.uninstall</a></li>
36 <a name="Foreword"></a>
39 <p>This document describes what we intend to do. It may happen that our
40 current implementation and the content of this document differ.</p>
42 <p>In case of differences, it is assumed that this document is right
43 and the implementation is wrong.</p>
45 <a name="Introduction"></a>
48 <p>The daemon <strong>afm-system-daemon</strong> is in charge of installing
49 applications on the system. Its main tasks are:</p>
52 <li><p>installs the applications and setup the security framework
53 to include it</p></li>
54 <li><p>uninstall the applications</p></li>
58 <p>The <strong>afm-system-daemon</strong> takes its orders from the system
59 instance of D-Bus.</p>
61 <p>The figure below summarizes the situation of the
62 <strong>afm-system-daemon</strong> in the system.</p>
64 <pre><code>+------------------------------------------------------------+
67 | +-------------------------------------------------+ |
69 | | afm-user-daemon | |
71 | +----------+----------------------+----------+----+ |
74 :================|======================|==========:=========:
76 | +----------+----------+ +-----+-----+ : |
77 | | D-Bus system +-----+ CYNARA | : |
78 | +----------+----------+ +-----+-----+ : |
80 | +----------+---------+ +-------+----------+----+ |
81 | | afm-system-daemon +----+ SECURITY-MANAGER | |
82 | +--------------------+ +-----------------------+ |
85 +------------------------------------------------------------+
88 <a name="Starting..strong.afm-system-daemon..strong."></a>
89 <h2>Starting <strong>afm-system-daemon</strong></h2>
91 <p><strong>afm-system-daemon</strong> is launched as a <strong>systemd</strong> service
92 attached to system. Normally, the service file is
93 located at /lib/systemd/system/afm-system-daemon.service.</p>
95 <p>The options for launching <strong>afm-system-daemon</strong> are:</p>
100 Set the root application directory.
102 Note that the default root directory is defined
103 to be /usr/share/afm/applications (may change).
108 Daemonizes the process. It is not needed by sytemd.
113 Reduces the verbosity (can be repeated).
118 Increases the verbosity (can be repeated).
126 <a name="The.D-Bus.interface"></a>
127 <h2>The D-Bus interface</h2>
129 <a name="Overview.of.the.dbus.interface"></a>
130 <h3>Overview of the dbus interface</h3>
132 <p><strong><em>afm-system-daemon</em></strong> takes its orders from the session instance
133 of D-Bus. The use of D-Bus is great because it allows to implement
134 discovery and signaling.</p>
136 <p>The <strong>afm-system-daemon</strong> is listening with the destination name
137 <strong><em>org.AGL.afm.system</em></strong> at the object of path <strong><em>/org/AGL/afm/system</em></strong>
138 on the interface <strong><em>org.AGL.afm.system</em></strong> for the below detailed
139 members <strong><em>install</em></strong> and <strong><em>uninstall</em></strong>.</p>
141 <p>D-Bus is mainly used for signaling and discovery. Its optimized
142 typed protocol is not used except for transmitting only one string
143 in both directions.</p>
145 <p>The client and the service are using JSON serialisation to
148 <p>The D-Bus interface is defined by:</p>
151 <li><p>DESTINATION: <strong>org.AGL.afm.system</strong></p></li>
152 <li><p>PATH: <strong>/org/AGL/afm/system</strong></p></li>
153 <li><p>INTERFACE: <strong>org.AGL.afm.system</strong></p></li>
157 <p>The signature of any member of the interface is <strong><em>string -> string</em></strong>
158 for <strong><em>JSON -> JSON</em></strong>.</p>
160 <p>This is the normal case. In case of error, the current implmentation
161 returns a dbus error that is a string.</p>
163 <p>Here is an example that use <em>dbus-send</em> to query data on
164 installed applications.</p>
166 <pre><code>dbus-send --session --print-reply \
167 --dest=org.AGL.afm.system \
168 /org/AGL/afm/system \
169 org.AGL.afm.system.install 'string:"/tmp/appli.wgt"'
172 <a name="The.protocol.over.D-Bus"></a>
173 <h3>The protocol over D-Bus</h3>
177 <a name="Method.org.AGL.afm.system.install"></a>
178 <h4>Method org.AGL.afm.system.install</h4>
180 <p><strong>Description</strong>: Install an application from its widget file.</p>
182 <p>If an application of the same <em>id</em> and <em>version</em> exists, it is not
183 reinstalled except if <em>force=true</em>.</p>
185 <p>Applications are installed in the subdirectories of the common directory
187 If <em>root</em> is specified, the application is installed under the
188 sub-directories of the <em>root</em> defined.</p>
190 <p>Note that this methods is a simple accessor to the method
191 <strong><em>org.AGL.afm.system.install</em></strong> of <strong><em>afm-system-daemon</em></strong>.</p>
193 <p>After the installation and before returning to the sender,
194 <strong><em>afm-system-daemon</em></strong> sends the signal <strong><em>org.AGL.afm.system.changed</em></strong>.</p>
196 <p><strong>Input</strong>: The <em>path</em> of the widget file to install and, optionaly,
197 a flag to <em>force</em> reinstallation, and, optionaly, a <em>root</em> directory.</p>
199 <p>Either just a string being the absolute path of the widget file:</p>
201 <pre><code>"/a/path/driving/to/the/widget"
207 "wgt": "/a/path/to/the/widget",
209 "root": "/a/path/to/the/root"
213 <p>“wgt” and “root” must be absolute paths.</p>
215 <p><strong>output</strong>: An object with the field “added” being the string for
216 the id of the added application.</p>
218 <pre><code>{"added":"appli@x.y"}
223 <a name="Method.org.AGL.afm.system.uninstall"></a>
224 <h4>Method org.AGL.afm.system.uninstall</h4>
226 <p><strong>Description</strong>: Uninstall an application from its id.</p>
228 <p>Note that this methods is a simple accessor to the method
229 <strong><em>org.AGL.afm.system.uninstall</em></strong> of <strong><em>afm-system-daemon</em></strong>.</p>
231 <p>After the uninstallation and before returning to the sender,
232 <strong><em>afm-system-daemon</em></strong> sends the signal <strong><em>org.AGL.afm.system.changed</em></strong>.</p>
234 <p><strong>Input</strong>: the <em>id</em> of the application and, otpionaly, the path to
235 <em>root</em> of the application.</p>
237 <p>Either a string:</p>
239 <pre><code>"appli@x.y"
246 "root": "/a/path/to/the/root"
250 <p><strong>output</strong>: the value ‘true’.</p>