Skip to content
Snippets Groups Projects
Commit 66d5a51c authored by Esben Haabendal's avatar Esben Haabendal
Browse files

openharmony-standard: Add sd_notify ready notification to samgr service


Signed-off-by: default avatarEsben Haabendal <esben@geanix.com>
parent bef4b653
No related branches found
No related tags found
1 merge request!109Systemd service integration and stability improvements
diff --git a/services/samgr/native/BUILD.gn b/services/samgr/native/BUILD.gn
index 9b7e4a4e6301..48c512f430e6 100755
--- a/services/samgr/native/BUILD.gn
+++ b/services/samgr/native/BUILD.gn
@@ -67,6 +67,7 @@ ohos_executable("samgr") {
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
"//utils/native/base:utils",
]
+ libs = [ "systemd" ]
configs = [
":sam_config",
diff --git a/services/samgr/native/source/sa_main.cpp b/services/samgr/native/source/sa_main.cpp
index 820b6b8d67f9..387abad8d8b8 100755
--- a/services/samgr/native/source/sa_main.cpp
+++ b/services/samgr/native/source/sa_main.cpp
@@ -20,6 +20,8 @@
#include "sam_log.h"
#include "system_ability_manager.h"
+#include <systemd/sd-daemon.h>
+
using namespace OHOS;
int main(int argc, char *argv[])
@@ -32,6 +34,8 @@ int main(int argc, char *argv[])
IPCSkeleton::SetContextObject(serv);
HILOGI("start System Ability Manager Loop");
+ sd_notify(0, "READY=1");
OHOS::IPCSkeleton::JoinWorkThread();
+ sd_notify(0, "STOPPING=1");
return -1;
-}
\ No newline at end of file
+}
...@@ -72,6 +72,8 @@ SRC_URI += "file://param_service-sd-notify.patch;patchdir=${S}/base/startup/init ...@@ -72,6 +72,8 @@ SRC_URI += "file://param_service-sd-notify.patch;patchdir=${S}/base/startup/init
SRC_URI += "file://param-paths.patch;patchdir=${S}/base/startup/init_lite" SRC_URI += "file://param-paths.patch;patchdir=${S}/base/startup/init_lite"
SRC_URI += "file://param_service-Add-to-startup-l2-part.patch;patchdir=${S}/base/startup/appspawn_standard" SRC_URI += "file://param_service-Add-to-startup-l2-part.patch;patchdir=${S}/base/startup/appspawn_standard"
SRC_URI += "file://samgr-sd-notify.patch;patchdir=${S}/foundation/distributedschedule/samgr"
SRC_URI += "file://base_hiviewdfx_hiview-libfaultlogger-static.patch;patchdir=${S}/base/hiviewdfx/hiview" SRC_URI += "file://base_hiviewdfx_hiview-libfaultlogger-static.patch;patchdir=${S}/base/hiviewdfx/hiview"
# Patch to allow /system/profile and /system/usr to be symlinks to /usr/lib/openharmony # Patch to allow /system/profile and /system/usr to be symlinks to /usr/lib/openharmony
...@@ -779,7 +781,7 @@ do_install:append() { ...@@ -779,7 +781,7 @@ do_install:append() {
install -m 644 ${WORKDIR}/samgr.service ${D}${systemd_unitdir}/system/ install -m 644 ${WORKDIR}/samgr.service ${D}${systemd_unitdir}/system/
rm -f ${D}${sysconfdir}/openharmony/init/samgr_standard.cfg rm -f ${D}${sysconfdir}/openharmony/init/samgr_standard.cfg
} }
RDEPENDS:${PN}-samgr += "musl libcxx" RDEPENDS:${PN}-samgr += "musl libcxx libsystemd"
RDEPENDS:${PN}-samgr += "${PN}-hilog ${PN}-ipc ${PN}-libutils ${PN}-thirdparty-libxml2" RDEPENDS:${PN}-samgr += "${PN}-hilog ${PN}-ipc ${PN}-libutils ${PN}-thirdparty-libxml2"
RDEPENDS:${PN} += "${PN}-samgr" RDEPENDS:${PN} += "${PN}-samgr"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment