Sanitize how we handle the --ssh option in the api docker container.
authorWard Vandewege <ward@curoverse.com>
Thu, 10 Jul 2014 15:17:08 +0000 (11:17 -0400)
committerWard Vandewege <ward@curoverse.com>
Thu, 10 Jul 2014 15:17:08 +0000 (11:17 -0400)
refs #3219

docker/api/Dockerfile
docker/api/apache2_foreground.sh
docker/api/ssh.sh [new file with mode: 0755]
docker/api/supervisor.conf

index 4d10aaad21654fa45eceee016384c474196c1eb9..99a0b4c527a9363abd645f33b4e0448f51ecff82 100644 (file)
@@ -49,6 +49,7 @@ RUN a2dissite default && \
 
 # Supervisor.
 ADD supervisor.conf /etc/supervisor/conf.d/arvados.conf
+ADD ssh.sh /usr/local/bin/ssh.sh
 ADD apache2_foreground.sh /etc/apache2/foreground.sh
 
 # Start the supervisor.
index c3facfe6f246578db9825ee46f697e1a583ba291..fc6028ea8391b3445e13adc5de4439fe7207ec2d 100755 (executable)
@@ -3,10 +3,5 @@
 read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat
 trap "kill -TERM -$pgrp; exit" EXIT TERM KILL SIGKILL SIGTERM SIGQUIT
 
-# Start ssh daemon if requested via the ENABLE_SSH env variable
-if [[ ! "$ENABLE_SSH" =~ (0|false|no|f|^$) ]]; then
-  /etc/init.d/ssh start
-fi
-
 source /etc/apache2/envvars
 /usr/sbin/apache2 -D FOREGROUND
diff --git a/docker/api/ssh.sh b/docker/api/ssh.sh
new file mode 100755 (executable)
index 0000000..664414b
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+echo $ENABLE_SSH
+
+# Start ssh daemon if requested via the ENABLE_SSH env variable
+if [[ ! "$ENABLE_SSH" =~ (0|false|no|f|^$) ]]; then
+echo "STARTING"
+  /etc/init.d/ssh start
+fi
+
index a9eed1ed6d6ff01df52bb332ad8e81e52dd1d8ce..a4f91296156590de77cb72a09f4b3c4de043bbd9 100644 (file)
@@ -1,3 +1,8 @@
+[program:ssh]
+user=root
+command=/usr/local/bin/ssh.sh
+startsecs=0
+
 [program:postgres]
 user=postgres
 command=/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf