summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt1
-rw-r--r--packaging/deviced.spec1
-rw-r--r--src/core/main.c11
-rw-r--r--systemd/deviced.service1
4 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index af799e41..37c07c3a 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -180,6 +180,7 @@ SET(PKG_MODULES
mount
capi-system-info
argos_watchdog
+ libsystemd
)
IF(DISPLAY_MODULE STREQUAL on)
diff --git a/packaging/deviced.spec b/packaging/deviced.spec
index bdb06d72..7fd84cb8 100644
--- a/packaging/deviced.spec
+++ b/packaging/deviced.spec
@@ -80,6 +80,7 @@ BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(hwcommon)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(argos_watchdog)
+BuildRequires: pkgconfig(libsystemd)
%if %{?display_module} == on
BuildRequires: pkgconfig(libinput)
BuildRequires: pkgconfig(capi-system-sensor)
diff --git a/src/core/main.c b/src/core/main.c
index 86395c81..5a148db8 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -21,6 +21,8 @@
#include <fcntl.h>
#include <sys/reboot.h>
#include <argos.h>
+#include <systemd/sd-daemon.h>
+#include <glib.h>
#include "display/core.h"
#include "log.h"
@@ -71,6 +73,13 @@ static Eina_Bool watchdog_cb(void *data)
return ECORE_CALLBACK_RENEW;
}
+static gboolean deviced_notify(gpointer data)
+{
+ _I("sd_notify(READY=1)");
+ sd_notify(0, "READY=1");
+ return G_SOURCE_REMOVE;
+}
+
static int deviced_main(int argc, char **argv)
{
int ret;
@@ -97,6 +106,8 @@ static int deviced_main(int argc, char **argv)
_E("aw_register failed");
}
+ g_idle_add(deviced_notify, NULL);
+
ecore_main_loop_begin();
devices_exit(NULL);
diff --git a/systemd/deviced.service b/systemd/deviced.service
index b9fdc332..f3b48b97 100644
--- a/systemd/deviced.service
+++ b/systemd/deviced.service
@@ -2,6 +2,7 @@
Description=System device daemon
[Service]
+Type=notify
SmackProcessLabel=System::Privileged
ExecStart=/usr/bin/deviced
Restart=always