diff --git a/recipes-devtools/python/python3-labgrid.inc b/recipes-devtools/python/python3-labgrid.inc index 53020a4..6661432 100644 --- a/recipes-devtools/python/python3-labgrid.inc +++ b/recipes-devtools/python/python3-labgrid.inc @@ -3,6 +3,9 @@ HOMEPAGE = "https://github.com/labgrid-project" LICENSE = "LGPL-2.1-or-later" LIC_FILES_CHKSUM = "file://LICENSE;md5=c0e9407a08421b8c72f578433434f0bd" +PACKAGE_BEFORE_PN += "${PN}-coordinator" +RDEPENDS:${PN}-coordinator = "${PN}" + RDEPENDS:${PN} = " \ coreutils \ libgpiod \ @@ -29,6 +32,7 @@ RDEPENDS:${PN} = " \ SRC_URI = " \ file://configuration.yaml \ file://labgrid-exporter.service \ + file://labgrid-coordinator.service \ file://environment \ " @@ -40,6 +44,7 @@ DEPENDS += "python3-pytest-runner-native" inherit python_setuptools_build_meta systemd SYSTEMD_SERVICE:${PN} = "labgrid-exporter.service" +SYSTEMD_SERVICE:${PN}-coordinator = "labgrid-coordinator.service" do_install:append() { install -d ${D}${sysconfdir}/labgrid @@ -47,6 +52,8 @@ do_install:append() { install -m 0644 ${UNPACKDIR}/environment ${D}${sysconfdir}/labgrid install -d ${D}${systemd_system_unitdir} install -m 0644 ${UNPACKDIR}/labgrid-exporter.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${UNPACKDIR}/labgrid-coordinator.service ${D}${systemd_system_unitdir}/ } +FILES:${PN}-coordinator += "${systemd_system_unitdir}/labgrid-coordinator.service /usr/bin/labgrid-coordinator" FILES:${PN} += "${sysconfdir} ${systemd_system_unitdir}" diff --git a/recipes-devtools/python/python3-labgrid/environment b/recipes-devtools/python/python3-labgrid/environment index 0f67e67..39b5f91 100644 --- a/recipes-devtools/python/python3-labgrid/environment +++ b/recipes-devtools/python/python3-labgrid/environment @@ -3,3 +3,8 @@ LABGRID_COORDINATOR_IP=127.0.0.1 LABGRID_COORDINATOR_PORT=20408 + +### The coordinator service will listen to the following ip, if the service is also +### enabled. + +LABGRID_COORDINATOR_LISTEN_IP=0.0.0.0 diff --git a/recipes-devtools/python/python3-labgrid/labgrid-coordinator.service b/recipes-devtools/python/python3-labgrid/labgrid-coordinator.service new file mode 100644 index 0000000..d10c557 --- /dev/null +++ b/recipes-devtools/python/python3-labgrid/labgrid-coordinator.service @@ -0,0 +1,18 @@ +[Unit] +Description=Labgrid Coordinator +After=network.target + +[Service] +Environment="PYTHONUNBUFFERED=1" +Environment="LABGRID_COORDINATOR_LISTEN_IP=0.0.0.0" +Environment="LABGRID_COORDINATOR_PORT=20408" +EnvironmentFile=/etc/labgrid/environment +ExecStart=/usr/bin/labgrid-coordinator -l ${LABGRID_COORDINATOR_LISTEN_IP}:${LABGRID_COORDINATOR_PORT} +Restart=on-failure +DynamicUser=yes +StateDirectory=labgrid-coordinator +# Set WorkingDirectory to StateDirectory, this works in DynamicUser mode since symlinks are created +WorkingDirectory=%S/labgrid-coordinator + +[Install] +WantedBy=multi-user.target