15 This document describes application framework system daemon fundamentals.
16 FCF (Fully Conform to Specification) implementation is still under development.
17 It may happen that current implementation somehow diverges with specifications.
23 The daemon **afm-system-daemon** is in charge of installing
24 applications on AGL system. Its main tasks are:
26 - installs applications and setup security framework
27 for newly installed application.
29 - uninstall applications
31 The **afm-system-daemon** takes its orders from system
34 The figure below summarizes the situation of **afm-system-daemon** in the system.
36 +------------------------------------------------------------+
39 | +-------------------------------------------------+ |
41 | | afm-user-daemon | |
43 | +----------+----------------------+----------+----+ |
46 :================|======================|==========:=========:
48 | +----------+----------+ +-----+-----+ : |
49 | | D-Bus system +-----+ CYNARA | : |
50 | +----------+----------+ +-----+-----+ : |
52 | +----------+---------+ +-------+----------+----+ |
53 | | afm-system-daemon +----+ SECURITY-MANAGER | |
54 | +--------------------+ +-----------------------+ |
57 +------------------------------------------------------------+
60 Starting **afm-system-daemon**
61 ------------------------------
63 **afm-system-daemon** is launched as a **systemd** service
64 attached to system. Normally, the service file is
65 located at /lib/systemd/system/afm-system-daemon.service.
67 The options for launching **afm-system-daemon** are:
72 Set the root application directory.
74 Note that the default root directory is defined
75 to be /usr/share/afm/applications (may change).
80 Daemonizes the process. It is not needed by sytemd.
85 Reduces the verbosity (can be repeated).
90 Increases the verbosity (can be repeated).
100 ### Overview of the dbus interface
102 ***afm-system-daemon*** takes its orders from the session instance
103 of D-Bus. The use of D-Bus is great because it allows to implement
104 discovery and signaling.
106 The **afm-system-daemon** is listening with the destination name
107 ***org.AGL.afm.system*** at the object of path ***/org/AGL/afm/system***
108 on the interface ***org.AGL.afm.system*** for the below detailed
109 members ***install*** and ***uninstall***.
111 D-Bus is mainly used for signaling and discovery. Its optimized
112 typed protocol is not used except for transmitting only one string
115 The client and the service are using JSON serialization to
118 The D-Bus interface is defined by:
120 * DESTINATION: **org.AGL.afm.system**
122 * PATH: **/org/AGL/afm/system**
124 * INTERFACE: **org.AGL.afm.system**
126 The signature of any member of the interface is ***string -> string***
127 for ***JSON -> JSON***.
129 This is the normal case. In case of error, the current implementation
130 returns a dbus error that is a string.
132 Here is an example using *dbus-send* to query data on
133 installed applications.
135 dbus-send --session --print-reply \
136 --dest=org.AGL.afm.system \
137 /org/AGL/afm/system \
138 org.AGL.afm.system.install 'string:"/tmp/appli.wgt"'
140 ### The protocol over D-Bus
144 #### Method org.AGL.afm.system.install
146 **Description**: Install an application from a widget file.
148 When an application with the same *id* and *version* already exists. Outside of
149 using *force=true* the application is not reinstalled.
151 Applications are installed the subdirectories of applications common directory.
152 If *root* is specified, the application is installed under the
153 sub-directories of the *root* defined.
155 Note that this methods is a simple accessor method of
156 ***org.AGL.afm.system.install*** from ***afm-system-daemon***.
158 After the installation and before returning to the sender,
159 ***afm-system-daemon*** sends a signal ***org.AGL.afm.system.changed***.
161 **Input**: The *path* of the widget file to install and, optionally,
162 a flag to *force* reinstallation, and, optionally, a *root* directory.
164 Either just a string being the absolute path of the widget file:
166 "/a/path/driving/to/the/widget"
171 "wgt": "/a/path/to/the/widget",
173 "root": "/a/path/to/the/root"
176 "wgt" and "root" must be absolute paths.
178 **output**: An object with the field "added" being the string for
179 the id of the added application.
181 {"added":"appli@x.y"}
185 #### Method org.AGL.afm.system.uninstall
187 **Description**: Uninstall an application from its id.
190 Note that this methods is a simple method accessor of
191 ***org.AGL.afm.system.uninstall*** from ***afm-system-daemon***.
193 After the uninstallation and before returning to the sender,
194 ***afm-system-daemon*** sends a signal ***org.AGL.afm.system.changed***.
196 **Input**: the *id* of the application and optionally the application *root* path.
206 "root": "/a/path/to/the/root"
209 **output**: the value 'true'.
211 [meta-intel]: https://github.com/01org/meta-intel-iot-security "A collection of layers providing security technologies"
212 [widgets]: http://www.w3.org/TR/widgets "Packaged Web Apps"
213 [widgets-digsig]: http://www.w3.org/TR/widgets-digsig "XML Digital Signatures for Widgets"
214 [libxml2]: http://xmlsoft.org/html/index.html "libxml2"
215 [openssl]: https://www.openssl.org "OpenSSL"
216 [xmlsec]: https://www.aleksey.com/xmlsec "XMLSec"
217 [json-c]: https://github.com/json-c/json-c "JSON-c"
218 [d-bus]: http://www.freedesktop.org/wiki/Software/dbus "D-Bus"
219 [libzip]: http://www.nih.at/libzip "libzip"
220 [cmake]: https://cmake.org "CMake"
221 [security-manager]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Security_Manager "Security-Manager"
222 [app-manifest]: http://www.w3.org/TR/appmanifest "Web App Manifest"
223 [tizen-security]: https://wiki.tizen.org/wiki/Security "Tizen security home page"
224 [tizen-secu-3]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Overview "Tizen 3 security overview"