[ARVADOS] created: 1.1.2-43-gb60535f
Git user
git at public.curoverse.com
Tue Jan 9 15:42:12 EST 2018
at b60535ff2b3be175009cf0f324f6ac333f26fcc7 (commit)
commit b60535ff2b3be175009cf0f324f6ac333f26fcc7
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Tue Jan 9 15:39:21 2018 -0500
12940: Use runit directly instead of runsvinit
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/tools/arvbox/bin/arvbox b/tools/arvbox/bin/arvbox
index f4a65da..234d15a 100755
--- a/tools/arvbox/bin/arvbox
+++ b/tools/arvbox/bin/arvbox
@@ -220,8 +220,8 @@ run() {
"--volume=$PIPCACHE:/var/lib/pip:rw" \
"--volume=$NPMCACHE:/var/lib/npm:rw" \
"--volume=$GOSTUFF:/var/lib/gopath:rw" \
- arvados/arvbox-dev$TAG \
- /usr/local/bin/runsvinit -svdir=/etc/test-service
+ "--env=SVDIR=/etc/test-service" \
+ arvados/arvbox-dev$TAG
docker exec -ti \
$ARVBOX_CONTAINER \
diff --git a/tools/arvbox/lib/arvbox/docker/Dockerfile.base b/tools/arvbox/lib/arvbox/docker/Dockerfile.base
index f29066e..f667bc1 100644
--- a/tools/arvbox/lib/arvbox/docker/Dockerfile.base
+++ b/tools/arvbox/lib/arvbox/docker/Dockerfile.base
@@ -62,10 +62,6 @@ RUN mkdir -p /etc/apt/sources.list.d && \
RUN rm -rf /var/lib/postgresql && mkdir -p /var/lib/postgresql
-RUN cd /root && \
- GOPATH=$PWD go get github.com/curoverse/runsvinit && \
- install bin/runsvinit /usr/local/bin
-
ENV PJSVERSION=1.9.8
# bitbucket is the origin, but downloads fail sometimes, so use our own mirror instead.
#ENV PJSURL=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PJSVERSION}-linux-x86_64.tar.bz2
@@ -99,5 +95,9 @@ ADD crunch-setup.sh gitolite.rc \
RUN mkdir /etc/docker
ADD daemon.json /etc/docker/
+ADD runit /etc/runit
+
# Start the supervisor.
-CMD ["/usr/local/bin/runsvinit"]
+ENV SVDIR /etc/service
+STOPSIGNAL SIGINT
+CMD ["/sbin/runit"]
diff --git a/tools/arvbox/lib/arvbox/docker/runit/1 b/tools/arvbox/lib/arvbox/docker/runit/1
new file mode 100755
index 0000000..fea9cf6
--- /dev/null
+++ b/tools/arvbox/lib/arvbox/docker/runit/1
@@ -0,0 +1,7 @@
+#!/bin/sh
+# system one time tasks
+
+PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin
+
+touch /run/runit.stopit
+chmod 0 /run/runit.stopit
diff --git a/tools/arvbox/lib/arvbox/docker/runit/2 b/tools/arvbox/lib/arvbox/docker/runit/2
new file mode 100755
index 0000000..eae8c82
--- /dev/null
+++ b/tools/arvbox/lib/arvbox/docker/runit/2
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
+
+exec env - PATH=$PATH \
+runsvdir -P $SVDIR
diff --git a/tools/arvbox/lib/arvbox/docker/runit/3 b/tools/arvbox/lib/arvbox/docker/runit/3
new file mode 100755
index 0000000..525b96b
--- /dev/null
+++ b/tools/arvbox/lib/arvbox/docker/runit/3
@@ -0,0 +1,14 @@
+#!/bin/sh
+exec 2>&1
+
+PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin
+
+LAST=0
+test -x /run/runit.reboot && LAST=6
+
+echo 'Waiting for services to stop...'
+sv -w196 force-stop /service/*
+sv exit /service/*
+
+echo 'Shutdown...'
+/etc/init.d/rc $LAST
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list