Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp989255ybi; Fri, 31 May 2019 11:55:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkCXKdfQ48/6X+XAWEWks7/I0LLT1rYCUPI/7fQCY/8X5WtNUx59ODmaVNTJpP7XZjp27W X-Received: by 2002:a17:90a:ae02:: with SMTP id t2mr11369057pjq.41.1559328927357; Fri, 31 May 2019 11:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559328927; cv=none; d=google.com; s=arc-20160816; b=gFwoYvIZIWm7JZ7KCEU93OhXrkqjOZ+nGDpeimYpB22I2Unn2ElVv2aT9Xnag0s2A9 2jNiorxxsRaHltQCPhpXYjI4yCeZHjCNRnr8rZWVkwEy0deg3xKTVucm84H7Pbwi1hvm zSgQwdAaJBKGagWZ0yKWzhhJIUIds3H0vtpL1owhpyffzR2jZNYe2RK7to/RGKLgjsVT xjoBSAUJrlQ/LdAKdU9WRkJA/NhKS30xTcCiVFJKGzYXU9CB8+IjBNZXF4b/vQfB09fM A0tz+7xVZxk8tbKWMVzD4QVtiTQC9S8PJSAHyi/F45pgyx9MO6vH5FUGZidWUMWMoaEI 0WBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GmNHkbJ4k0PtnTn6NCZzxKrUgP399yal/jj28Iuybr8=; b=NbQIkM7w3EXpni25PbHFDxmzhP9p0MTsgzIDnw4Nf7wbS9qE69DEY/4mdmHabFvORI H+kEBLzcLpGvhgUBXXW51Vd/mRsHojfkIq0BXksJGBHOYSq8Pm0+vqtvTI5Q1Qx8ajsW Wbh+mDIKS8RbsPSl0ESdR6KP/VUU6h8bZCdM4vONkpY+q6KwI8pvG2sUQS8WCNiBrA5n 34/tc2bXMKpS9FB3Kar516mqRl1EYP3Og4/zGds6iGVoGHI5S0A+MU4/Te3wcHxP/yAo fA6RyfNmEWvFj9LB/aLyhlrEVf5DWsiYdfqcPfO0ls8ulFYXpomsoYvpawCJWcJJN6CN 4FFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j184si8066734pfb.88.2019.05.31.11.54.56; Fri, 31 May 2019 11:55:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727137AbfEaSyw (ORCPT + 99 others); Fri, 31 May 2019 14:54:52 -0400 Received: from mga17.intel.com ([192.55.52.151]:38242 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726640AbfEaSyw (ORCPT ); Fri, 31 May 2019 14:54:52 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2019 11:54:52 -0700 X-ExtLoop1: 1 Received: from ingas-nuc1.sea.intel.com ([10.252.132.160]) by fmsmga005.fm.intel.com with ESMTP; 31 May 2019 11:54:51 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, johan.hedberg@gmail.com, luiz.dentz@gmail.com, Inga Stotland Subject: [PATCH BlueZ 1/2 v2] build: Add support for systemd bluetooth-mesh service Date: Fri, 31 May 2019 11:54:48 -0700 Message-Id: <20190531185449.9133-2-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190531185449.9133-1-inga.stotland@intel.com> References: <20190531185449.9133-1-inga.stotland@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This adds support for installing systemd bluetooth-mesh service unit and dbus service file that references this systemd unit. --- Makefile.am | 2 +- Makefile.mesh | 14 ++++++++++++-- mesh/bluetooth-mesh.service.in | 12 ++++++++++++ mesh/org.bluez.mesh.service | 5 +++++ 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 mesh/bluetooth-mesh.service.in create mode 100644 mesh/org.bluez.mesh.service diff --git a/Makefile.am b/Makefile.am index f84a1faba..3f398dc5a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -560,7 +560,7 @@ SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ $(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \ < $< > $@ -%.service: %.service.in Makefile +%.service: %.service.in Makefile Makefile.mesh $(SED_PROCESS) %.1: %.txt diff --git a/Makefile.mesh b/Makefile.mesh index d494287ab..9cd6e73d6 100644 --- a/Makefile.mesh +++ b/Makefile.mesh @@ -4,6 +4,11 @@ if DATAFILES dbus_DATA += mesh/bluetooth-mesh.conf endif +if SYSTEMD +systemdsystemunit_DATA += mesh/bluetooth-mesh.service +dbussystembus_DATA += mesh/org.bluez.mesh.service +endif + mesh_sources = mesh/mesh.h mesh/mesh.c \ mesh/net-keys.h mesh/net-keys.c \ mesh/mesh-io.h mesh/mesh-io.c \ @@ -32,7 +37,12 @@ libexec_PROGRAMS += mesh/bluetooth-meshd mesh_bluetooth_meshd_SOURCES = $(mesh_sources) mesh/main.c mesh_bluetooth_meshd_LDADD = src/libshared-ell.la $(ell_ldadd) -ljson-c -mesh_bluetooth_meshd_DEPENDENCIES = $(ell_dependencies) src/libshared-ell.la +mesh_bluetooth_meshd_DEPENDENCIES = $(ell_dependencies) src/libshared-ell.la \ + mesh/bluetooth-mesh.service + +EXTRA_DIST += mesh/bluetooth-mesh.conf mesh/bluetooth-mesh.service.in \ + mesh/org.bluez.mesh.service + +CLEANFILES += mesh/bluetooth-mesh.service -EXTRA_DIST += mesh/bluetooth-mesh.conf endif diff --git a/mesh/bluetooth-mesh.service.in b/mesh/bluetooth-mesh.service.in new file mode 100644 index 000000000..36f2a1d4a --- /dev/null +++ b/mesh/bluetooth-mesh.service.in @@ -0,0 +1,12 @@ +[Unit] +Description=Bluetooth mesh service +ConditionPathIsDirectory=/sys/class/bluetooth + +[Service] +Type=dbus +BusName=org.bluez.mesh +ExecStart=@pkglibexecdir@/bluetooth-meshd +NotifyAccess=main +LimitNPROC=1 +ProtectHome=true +ProtectSystem=full diff --git a/mesh/org.bluez.mesh.service b/mesh/org.bluez.mesh.service new file mode 100644 index 000000000..a61c44455 --- /dev/null +++ b/mesh/org.bluez.mesh.service @@ -0,0 +1,5 @@ +[D-BUS Service] +Name=org.bluez.mesh +Exec=/bin/false +User=root +SystemdService=dbus-org.bluez.mesh.service -- 2.21.0