From a9baeecfe8fad4df2bb3e33613db4abc07e49ea3 Mon Sep 17 00:00:00 2001 From: Tomohisa Kusano Date: Mon, 2 Feb 2015 11:56:40 -0800 Subject: [PATCH] use supervisor for crdonly --- Dockerfile | 3 ++- crdonly | 7 +++++-- supervisord-crdonly.conf | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 supervisord-crdonly.conf diff --git a/Dockerfile b/Dockerfile index e626110..4123652 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,7 @@ RUN dpkg -i /chrome.deb && dpkg -i /crd.deb && rm /chrome.deb /crd.deb RUN ln -s /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0 COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY supervisord-crdonly.conf /etc/supervisor/conf.d/supervisord-crdonly.conf RUN addgroup chrome-remote-desktop && useradd -m -G chrome-remote-desktop,pulse-access chrome ENV CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES 1024x768 @@ -47,5 +48,5 @@ VOLUME ["/home/chrome"] EXPOSE 5900 -CMD ["/usr/bin/supervisord"] +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] diff --git a/crdonly b/crdonly index c364cdd..2141d8c 100644 --- a/crdonly +++ b/crdonly @@ -1,4 +1,7 @@ #!/bin/bash cp /crd-session /home/chrome/.chrome-remote-desktop-session -sudo -u chrome pulseaudio --start -sudo -E -u chrome -H /usr/bin/python /opt/google/chrome-remote-desktop/chrome-remote-desktop --start --foreground --config=`ls /home/chrome/.config/chrome-remote-desktop/*.json | head -1` +ln -s /home/chrome/.config/chrome-remote-desktop/host#*.json /home/chrome/.config/chrome-remote-desktop/host##.json +/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord-crdonly.conf + +# g_host_hash = hashlib.md5(socket.gethostname()).hexdigest() +# options.config = os.path.join(CONFIG_DIR, "host#%s.json" % g_host_hash) \ No newline at end of file diff --git a/supervisord-crdonly.conf b/supervisord-crdonly.conf new file mode 100644 index 0000000..bc23187 --- /dev/null +++ b/supervisord-crdonly.conf @@ -0,0 +1,14 @@ +[supervisord] +nodaemon=true + +[program:pulseaudio] +command=/usr/bin/pulseaudio +autorestart=true +priority=100 + +[program:crd] +environment=HOME="/home/chrome",USER="chrome",CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES="1024x768" +command=/usr/bin/python /opt/google/chrome-remote-desktop/chrome-remote-desktop --start --foreground --config=/home/chrome/.config/chrome-remote-desktop/host##.json +user=chrome +autorestart=true +priority=200