platform/core/system/faultd.git
7 years agofix sandbox/mbloch/list_impl
Michal Bloch [Tue, 19 Sep 2017 12:34:43 +0000 (14:34 +0200)]
fix

Change-Id: I5a4fa877990f921b9a8fa333951d0ae44018c2df
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agobla
Michal Bloch [Tue, 19 Sep 2017 12:23:09 +0000 (14:23 +0200)]
bla

Change-Id: Idb53946d8965faf0f40b270e9c6bf0062c783e82
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoRemove list implementation
Krzysztof Opasiak [Tue, 19 Sep 2017 11:12:58 +0000 (13:12 +0200)]
Remove list implementation

Change-Id: I4ce8758d408537c1c4983ce50fb6905d70c91284
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoAdd log message about performed action 11/149111/4 accepted/tizen/unified/20170922.065535 submit/tizen/20170919.135738 submit/tizen/20170921.100652
Konrad Kuchciak [Mon, 11 Sep 2017 12:16:47 +0000 (14:16 +0200)]
Add log message about performed action

Change-Id: Ib09bdefcf34590d2fc0e30c63ed9bddc5b302874
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoAdd possibility to log to /dev/kmsg 40/149940/4
Konrad Kuchciak [Wed, 13 Sep 2017 14:00:24 +0000 (16:00 +0200)]
Add possibility to log to /dev/kmsg

Change-Id: I531f80e6506f1379b3542abc57801c453daad500
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoFix faultd cleanup on exit 10/149110/6
Konrad Kuchciak [Mon, 11 Sep 2017 12:08:49 +0000 (14:08 +0200)]
Fix faultd cleanup on exit

Cleanup on exit was performed only when SIGINT received, however during
system reboot systemd is sending SIGTERM to all remaining processes and
faultd was not exitting properly.

Change-Id: I9ab9517ef52790e6c75d10bcf21d4f2fcec87beb
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoAllow events to be handled by more than one handler 66/148366/8
Konrad Kuchciak [Wed, 6 Sep 2017 14:51:48 +0000 (16:51 +0200)]
Allow events to be handled by more than one handler

Change-Id: Ie069de32e88bdee7eeacfc19e68bc627b12bfb89
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoRemove semicolon from a macro 39/149939/2
Konrad Kuchciak [Wed, 13 Sep 2017 15:17:48 +0000 (17:17 +0200)]
Remove semicolon from a macro

If macro that ends with semicolon is used inside if else statement,
the else part is ignored and gcc gives an error.

Example:
if (condition)
INIT_QUEUE_HEAD(head);
else

is interpreted as:

if (condition)
                INIT_LIST_HEAD(head);;
        else

Change-Id: I1d1a4e3fdd9115e135c673fe9b771aff607959b2
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoFix recovering failed services 65/148365/1
Konrad Kuchciak [Thu, 7 Sep 2017 14:24:04 +0000 (16:24 +0200)]
Fix recovering failed services

Change-Id: I57d3a35ef8771a6df778762c2385448f86daf0fb
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoFix missing goto finish 15/148015/1
Konrad Kuchciak [Wed, 6 Sep 2017 09:18:03 +0000 (11:18 +0200)]
Fix missing goto finish

Change-Id: I8b4230f251fcf7e0a86a7f4006eb299626a23d5c

7 years agoFix codding style 89/147789/6
Konrad Kuchciak [Tue, 5 Sep 2017 13:54:26 +0000 (15:54 +0200)]
Fix codding style

Change-Id: I9f4c1f7a3a6da62ba4836abf1b8b2c3a8b899e88
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoAdd unit tests for deserialization 27/141427/25
Konrad Kuchciak [Mon, 21 Aug 2017 13:32:46 +0000 (15:32 +0200)]
Add unit tests for deserialization

Change-Id: I896e59f2ce6c140995e4aad1b8010a96f413d8ac
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoFill event's oid when retrieving event from database 90/147790/3
Konrad Kuchciak [Tue, 5 Sep 2017 15:12:03 +0000 (17:12 +0200)]
Fill event's oid when retrieving event from database

Change-Id: I3e6810e69979b81abdbe70175c900a0bea04c874
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoAdd missing deserialization functions 05/147705/7
Konrad Kuchciak [Mon, 4 Sep 2017 14:29:00 +0000 (16:29 +0200)]
Add missing deserialization functions

Change-Id: I8e418657bd8631317ffe96dfe422a51c78e8c39b
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotests: Add missing serialization tests 42/147242/5
Konrad Kuchciak [Fri, 1 Sep 2017 13:38:31 +0000 (15:38 +0200)]
tests: Add missing serialization tests

Added tests for:
* action_executed_event
* faultd_started_event

Change-Id: I2c05bfe580e1ba7355268d0b8c12c49b55f0f1ec

7 years agoStore in database event's oid instead of boot id 15/145515/14
Konrad Kuchciak [Fri, 25 Aug 2017 09:45:45 +0000 (11:45 +0200)]
Store in database event's oid instead of boot id

* database stores event oids so now it is possible to search database
for any event
* implemented function to create event from database
* added static pointer to current boot event
* implemented deserialization of system_booted_event
* adjusted unit tests

Change-Id: I068af4d35193749f0ce008afe2ed942831317e23
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agomodules: Fix segfault in no-modules configuration 01/147001/1
Paweł Szewczyk [Thu, 31 Aug 2017 12:18:06 +0000 (14:18 +0200)]
modules: Fix segfault in no-modules configuration

Change-Id: I2ef4447742c765f8537a8e86f33cf7af773af14b
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoPut modules in shared libraries 50/144950/10
Paweł Szewczyk [Fri, 18 Aug 2017 11:25:50 +0000 (13:25 +0200)]
Put modules in shared libraries

Change-Id: Iec0a3ce3c61390b3080781ca10e4efd5f485a6c9
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agotests: Store pointer to generate_test_attrs() in test data structure 73/145473/5
Konrad Kuchciak [Tue, 22 Aug 2017 10:08:13 +0000 (12:08 +0200)]
tests: Store pointer to generate_test_attrs() in test data structure

Deserialization test will need to call generate_test_attrs more than
once, so the function should be accessed from the setup function as
well as from the test function

Change-Id: I65f8273732f90567920b8d9b82acb05496384953
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotests: Add faultd_object to serialize_test_data structure 72/145472/3
Konrad Kuchciak [Tue, 22 Aug 2017 09:58:15 +0000 (11:58 +0200)]
tests: Add faultd_object to serialize_test_data structure

Every serialization test created it's own faultd_object to serialize to.
Now it is moved to the common test data structure.

Change-Id: I826c95b8dd7868b89de11bcf0eb4fc20ac5f593b
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotests: Add free_test_data function 91/146591/2
Konrad Kuchciak [Mon, 28 Aug 2017 16:17:03 +0000 (18:17 +0200)]
tests: Add free_test_data function

Freeing of the serialize_test_data structure is now done by one function
in helpers.c

Change-Id: I9b0b638e2c7faee461f8b95caa8da8c39a3e5c6c
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotests: Store only pointers to desired variables in tests attrs 97/145197/5
Konrad Kuchciak [Mon, 21 Aug 2017 13:32:08 +0000 (15:32 +0200)]
tests: Store only pointers to desired variables in tests attrs

Desired variables (especially strings) defined by gcc macro #define
cannot be used by generate_test_attrs function, because an address of
the variable is needed.

Change-Id: Ic0aaf99ea388e73f945681a31413efd3e6f8208a
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
[Rebase onto current head]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agotests: Fix assert_uuid_equal function 90/146590/2
Konrad Kuchciak [Tue, 29 Aug 2017 08:19:23 +0000 (10:19 +0200)]
tests: Fix assert_uuid_equal function

Change-Id: I1e8b50620baf5599528dc77f3e07aeec1a82c1e4
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agodatabase_nop: Return OID on object store attempt 73/145773/6
Paweł Szewczyk [Wed, 23 Aug 2017 15:19:31 +0000 (17:19 +0200)]
database_nop: Return OID on object store attempt

Change-Id: I44b91130f9a389da07dc9d351f1e4c95d8f909b8
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoAdd database API for well-known OIDs 72/145772/5
Paweł Szewczyk [Wed, 23 Aug 2017 13:50:38 +0000 (15:50 +0200)]
Add database API for well-known OIDs

Some well-known objects are stored in database and there should be
universal set of OIDs for them. OIDs however depend on database, so each
database adapter should be able to provide them in its own format.

Change-Id: Ic568dda8e891ba9240f201ecc32a4370a4c51642
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agodatabase: Add oid validation to database abstraction 40/145740/4
Paweł Szewczyk [Wed, 23 Aug 2017 10:32:38 +0000 (12:32 +0200)]
database: Add oid validation to database abstraction

Change-Id: I2657bdb8e2eddc7b5b4cd8d44b35a24f99fb8bd3
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agotests: Add database adapter for testing purposes 39/145739/4
Paweł Szewczyk [Wed, 23 Aug 2017 11:51:58 +0000 (13:51 +0200)]
tests: Add database adapter for testing purposes

Change-Id: I2a8fe6cb432da5120cde1a5133b5fd3c63190157
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoAdd id key to database abstraction layer 38/145738/2
Paweł Szewczyk [Wed, 23 Aug 2017 09:38:18 +0000 (11:38 +0200)]
Add id key to database abstraction layer

Change-Id: I1c1be8bba0aa1c6fb3a3627bc7878c7b38213f47
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoRemove reason's OID checking during serialization 84/145184/2 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20170829.020549 accepted/tizen/unified/20170822.113016 submit/tizen/20170821.133151 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004 tizen_4.0.IoT.p1_release tizen_4.0.IoT.p2_release tizen_4.0.m2_release
Paweł Szewczyk [Mon, 21 Aug 2017 12:49:11 +0000 (14:49 +0200)]
Remove reason's OID checking during serialization

Serialization function should not care about OIDs, because they depend
on database adapter. Reason's OID being zero does not neccessarily mean
the reason is not valid.

Change-Id: Icd792cf20d08099579735edf1362d16256243b44
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoDrop SMACK privilege from System::Privileged to System 56/144956/2 submit/tizen/20170821.012629
Kunhoon Baik [Fri, 18 Aug 2017 12:50:57 +0000 (21:50 +0900)]
Drop SMACK privilege from System::Privileged to System

1) Faultd does not change Smack Label.
2) "System" Privilege has most read/write/access permission for most objects of Tizen.

Thus, Faultd should be executed as "System" Privilege.

Change-Id: I6a8b73995dc71c4181470700462137877eff7182

7 years agoMerge "Fix creating OIDs for database adapters" into tizen accepted/tizen/unified/20170818.000033 submit/tizen/20170817.142242
Karol Lewandowski [Thu, 17 Aug 2017 13:59:33 +0000 (13:59 +0000)]
Merge "Fix creating OIDs for database adapters" into tizen

7 years agoFix creating OIDs for database adapters 18/144718/1
Paweł Szewczyk [Thu, 17 Aug 2017 13:16:31 +0000 (15:16 +0200)]
Fix creating OIDs for database adapters

Different database adapters could have different oid sizes. This commit
fill unused bytes of oid with zeros.

Change-Id: Ida1ec8bd0223c221d12384acbe6bcb0fb78e0018
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoAdd CFLAGS/LDFLAGS for ASLR 92/144392/1 submit/tizen/20170816.231957
Łukasz Stelmach [Wed, 16 Aug 2017 10:45:03 +0000 (12:45 +0200)]
Add CFLAGS/LDFLAGS for ASLR

Change-Id: I215a8c004194973c1b54688a91fa806ad71802d7
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 years agoAdd unit tests for serialization 07/141207/23
Konrad Kuchciak [Thu, 10 Aug 2017 21:48:24 +0000 (23:48 +0200)]
Add unit tests for serialization

Change-Id: I7a3a22f808b9064ab85bfa1742a0e414539a8758
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
[Put actual test func into helper, remove copy-paste code]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoAdd unit tests for ejdb module 19/143619/6
Konrad Kuchciak [Wed, 9 Aug 2017 12:13:53 +0000 (14:13 +0200)]
Add unit tests for ejdb module

Testing conversion between faultd_object and bson.

Change-Id: I8f57f4cf1ad005b7a6596112beee49ffab47815e
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
[Fix found issues]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoImplement conversion between faultd_object and bson 03/142903/9
Konrad Kuchciak [Mon, 7 Aug 2017 14:28:13 +0000 (16:28 +0200)]
Implement conversion between faultd_object and bson

Change-Id: I341da653910f1458b4bb3557b97a2560591b4c28
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotests: Fix helpers.c 18/143618/1
Konrad Kuchciak [Thu, 10 Aug 2017 13:13:40 +0000 (15:13 +0200)]
tests: Fix helpers.c

Get rid of warnings related to pointer casting in
uuid_equal_display_error().
Clear memory before generating UUID in generate_oid().
Generate random uuid in generate_uuid().

Change-Id: I0646b1a4a31da23dbca5411ab659f67c3fca8333
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotests: Add assert functions for missing types 40/143340/4
Konrad Kuchciak [Wed, 9 Aug 2017 09:36:52 +0000 (11:36 +0200)]
tests: Add assert functions for missing types

Change-Id: I6072eca75ba12172d7a7effb379c1e9dc9929492
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotests: Add memory assert in generate_string() 39/143339/3
Konrad Kuchciak [Wed, 9 Aug 2017 09:36:28 +0000 (11:36 +0200)]
tests: Add memory assert in generate_string()

Change-Id: Id95e63e76725e0a09a0689eb049b54236d7f2485
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoAdd faultd_object_get_oid function 38/143338/1
Konrad Kuchciak [Wed, 9 Aug 2017 09:21:58 +0000 (11:21 +0200)]
Add faultd_object_get_oid function

Change-Id: I371c29be8fc2eff0021e048f811eb8896d394eeb

7 years agoFix serialization/deserialization issues 25/141425/4
Konrad Kuchciak [Mon, 31 Jul 2017 09:22:40 +0000 (11:22 +0200)]
Fix serialization/deserialization issues

Change-Id: Id51a70f7b73c114ae28fbc4740b4275932060569
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotests: Fix TEST_ENTRY_POINT() macro 06/142906/1
Krzysztof Opasiak [Mon, 7 Aug 2017 18:33:30 +0000 (20:33 +0200)]
tests: Fix TEST_ENTRY_POINT() macro

Fix couple of issues:
- remove ptr variable from release builds
- Fix module name used in macro
- Add other macros to help calling this function from test code

Change-Id: If7b35ed4920e1f25121288146df84f8f2946ffb2
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoFix memory leak in faultd_object_new unit test 75/142575/1
Konrad Kuchciak [Fri, 4 Aug 2017 09:43:36 +0000 (11:43 +0200)]
Fix memory leak in faultd_object_new unit test

Change-Id: Iffb32933e15aedfe6ce943f43e0fcc7e7adeddf8
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agotizen: Disable restarting display-manager.service 91/138991/5
Karol Lewandowski [Mon, 17 Jul 2017 13:52:58 +0000 (15:52 +0200)]
tizen: Disable restarting display-manager.service

display-manager is VIP, meaning its failure has to cause
system reboot.  However, current faultd logic waits for
service to enter failed state before system gets restarted.

Without this patch display-manager never enters failed state
as systemd does not place restartable services in failed state
unless it reaches JobTimeoutSec+StartLimitBurst limits.

This patch disables restart logic in display-manager for above
reason.

Change-Id: I945601caf2b31f0103b09e0d271919b5807e3d6d
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agopackaging: Disable ejdb module 04/141204/3
Karol Lewandowski [Fri, 28 Jul 2017 12:20:01 +0000 (14:20 +0200)]
packaging: Disable ejdb module

For initial deployment - VIP handling - database support
is not needed.  Compiling-out ejdb support reduces faultd
size by few kb, but more importantly it and drops libejdb.so
library dependency - saving up to 1.3MB of storage.

   text    data     bss     dec     hex filename
  56046    3184     216   59446    e836 db-ejdb/usr/sbin/faultd
  49744    2872     216   52832    ce60 db-nop/usr/sbin/faultd

Change-Id: Ie3bca2f1416b75cd249f138942de92f5632add29
[Rebase onto current HEAD]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoMerge changes Id8957cb4,Iac6be95a into tizen
Krzysztof Opasiak [Thu, 3 Aug 2017 14:53:06 +0000 (14:53 +0000)]
Merge changes Id8957cb4,Iac6be95a into tizen

* changes:
  Drop bson code from core
  Make database backends disableable

7 years agoDisable all modules except for those required for VIP handling 88/141188/2
Karol Lewandowski [Fri, 28 Jul 2017 10:27:57 +0000 (12:27 +0200)]
Disable all modules except for those required for VIP handling

For initial deployment only VIP handling is required, meaning
following modules are left enabled:

 - systemd & startup listeners (for detecting service failures),
 - vip decision maker (triggers system_reboot action)
 - system_reboot action

Disabling rest of modules gives about 20% of .text:

   text    data     bss     dec     hex filename
  63618    5176     208   69002   10d8a before/usr/sbin/faultd
  52423    3248     208   55879    da47 after/usr/sbin/faultd

Change-Id: I49b4d5a0fa605ca0469baef59e7c97078974a550

7 years agoDrop bson code from core 03/141203/2
Karol Lewandowski [Fri, 28 Jul 2017 12:13:09 +0000 (14:13 +0200)]
Drop bson code from core

This commit will cause faultd to be linked to libejdb only
when ejdb module is enabled.

Change-Id: Id8957cb4e95ce7ea48079d53aaad31bceda2cf12
[Rebase to current HEAD]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoMake database backends disableable 02/141202/2
Karol Lewandowski [Fri, 28 Jul 2017 11:53:01 +0000 (13:53 +0200)]
Make database backends disableable

Default to ejdb, if not specified.

Change-Id: Iac6be95a7653ee79802122d80f3c9261ed9ffdfe

7 years agoAdd unit tests for faultd_object type 84/140584/17
Konrad Kuchciak [Tue, 25 Jul 2017 11:54:42 +0000 (13:54 +0200)]
Add unit tests for faultd_object type

Change-Id: I68b144b475979b238dd7f61c2df3dd715506bad6
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
[Update test to changes in implementation]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoAdd helper sources for unit tests 08/140808/11
Konrad Kuchciak [Wed, 26 Jul 2017 11:07:06 +0000 (13:07 +0200)]
Add helper sources for unit tests

Change-Id: Ie9ebf2ae5bae6e33fde763792e26f416d6834f51
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
[Fix string generation]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoMake database abstraction layer not depend on ejdb 35/139335/12
Paweł Szewczyk [Tue, 1 Aug 2017 17:28:52 +0000 (19:28 +0200)]
Make database abstraction layer not depend on ejdb

This commit introduces new abstraction layer for databases. Database
logic is separated into independent modules, leaving in core only
generic code.

Change-Id: I6291628b31f96df8d8acae77d659a9da733f2f36
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
[Minor fixes]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoAdd new interface for storing json-like objects 34/139334/11
Paweł Szewczyk [Wed, 19 Jul 2017 14:09:41 +0000 (16:09 +0200)]
Add new interface for storing json-like objects

Change-Id: Ia55546087931d537580020fc1ea6cf36e39a08b3
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
[Use generic functions instead of copy-paste code]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoAdd feature to enable specified modules at build time. 11/139811/6
Konrad Kuchciak [Thu, 20 Jul 2017 12:06:41 +0000 (14:06 +0200)]
Add feature to enable specified modules at build time.

Change-Id: If40c344ef163e4855fa867cd2ed521516630295f

7 years agoAlign faultd_bson_get_timespec function to fit convention used in EJDB. 24/138924/4
Konrad Kuchciak [Thu, 13 Jul 2017 15:24:33 +0000 (17:24 +0200)]
Align faultd_bson_get_timespec function to fit convention used in EJDB.

Change-Id: I20549539cb05d84c67c742a9de3ae678db88c412

7 years agoFIX: build should fail if any of the tests fail, not only last. 22/138922/4
Konrad Kuchciak [Fri, 14 Jul 2017 07:36:02 +0000 (09:36 +0200)]
FIX: build should fail if any of the tests fail, not only last.

Change-Id: Ia7265b29bce8bc1d99837ba0242c081208e2c7f9

7 years agoSome POC of faultd test framework 86/134286/7
Krzysztof Opasiak [Thu, 15 Jun 2017 22:25:10 +0000 (00:25 +0200)]
Some POC of faultd test framework

Change-Id: Ib9b8f8bca49b0dc546287aec1dedecc9e149c4b2
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoImplement basic recovery mechanism 42/136442/5
Paweł Szewczyk [Thu, 29 Jun 2017 12:31:29 +0000 (14:31 +0200)]
Implement basic recovery mechanism

Change-Id: I26faf1621ab8e09b6d756d8131f7e55c21e125d5
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoImplement deserialisation of resource_violation_event 88/132988/6
Łukasz Stelmach [Thu, 8 Jun 2017 12:59:50 +0000 (14:59 +0200)]
Implement deserialisation of resource_violation_event

Change-Id: Iac3cee29e78a1099443e29481a603ef624e5159f
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 years agoImplement deserialisation of service_failed_event 70/132970/10
Łukasz Stelmach [Fri, 2 Jun 2017 14:45:35 +0000 (16:45 +0200)]
Implement deserialisation of service_failed_event

Allocate service_failed_event and fill it with data loaded from the
database.

Change-Id: Ib3d82e92e6e3c21cc37859aaef443b9b991c06e5
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
[ Remove BSON_BIN_UUID_OLD due to compilation error with new EJDB
version. ]
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
7 years agoSerialise OID of the event being the reason for the decision 93/135293/4
Łukasz Stelmach [Wed, 21 Jun 2017 13:35:52 +0000 (15:35 +0200)]
Serialise OID of the event being the reason for the decision

Change-Id: I12969364083f93b5c164871da50f3ba1f9ccc806
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 years agoAdd command line help 70/135470/9
Paweł Szewczyk [Thu, 22 Jun 2017 11:08:04 +0000 (13:08 +0200)]
Add command line help

Change-Id: I33caa8cd478e7a413ad412a3cf12851944443bb4
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoAdd faultd configuration 30/133530/11
Paweł Szewczyk [Tue, 11 Jul 2017 13:11:28 +0000 (15:11 +0200)]
Add faultd configuration

Includes configuration parsing.

Change-Id: I94ab44a652635ac36a9ada4ddf4e07ba1e712de8
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoAdd action executed event 78/137178/2
Krzysztof Opasiak [Tue, 4 Jul 2017 15:05:52 +0000 (17:05 +0200)]
Add action executed event

This event should be generated after each action execution
this allows to store action log into data base using our
generic framework.

Add also dummy handler for this event type to avoid some logs
about unhandled event.

Change-Id: If18b2bc7692ef136f6e952fd59350940e021fba5
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoStart faultd on boot 67/135467/3
Łukasz Stelmach [Thu, 22 Jun 2017 10:36:40 +0000 (12:36 +0200)]
Start faultd on boot

Change-Id: Iacc1b0d70aed33ba21ea130573104ba3f8c4b306
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 years agoSave faultd database under /var/db/faultd 78/135478/3
Łukasz Stelmach [Thu, 22 Jun 2017 12:25:50 +0000 (14:25 +0200)]
Save faultd database under /var/db/faultd

Change-Id: I77fe25d835ee4cf7677a9cde58ac72ed71604453
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 years agoDisable audit-listener module in service file 76/135476/1 accepted/tizen/4.0/unified/20170816.012044 accepted/tizen/unified/20170629.085835 submit/tizen/20170622.134850 submit/tizen_4.0/20170811.094300
Paweł Szewczyk [Thu, 22 Jun 2017 12:12:26 +0000 (14:12 +0200)]
Disable audit-listener module in service file

Change-Id: I3a336341294de2bf511983d318d7bb938e70ceb0
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoDisable action modules 56/135456/1 accepted/tizen/unified/20170629.085808 submit/tizen/20170622.101818
Łukasz Stelmach [Thu, 22 Jun 2017 10:10:43 +0000 (12:10 +0200)]
Disable action modules

Deploy faultd to Mobile and Wearable images with actions disabled to
prevent regressions.

Change-Id: I5ddf26143ad3eb804575e4d0c7eeb3949725075e
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 years agoAdd no-action command line option 98/135298/2
Paweł Szewczyk [Wed, 21 Jun 2017 16:01:40 +0000 (18:01 +0200)]
Add no-action command line option

Also adds a possibility to disable any module category.

Change-Id: I82a24f6e4594a0946ce4b796cedbb59da0b722ad
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoAdd disable-module command line option 96/135296/2
Paweł Szewczyk [Wed, 21 Jun 2017 15:35:53 +0000 (17:35 +0200)]
Add disable-module command line option

Change-Id: I396c93df20017f27b305b0eae23e0cfd0c834caf
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoInstall configuration files in Makefile instead of spec 94/135294/2
Łukasz Stelmach [Wed, 21 Jun 2017 14:56:10 +0000 (16:56 +0200)]
Install configuration files in Makefile instead of spec

Change-Id: Ib3c754f692965ab2e8c02eded74f35fb866d709f
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 years agoUse private bus provided by systemd 27/131527/7
Paweł Szewczyk [Wed, 7 Jun 2017 13:24:55 +0000 (15:24 +0200)]
Use private bus provided by systemd

Change-Id: I74a141d484002054b7a7a4ec72b0bacaa9e5f6f7
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoImplement last boot id retrieval from db 13/130513/7
Paweł Szewczyk [Mon, 22 May 2017 13:51:48 +0000 (15:51 +0200)]
Implement last boot id retrieval from db

Change-Id: I84d8baa64df118855aa74afb54bcf28b4fec3afa
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agodatabase: Add retrieval function 12/130512/7
Paweł Szewczyk [Mon, 22 May 2017 13:51:52 +0000 (15:51 +0200)]
database: Add retrieval function

Change-Id: I701707829c2308fbdb971d1b533ded81a81a07f8
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoAdd 'system booted' event 11/130511/7
Paweł Szewczyk [Mon, 22 May 2017 11:24:14 +0000 (13:24 +0200)]
Add 'system booted' event

Event is generated based on boot id stored in database. This commit is
based on stub implementation of last boot id retrieval from db.

Change-Id: I59c22fbae6eeebda9de83e7905aed478711cc655
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoAdd faultd startup listener and 'faultd started' event 10/130510/5
Paweł Szewczyk [Mon, 22 May 2017 15:07:19 +0000 (17:07 +0200)]
Add faultd startup listener and 'faultd started' event

Change-Id: I7038132bdeb5337dfdd787acc812cce5fa26176b
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoFix test entry point declaration 22/134422/1
Łukasz Stelmach [Fri, 16 Jun 2017 09:04:57 +0000 (11:04 +0200)]
Fix test entry point declaration

Change-Id: I4930178d3bba1ce70e8afe9ee8333e6078e84c21

8 years agoAdd the option to enable testing code 05/134105/2
Łukasz Stelmach [Wed, 14 Jun 2017 14:30:20 +0000 (16:30 +0200)]
Add the option to enable testing code

Add the option in configure.ac and the macro to define entry points
for testing code.

Change-Id: Icbdc657283b925935861e951123a3b4d4ee55662
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agoDerive module module names from file names 04/134104/1
Łukasz Stelmach [Wed, 14 Jun 2017 14:28:09 +0000 (16:28 +0200)]
Derive module module names from file names

Change-Id: I24fa4f6fd69a968b529080f7509926bd0af8b85f
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agocore: service: Add serialisation for service_type and recovery_unit 18/133818/1
Łukasz Stelmach [Mon, 12 Jun 2017 15:14:01 +0000 (17:14 +0200)]
core: service: Add serialisation for service_type and recovery_unit

Change-Id: I174617c69f5a69e3f7bb3f74d8d1a147fdf7565e
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agodatabase: implement database_load() 71/131171/12
Łukasz Stelmach [Thu, 25 May 2017 15:38:45 +0000 (17:38 +0200)]
database: implement database_load()

Change-Id: Ieb99efe60e1de90ee2103843dcae0ff14ea96104

8 years agoUse bson instead of void * for passing action data 09/132009/7
Krzysztof Opasiak [Wed, 31 May 2017 17:38:38 +0000 (19:38 +0200)]
Use bson instead of void * for passing action data

Change-Id: I43de8f7d1162a5f6824ca404add341b201bbf2e5
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoAdd helpers to fill bson with data required for given action 08/132008/7
Krzysztof Opasiak [Mon, 5 Jun 2017 17:01:12 +0000 (19:01 +0200)]
Add helpers to fill bson with data required for given action

Change-Id: I9ffd9ff03afa054398b571b18e3694d1f3a093a8
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoAdd helpers for bson manipulation 07/132007/7
Krzysztof Opasiak [Wed, 31 May 2017 10:32:10 +0000 (12:32 +0200)]
Add helpers for bson manipulation

Change-Id: Iad2cefd42c3322a7d7d9a4fd66f3f939e88d87c7
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoAdd decision maker to handle all standard services 66/131366/7
Krzysztof Opasiak [Fri, 26 May 2017 15:04:37 +0000 (17:04 +0200)]
Add decision maker to handle all standard services

For now we always cleanup and restart service.
In future we should check the history and reboot platform
after 3 failures of some service.

Change-Id: I76562af73d65ec350f8bd34a8b96545a11e5e1ac
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoMerge "Serialise events to bson format" into tizen
Krzysztof Opasiak [Mon, 5 Jun 2017 16:43:11 +0000 (16:43 +0000)]
Merge "Serialise events to bson format" into tizen

8 years agoMerge "core: Create database adapter module" into tizen
Krzysztof Opasiak [Mon, 5 Jun 2017 16:40:13 +0000 (16:40 +0000)]
Merge "core: Create database adapter module" into tizen

8 years agoAdd VIP service decision maker 36/130536/6
Krzysztof Opasiak [Mon, 22 May 2017 16:49:25 +0000 (18:49 +0200)]
Add VIP service decision maker

Add a decision maker which will reboot the system if VIP
service has entered a failed state

Change-Id: I05bc657bb48b7ba826da922b8d8f6cc1a72a2846
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agodm: rv_dm: Request platform reboot if VIP service has a resource leak 84/130484/8
Krzysztof Opasiak [Fri, 19 May 2017 17:27:36 +0000 (19:27 +0200)]
dm: rv_dm: Request platform reboot if VIP service has a resource leak

Change-Id: Ia6608b7939eadea4a5991f21af5b556277aff0d0
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoAdd some helper for service type checking 83/130483/6
Krzysztof Opasiak [Fri, 19 May 2017 17:25:25 +0000 (19:25 +0200)]
Add some helper for service type checking

Change-Id: If11034bedd999d52f0dd0f96627c96109b0d66d8
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoAdd faultd config files for test services 85/130485/7
Krzysztof Opasiak [Mon, 22 May 2017 08:54:24 +0000 (10:54 +0200)]
Add faultd config files for test services

Change-Id: Id5def3bed1bdb8804ffebdfd5f942246663319c7
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoSerialise events to bson format 64/130264/9
Łukasz Stelmach [Fri, 19 May 2017 15:00:16 +0000 (17:00 +0200)]
Serialise events to bson format

Change-Id: Iebe856156ce6e65e3edcaf79952a633d25a1ea6d
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agocore: Create database adapter module 63/130263/8
Łukasz Stelmach [Mon, 22 May 2017 10:57:32 +0000 (12:57 +0200)]
core: Create database adapter module

Change-Id: I5a77674ae87defab22a8925b49f4db7f54d97241
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agoAdd configuration for currently customized services 63/131163/3
Paweł Szewczyk [Thu, 25 May 2017 13:47:45 +0000 (15:47 +0200)]
Add configuration for currently customized services

Change-Id: I1bee7131990570dd7dc446c9f86072448b5788b0
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agoFix copyright notices 35/130735/3
Łukasz Stelmach [Tue, 23 May 2017 12:16:47 +0000 (14:16 +0200)]
Fix copyright notices

Change-Id: I4b38c66de2d478015b5256294d55ab36cbaf9595
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agoDefine _GNU_SOURCE globally in CFLAGS 34/130734/3
Łukasz Stelmach [Tue, 23 May 2017 12:03:25 +0000 (14:03 +0200)]
Define _GNU_SOURCE globally in CFLAGS

Change-Id: I0147ac08c961987e9d1ce49b87091955a5e8a35c
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agoservice: Add service-related configuration parsing 57/129957/13
Paweł Szewczyk [Fri, 19 May 2017 09:04:25 +0000 (11:04 +0200)]
service: Add service-related configuration parsing

Introduce service configuration files stored in /etc/faultd/config.d.

Config files are stored in json format, so this adds dependency on
json-c library.

Change-Id: Ibec741d67a563e8a1fb4037459e3acc00081c62c
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
[Fix memory mngnt and split to smaller functions]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoProvide serialising function for struct timespec 58/130258/2
Łukasz Stelmach [Mon, 15 May 2017 08:44:58 +0000 (10:44 +0200)]
Provide serialising function for struct timespec

Provide serialising function for struct timespec as well as macro for
generating such functions.

Change-Id: Ib27477b2be0ab9e6f38f5d1fede477426acb7e80
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agoZero allocated event structures 65/130265/2
Łukasz Stelmach [Mon, 22 May 2017 10:04:10 +0000 (12:04 +0200)]
Zero allocated event structures

Change-Id: Ic85cf158cb4187400b5ef0a203c36e147ef88de2
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
8 years agotests: update db test programme 61/130261/2
Łukasz Stelmach [Wed, 17 May 2017 13:25:07 +0000 (15:25 +0200)]
tests: update db test programme

Change-Id: I66d7dda70e037651f5edd299c3f108f684ab1021
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
[Rebase onto current head]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>