1 # The application framework
5 The daemon ***afm-system-daemon*** handle applications life.
6 Understand that they will manage operations that mainly are:
14 In addition, they ensure that operations use the security framework as needed
15 and that applications are executed in the correct context.
17 The daemon ***afm-system-daemon*** is accessible through AGL
18 micro-service architecture using either the binder ***afb-binder*** or
19 the client library ***libafbwsc***.
21 ## Starting **afm-system-daemon**
23 ***afm-system-daemon*** is launched by systemd services.
24 Normally, service files are located in the directory
25 */lib/systemd/system/afm-system-daemon.service*.
27 Internally, the daemon is built as a binding served by afb-daemon.
29 ## Tasks of **afm-system-daemon**
31 ### Maintaining list of applications
33 At start **afm-system-daemon** scans the directories containing
34 applications and load in memory a list of available applications
35 accessible by current user.
37 When **afm-system-daemon** installs or removes an application,
38 on success it sends the signal **.
39 When receiving such a signal, **afm-system-daemon** rebuilds its
42 **afm-system-daemon** provides the data it collects about
43 applications to its clients.
44 Clients may either request the full list
45 of available applications or a more specific information about a
48 ### Launching application
50 **afm-system-daemon** launches application by using systemd.
51 Systemd builds a secure environment for the application
54 Once launched, running instances of application receive
55 a runid that identify them. On previous versions, the *runid*
56 had a special meaning. The current version uses the linux *PID*
57 of the launched process as *runid*.
59 ### Managing instances of running applications
61 **afm-system-daemon** manages the list of applications
64 When owning the right permissions, a client can get the list
65 of running instances and details about a specific
67 It can also terminate a given application.
69 ### Installing and uninstalling applications
71 If the client own the right permissions,
72 **afm-system-daemon** delegates that task
73 to **afm-system-daemon**.
75 ## Using ***afm-util***
77 The command line tool ***afm-util*** is available in devel mode.
79 It uses afb-client-demo to send orders to **afm-system-daemon**.
80 This small scripts allows to send command to ***afm-system-daemon*** either
81 interactively at shell prompt or scriptically.
85 - it accept a command and when requires attached arguments.
87 Here is the summary of ***afm-util***:
89 - **afm-util runnables **:
90 list the runnable widgets installed
92 - **afm-util install wgt **:
95 - **afm-util uninstall id **:
96 remove the installed widget of id
98 - **afm-util detail id **:
99 print detail about the installed widget of id
101 - **afm-util runners **:
102 list the running instance
104 - **afm-util start id **:
105 start an instance of the widget of id
107 - **afm-util once id **:
108 run once an instance of the widget of id
110 - **afm-util terminate rid **:
111 terminate the running instance rid
113 - **afm-util state rid **:
114 get status of the running instance rid
116 Here is how to list applications using ***afm-util***:
122 [afm-daemons]: pictures/afm-daemons.svg