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

openharmony-standard: Create systemd service for hilogd daemon


Signed-off-by: default avatarEsben Haabendal <esben.haabendal@huawei.com>
parent b8b3aeb5
No related branches found
No related tags found
No related merge requests found
[Unit]
Description=OpenHarmony hilog daemon
[Service]
ExecStartPre=mkdir -p /dev/unix/socket
ExecStartPre=mkdir -p /data/log/hilog
ExecStart=/usr/bin/hilogd
[Install]
WantedBy=multi-user.target
......@@ -3,24 +3,16 @@
#
# SPDX-License-Identifier: Apache-2.0
# Create directories required by hilogd and hilog
mkdir -p /dev/unix/socket
mkdir -p /data/log/hilog
# Start the hilogd service if it is not already running
systemctl start hilogd.service
# Add path to hilog test suite $PATH
PTEST_PATH=$(dirname $(readlink -f $0))
export PATH="${PTEST_PATH}/moduletest/hiviewdfx/hilog:${PATH}"
hilogd &
HILOGD_PID=$!
# Wait a bit so there is a better chance that hilogd is ready for the test
sleep 1
HiLogNDKTest
TEST_RESULT=$?
kill "${HILOGD_PID}"
if test "$TEST_RESULT" -eq 0; then
echo "PASS: HiLogNDKTest"
else
......
......@@ -330,6 +330,20 @@ RDEPENDS:${PN}-libutilsecurec += "musl libcxx"
RDEPENDS:${PN}-libutils += "musl libcxx ${PN}"
RDEPENDS:${PN} += "${PN}-libutilsecurec ${PN}-libutils"
inherit systemd
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "hilogd.service"
SRC_URI += "file://hilogd.service"
do_install:append() {
install -d ${D}/${systemd_unitdir}/system
install -m 644 ${WORKDIR}/hilogd.service ${D}${systemd_unitdir}/system/
rm -f ${D}${sysconfdir}/init/hilogd.cfg
install -d ${D}${sysconfdir}/sysctl.d
echo "net.unix.max_dgram_qlen=600" > ${D}${sysconfdir}/sysctl.d/hilogd.conf
}
INSANE_SKIP:${PN} = "already-stripped"
EXCLUDE_FROM_SHLIBS = "1"
......
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