From patchwork Mon May 27 09:16:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Dawson X-Patchwork-Id: 246549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 3EA192C0079 for ; Mon, 27 May 2013 19:17:06 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9524FA01AF; Mon, 27 May 2013 09:17:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nee9z7FH5rg9; Mon, 27 May 2013 09:17:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 16CFFA0134; Mon, 27 May 2013 09:17:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D72378F7A4 for ; Mon, 27 May 2013 09:17:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4A2A58D084 for ; Mon, 27 May 2013 09:17:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nGq8pbCB8rRz for ; Mon, 27 May 2013 09:17:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by whitealder.osuosl.org (Postfix) with ESMTPS id A21E58D076 for ; Mon, 27 May 2013 09:16:59 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id hr14so1378772wib.16 for ; Mon, 27 May 2013 02:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=P4gIXXWutGdjx9s4262rs+c9nmZVbH664t2FRyE6geQ=; b=YNJCh52HbynCJHexlkyROKEMJ+hNoe2hdOpkxPytrcl9twTzjXy55kbdJ42+fnqM2s qq1N9vKfHEGkC/J4hedw3wP1nWkM/MsgtageNo27q2fwZhxkwhzgMQG00NjMw+QE0y7Z Vrkd+HgyM0kb01cK4g3g069w7TfmbO0w0PWyKhRY62MC/rEn28pVmWJrS4miIDqe0jjg Qt8/LCi+KIxc2JxPBgnHNYgJV/GAnG0wOYedr8tmgVpGePBFu5rUL/47JWH8YoiRq9WX YS5GrqjfWSRtKJZO/JDwSkgvD6Ct5ppHonk8vlIpxuhOO+Q9Qz6jc17nxvKxE4yDso1o Z67g== X-Received: by 10.180.184.112 with SMTP id et16mr7602142wic.58.1369646218445; Mon, 27 May 2013 02:16:58 -0700 (PDT) Received: from percy.lan (host-84-13-101-122.opaltelecom.net. [84.13.101.122]) by mx.google.com with ESMTPSA id fu14sm15918979wic.8.2013.05.27.02.16.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 02:16:57 -0700 (PDT) From: spdawson@gmail.com To: buildroot@busybox.net Date: Mon, 27 May 2013 10:16:55 +0100 Message-Id: <1369646215-16116-1-git-send-email-spdawson@gmail.com> X-Mailer: git-send-email 1.8.1.2 Subject: [Buildroot] [PATCH] neard: add init script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Simon Dawson Signed-off-by: Simon Dawson --- package/neard/S53neard | 33 +++++++++++++++++++++++++++++++++ package/neard/neard.mk | 9 +++++++++ 2 files changed, 42 insertions(+) create mode 100755 package/neard/S53neard diff --git a/package/neard/S53neard b/package/neard/S53neard new file mode 100755 index 0000000..0a75941 --- /dev/null +++ b/package/neard/S53neard @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Starts neard +# + +NAME=neard +DAEMON=/usr/libexec/nfc/$NAME + +# Exit gracefully if the package has been removed +[ -x $DAEMON ] || exit 0 + +case "$1" in + start) + echo -n "Starting $NAME: " + start-stop-daemon -S -q -p /var/run/${NAME}.pid -x $DAEMON -- -d '*' + echo "OK" + ;; + stop) + echo -n "Stopping $NAME: " + start-stop-daemon -K -q -p /var/run/${NAME}.pid + echo "OK" + ;; + restart|reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/package/neard/neard.mk b/package/neard/neard.mk index cc6aeac..57a434d 100644 --- a/package/neard/neard.mk +++ b/package/neard/neard.mk @@ -17,4 +17,13 @@ ifeq ($(BR2_PACKAGE_NEARD_TOOLS),y) NEARD_CONF_OPT += --enable-tools endif +define NEARD_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/neard/S53neard \ + $(TARGET_DIR)/etc/init.d/S53neard +endef + +define NEARD_UNINSTALL_INIT_SYSV + $(RM) $(TARGET_DIR)/etc/init.d/S53neard +endef + $(eval $(autotools-package))