summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Opaniuk <igor.opaniuk@toradex.com>2020-11-25 19:29:43 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2020-12-08 15:01:18 +0100
commit21aae47faea28cff88cb4f33825495a5356a1f72 (patch)
tree782922220202d30f582d9a2cef568984321c484e
parente22ff522f1d98e95053d15f7699f58428fab2ac2 (diff)
mtd-utils: add initial systemd service description
Add initial ubihealthd.service for systemd. It can be enabled to start automatically. Testing: [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... Starting UBI health daemon... [ OK ] Started UBI health daemon. .... root@colibri-imx6ull:~# systemctl status ubihealthd.service * ubihealthd.service - UBI health daemon Loaded: loaded (/lib/systemd/system/ubihealthd.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2020-11-25 16:09:03 UTC; 41s ago Process: 498 ExecStart=/usr/sbin/ubihealthd (code=exited, status=0/SUCCESS) Main PID: 499 (ubihealthd) CGroup: /system.slice/ubihealthd.service `-499 /usr/sbin/ubihealthd Nov 25 16:09:03 colibri-imx6ull systemd[1]: Starting UBI health daemon... Nov 25 16:09:03 colibri-imx6ull systemd[1]: Started UBI health daemon. Related-to: ELB-3249 Signed-off-by: default avatarIgor Opaniuk <igor.opaniuk@toradex.com> (cherry picked from commit b1d95a6bb125e5a84f8e02adf6f1df0552317c8b)
-rw-r--r--recipes-devtools/mtd/mtd-utils/ubihealthd.service10
-rw-r--r--recipes-devtools/mtd/mtd-utils_%.bbappend16
2 files changed, 26 insertions, 0 deletions
diff --git a/recipes-devtools/mtd/mtd-utils/ubihealthd.service b/recipes-devtools/mtd/mtd-utils/ubihealthd.service
new file mode 100644
index 0000000..74b8df6
--- /dev/null
+++ b/recipes-devtools/mtd/mtd-utils/ubihealthd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=UBI health daemon
+After=multi-user.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/ubihealthd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/recipes-devtools/mtd/mtd-utils_%.bbappend b/recipes-devtools/mtd/mtd-utils_%.bbappend
new file mode 100644
index 0000000..054c939
--- /dev/null
+++ b/recipes-devtools/mtd/mtd-utils_%.bbappend
@@ -0,0 +1,16 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI_append_ = " file://ubihealthd.service"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "ubihealthd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append() {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/ubihealthd.service ${D}${systemd_unitdir}/system/
+ sed -i -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ ${D}${systemd_unitdir}/system/*.service
+}