All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Liu <net147@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] acpid: add init.d script
Date: Sat, 11 Aug 2012 16:43:27 +1000	[thread overview]
Message-ID: <1344667407-28138-1-git-send-email-net147@gmail.com> (raw)

Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 package/acpid/S02acpid | 22 ++++++++++++++++++++++
 package/acpid/acpid.mk |  1 +
 2 files changed, 23 insertions(+)
 create mode 100755 package/acpid/S02acpid

diff --git a/package/acpid/S02acpid b/package/acpid/S02acpid
new file mode 100755
index 0000000..1f74896
--- /dev/null
+++ b/package/acpid/S02acpid
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+case "$1" in
+	start)
+		echo -n "Starting acpid: "
+		start-stop-daemon -S -q -m -b -p /var/run/acpid.pid --exec /usr/sbin/acpid -- -n
+		echo "done"
+		;;
+	stop)
+		echo -n "Stopping acpid: "
+		start-stop-daemon -K -q -p /var/run/acpid.pid
+		echo "done"
+		;;
+	restart)
+		"$0" stop
+		sleep 1
+		"$0" start
+		;;
+	*)
+		echo "usage: $0 {start|stop|restart}"
+		;;
+esac
diff --git a/package/acpid/acpid.mk b/package/acpid/acpid.mk
index cacfb27..45cd8cf 100644
--- a/package/acpid/acpid.mk
+++ b/package/acpid/acpid.mk
@@ -18,6 +18,7 @@ define ACPID_INSTALL_TARGET_CMDS
 	install -D -m 644 $(@D)/acpi_listen.8 $(TARGET_DIR)/usr/share/man/man8/acpi_listen.8
 	mkdir -p $(TARGET_DIR)/etc/acpi/events
 	/bin/echo -e "event=button[ /]power\naction=/sbin/poweroff" > $(TARGET_DIR)/etc/acpi/events/powerbtn
+	install -D -m 755 package/acpid/S02acpid $(TARGET_DIR)/etc/init.d/S02acpid
 endef
 
 define ACPID_UNINSTALL_TARGET_CMDS
-- 
1.7.11.3

             reply	other threads:[~2012-08-11  6:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-11  6:43 Jonathan Liu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-08-11  7:16 [Buildroot] [PATCH v2] acpid: add init.d script Jonathan Liu
2012-08-11  7:16 ` [Buildroot] [PATCH] " Jonathan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344667407-28138-1-git-send-email-net147@gmail.com \
    --to=net147@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.