auto cleanup of session leftovers

wiki
Tomohisa Kusano 9 years ago
parent a9baeecfe8
commit f667ece360

@ -1,7 +1,19 @@
#!/bin/bash
# make sure to install a new version of ~/.chrome-remote-desktop-session
# where ~ is a volume
cp /crd-session /home/chrome/.chrome-remote-desktop-session
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)
# delete obsolete pulseaudio sockets if left from previous sessions
rm -rf /home/chrome/.config/chrome-remote-desktop/pulseaudio*
# only keep 1 host#*.json config file
# (default is to use md5 of hostname, which changes on every docker run)
if test -n "$(find /home/chrome/.config/chrome-remote-desktop -name 'host#*.json' -print -quit)"
then
mv `ls -t /home/chrome/.config/chrome-remote-desktop/host#*.json | head -n 1` /home/chrome/.config/chrome-remote-desktop/~host.json
rm /home/chrome/.config/chrome-remote-desktop/host#*.json
fi
# start supervisor to watch `chrome-remote-desktop` only
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord-crdonly.conf

@ -1,14 +1,9 @@
[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
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