-
Notifications
You must be signed in to change notification settings - Fork 1
/
microservicebus-node-service_2.3.1.bb
46 lines (34 loc) · 1.82 KB
/
microservicebus-node-service_2.3.1.bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
inherit systemd
SUMMARY = "Install microservicebus as systemd service and add dbus conf file"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI += "file://microservicebus-node.service \
file://com.microservicebus.core.conf"
S = "${WORKDIR}"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = " microservicebus-node.service"
FILES_${PN} += "${systemd_system_unitdir}/microservicebus-node.service \
${datadir}/dbus-1/system.d/com.microservicebus.core.conf"
#Dynamic parameters for service file, set default values
MSB_NODE_ARG ?= "-w"
MSB_NODE_WORK_DIR ?= "/usr/lib/node/microservicebus-node"
MSB_NODE_USER ?= "msb"
MSB_NODE_GROUP ?= "msb"
MSB_NODE_HOST ?= "microservicebus.com"
MSB_DAM_SOCKETPATH ?= "/var/run/dam"
do_install() {
#Replace parameters in service file
sed -i -e 's:@MSB_NODE_ARG@:${MSB_NODE_ARG}:g' ${WORKDIR}/microservicebus-node.service
sed -i -e 's:@MSB_NODE_WORK_DIR@:${MSB_NODE_WORK_DIR}:g' ${WORKDIR}/microservicebus-node.service
sed -i -e 's:@MSB_NODE_USER@:${MSB_NODE_USER}:g' ${WORKDIR}/microservicebus-node.service
sed -i -e 's:@MSB_NODE_GROUP@:${MSB_NODE_GROUP}:g' ${WORKDIR}/microservicebus-node.service
sed -i -e 's:@MSB_NODE_HOST@:${MSB_NODE_HOST}:g' ${WORKDIR}/microservicebus-node.service
sed -i -e 's:@MSB_DAM_SOCKETPATH@:${MSB_DAM_SOCKETPATH}:g' ${WORKDIR}/microservicebus-node.service
#Install service file
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/microservicebus-node.service ${D}${systemd_system_unitdir}
#Install dbus busconfig file
install -d ${D}${datadir}/dbus-1/system.d
install -m 0644 ${WORKDIR}/com.microservicebus.core.conf ${D}${datadir}/dbus-1/system.d/com.microservicebus.core.conf
}
REQUIRED_DISTRO_FEATURES= "systemd"