8 This document describes application framework system daemon fundamentals.
9 FCF (Fully Conform to Specification) implementation is still under development.
10 It may happen that current implementation somehow diverges with specifications.
16 The daemon **afm-system-daemon** is in charge of installing
17 applications on AGL system. Its main tasks are:
19 - installs applications and setup security framework
20 for newly installed application.
22 - uninstall applications
24 The **afm-system-daemon** takes its orders from system
27 The figure below summarizes the situation of **afm-system-daemon** in the system.
29 +------------------------------------------------------------+
32 | +-------------------------------------------------+ |
34 | | afm-user-daemon | |
36 | +----------+----------------------+----------+----+ |
39 :================|======================|==========:=========:
41 | +----------+----------+ +-----+-----+ : |
42 | | D-Bus system +-----+ CYNARA | : |
43 | +----------+----------+ +-----+-----+ : |
45 | +----------+---------+ +-------+----------+----+ |
46 | | afm-system-daemon +----+ SECURITY-MANAGER | |
47 | +--------------------+ +-----------------------+ |
50 +------------------------------------------------------------+
53 Starting **afm-system-daemon**
54 ------------------------------
56 **afm-system-daemon** is launched as a **systemd** service
57 attached to system. Normally, the service file is
58 located at /lib/systemd/system/afm-system-daemon.service.
60 The options for launching **afm-system-daemon** are:
65 Set the root application directory.
67 Note that the default root directory is defined
68 to be /usr/share/afm/applications (may change).
73 Daemonizes the process. It is not needed by sytemd.
78 Reduces the verbosity (can be repeated).
83 Increases the verbosity (can be repeated).
93 ### Overview of the dbus interface
95 ***afm-system-daemon*** takes its orders from the session instance
96 of D-Bus. The use of D-Bus is great because it allows to implement
97 discovery and signaling.
99 The **afm-system-daemon** is listening with the destination name
100 ***org.AGL.afm.system*** at the object of path ***/org/AGL/afm/system***
101 on the interface ***org.AGL.afm.system*** for the below detailed
102 members ***install*** and ***uninstall***.
104 D-Bus is mainly used for signaling and discovery. Its optimized
105 typed protocol is not used except for transmitting only one string
108 The client and the service are using JSON serialization to
111 The D-Bus interface is defined by:
113 * DESTINATION: **org.AGL.afm.system**
115 * PATH: **/org/AGL/afm/system**
117 * INTERFACE: **org.AGL.afm.system**
119 The signature of any member of the interface is ***string -> string***
120 for ***JSON -> JSON***.
122 This is the normal case. In case of error, the current implementation
123 returns a dbus error that is a string.
125 Here is an example using *dbus-send* to query data on
126 installed applications.
128 dbus-send --session --print-reply \
129 --dest=org.AGL.afm.system \
130 /org/AGL/afm/system \
131 org.AGL.afm.system.install 'string:"/tmp/appli.wgt"'
133 ### The protocol over D-Bus
137 #### Method org.AGL.afm.system.install
139 **Description**: Install an application from a widget file.
141 When an application with the same *id* and *version* already exists. Outside of
142 using *force=true* the application is not reinstalled.
144 Applications are installed the subdirectories of applications common directory.
145 If *root* is specified, the application is installed under the
146 sub-directories of the *root* defined.
148 Note that this methods is a simple accessor method of
149 ***org.AGL.afm.system.install*** from ***afm-system-daemon***.
151 After the installation and before returning to the sender,
152 ***afm-system-daemon*** sends a signal ***org.AGL.afm.system.changed***.
154 **Input**: The *path* of the widget file to install and, optionally,
155 a flag to *force* reinstallation, and, optionally, a *root* directory.
157 Either just a string being the absolute path of the widget file:
159 "/a/path/driving/to/the/widget"
164 "wgt": "/a/path/to/the/widget",
166 "root": "/a/path/to/the/root"
169 "wgt" and "root" must be absolute paths.
171 **output**: An object with the field "added" being the string for
172 the id of the added application.
174 {"added":"appli@x.y"}
178 #### Method org.AGL.afm.system.uninstall
180 **Description**: Uninstall an application from its id.
183 Note that this methods is a simple method accessor of
184 ***org.AGL.afm.system.uninstall*** from ***afm-system-daemon***.
186 After the uninstallation and before returning to the sender,
187 ***afm-system-daemon*** sends a signal ***org.AGL.afm.system.changed***.
189 **Input**: the *id* of the application and optionally the application *root* path.
199 "root": "/a/path/to/the/root"
202 **output**: the value 'true'.
204 [meta-intel]: https://github.com/01org/meta-intel-iot-security "A collection of layers providing security technologies"
205 [widgets]: http://www.w3.org/TR/widgets "Packaged Web Apps"
206 [widgets-digsig]: http://www.w3.org/TR/widgets-digsig "XML Digital Signatures for Widgets"
207 [libxml2]: http://xmlsoft.org/html/index.html "libxml2"
208 [openssl]: https://www.openssl.org "OpenSSL"
209 [xmlsec]: https://www.aleksey.com/xmlsec "XMLSec"
210 [json-c]: https://github.com/json-c/json-c "JSON-c"
211 [d-bus]: http://www.freedesktop.org/wiki/Software/dbus "D-Bus"
212 [libzip]: http://www.nih.at/libzip "libzip"
213 [cmake]: https://cmake.org "CMake"
214 [security-manager]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Security_Manager "Security-Manager"
215 [app-manifest]: http://www.w3.org/TR/appmanifest "Web App Manifest"
216 [tizen-security]: https://wiki.tizen.org/wiki/Security "Tizen security home page"
217 [tizen-secu-3]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Overview "Tizen 3 security overview"