1
0
mirror of https://github.com/peterbourgon/runsvinit.git synced 2026-03-05 22:07:22 +01:00

Break out example and rename

This commit is contained in:
Peter Bourgon
2015-09-25 14:40:31 +02:00
parent 4e6968fe8f
commit 18a82bd528
7 changed files with 5 additions and 20 deletions

14
example/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM alpine:latest
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/testing" >>/etc/apk/repositories && apk add --update runit && rm -rf /var/cache/apk/*
ADD runsvinit /
ADD foo /
RUN mkdir -p /etc/service/foo
ADD run-foo /etc/service/foo/run
ADD bar /
RUN mkdir -p /etc/service/bar
ADD run-bar /etc/service/bar/run
ENTRYPOINT ["/runsvinit"]

15
example/bar Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
handle() {
echo "got signal"
exit
}
trap handle SIGINT
while true
do
echo bar: `date`
sleep 1
done

17
example/foo Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
handle() {
echo "got signal"
exit
}
trap "handle" SIGINT
for i in `seq 1 5`
do
echo foo: $i
sleep 1
done
echo foo: terminating!

3
example/run-bar Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec /bar

3
example/run-foo Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec /foo