Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/docker-engine: add sysv init script
Date: Wed, 30 Jan 2019 23:28:09 +0100	[thread overview]
Message-ID: <20190130222810.3927-1-peter@korsgaard.com> (raw)

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/docker-engine/S60dockerd       | 38 ++++++++++++++++++++++++++++++++++
 package/docker-engine/docker-engine.mk |  5 +++++
 2 files changed, 43 insertions(+)
 create mode 100755 package/docker-engine/S60dockerd

diff --git a/package/docker-engine/S60dockerd b/package/docker-engine/S60dockerd
new file mode 100755
index 0000000000..def8bea149
--- /dev/null
+++ b/package/docker-engine/S60dockerd
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+NAME=dockerd
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/$NAME.pid
+DAEMON_ARGS=""
+
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME $1
+
+do_start() {
+        echo -n "Starting $NAME: "
+        start-stop-daemon --start --quiet --background --make-pidfile \
+		--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \
+                && echo "OK" || echo "FAIL"
+}
+
+do_stop() {
+        echo -n "Stopping $NAME: "
+        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+                && echo "OK" || echo "FAIL"
+}
+
+case "$1" in
+        start)
+                do_start
+                ;;
+        stop)
+                do_stop
+                ;;
+        restart)
+                do_stop
+                sleep 1
+                do_start
+                ;;
+	*)
+                echo "Usage: $0 {start|stop|restart}"
+                exit 1
+esac
diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
index f19c1d995c..aae44ab6df 100644
--- a/package/docker-engine/docker-engine.mk
+++ b/package/docker-engine/docker-engine.mk
@@ -73,6 +73,11 @@ define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/docker.service
 endef
 
+define DOCKER_ENGINE_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 package/docker-engine/S60dockerd \
+		$(TARGET_DIR)/etc/init.d/S60dockerd
+endef
+
 define DOCKER_ENGINE_USERS
 	- - docker -1 * - - - Docker Application Container Framework
 endef
-- 
2.11.0

             reply	other threads:[~2019-01-30 22:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 22:28 Peter Korsgaard [this message]
2019-01-31  3:11 ` [Buildroot] [PATCH] package/docker-engine: add sysv init script Christian Stewart
2019-01-31  7:32   ` Peter Korsgaard

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=20190130222810.3927-1-peter@korsgaard.com \
    --to=peter@korsgaard.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox