use supervisor for crdonly

wiki
Tomohisa Kusano 9 years ago
parent eae8d5d71e
commit a9baeecfe8

@ -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"]

@ -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)

@ -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
Loading…
Cancel
Save