Calls sd_notify(STOPPING=1) to ensure systemd's operation 80/219180/2
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 3 Dec 2019 01:47:19 +0000 (10:47 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 4 Dec 2019 08:13:34 +0000 (17:13 +0900)
Change-Id: Ifdea8bd44796f7581c783c97243f9aa03046ca8f
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-service-adaptation/CMakeLists.txt
bt-service-adaptation/services/bt-request-handler.c
packaging/bluetooth-frwk-common.service
packaging/bluetooth-frwk-mobile-sprd.service
packaging/bluetooth-frwk-mobile.service
packaging/bluetooth-frwk-tv.service
packaging/bluetooth-frwk-wearable.service
packaging/bluetooth-frwk.spec

index 699b7d8..d3477fd 100644 (file)
@@ -86,6 +86,7 @@ SET(PKG_MODULES
         eventsystem
         storage
         capi-system-info
+        libsystemd-daemon
 )
 
 INCLUDE(FindPkgConfig)
index 87f79bb..d1d1203 100644 (file)
@@ -23,6 +23,7 @@
 #include <gio/gunixfdlist.h>
 #include <cynara-client.h>
 #include <cynara-creds-gdbus.h>
+#include <systemd/sd-daemon.h>
 
 #include "bluetooth-api.h"
 #include "bluetooth-audio-api.h"
@@ -4309,6 +4310,8 @@ fail:
 void _bt_service_unregister(void)
 {
        if (bt_service_conn) {
+               sd_notify(0, "STOPPING=1");
+
                if (owner_sig_id > 0) {
                        g_dbus_connection_signal_unsubscribe(
                                        bt_service_conn, owner_sig_id);
index 4a8808c..9d15b36 100644 (file)
@@ -11,6 +11,7 @@ ExecStart=/usr/bin/bt-service
 Restart=on-failure
 RestartSec=1
 KillMode=process
+NotifyAccess=main
 
 [Install]
-WantedBy=multi-user.target
\ No newline at end of file
+WantedBy=multi-user.target
index fe84c39..6113d1d 100644 (file)
@@ -12,6 +12,7 @@ BusName=org.projectx.bt
 ExecStartPre=/bin/sleep 2
 ExecStart=/usr/bin/bt-service
 KillMode=process
+NotifyAccess=main
 
 [Install]
 WantedBy=multi-user.target
index 5127971..092e58b 100644 (file)
@@ -10,6 +10,7 @@ Type=dbus
 BusName=org.projectx.bt
 ExecStart=/usr/bin/bt-service
 KillMode=process
+NotifyAccess=main
 
 [Install]
 WantedBy=multi-user.target
index 5f09436..461eb91 100644 (file)
@@ -11,6 +11,7 @@ Type=dbus
 BusName=org.projectx.bt
 ExecStart=/usr/bin/bt-service
 KillMode=process
+NotifyAccess=main
 
 [Install]
 WantedBy=multi-user.target
index 5127971..092e58b 100644 (file)
@@ -10,6 +10,7 @@ Type=dbus
 BusName=org.projectx.bt
 ExecStart=/usr/bin/bt-service
 KillMode=process
+NotifyAccess=main
 
 [Install]
 WantedBy=multi-user.target
index 7a5f275..68bde80 100644 (file)
@@ -43,6 +43,7 @@ BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(capi-appfw-app-control)
 BuildRequires:  pkgconfig(gmock)
 BuildRequires:  pkgconfig(libactd)
+BuildRequires:  pkgconfig(libsystemd-daemon)
 
 Requires(post): /usr/bin/vconftool
 Requires(post): /sbin/ldconfig