diff --git a/android-sdk/supervisord.conf b/android-sdk/supervisord.conf index a38e55d..c2b559b 100644 --- a/android-sdk/supervisord.conf +++ b/android-sdk/supervisord.conf @@ -1,5 +1,8 @@ [supervisord] nodaemon = true +logfile=/var/log/supervisor/supervisord.log +pidfile=/var/run/supervisord.pid +childlogdir=/var/log/supervisor [include] files = /etc/supervisor/conf.d/*.conf @@ -10,6 +13,6 @@ stderr_logfile = /var/log/supervisord/sshd-stderr.log stdout_logfile = /var/log/supervisord/sshd-stdout.log [program:adb] -command = adb -a server nodaemon & +command = adb -a server nodaemon stderr_logfile = /var/log/supervisord/adb-stderr.log stdout_logfile = /var/log/supervisord/adb-stdout.log diff --git a/android-sdk/vnc/Dockerfile b/android-sdk/vnc/Dockerfile index 73131d0..b8d8f8e 100644 --- a/android-sdk/vnc/Dockerfile +++ b/android-sdk/vnc/Dockerfile @@ -15,13 +15,18 @@ ENV USER=root ENV DISPLAY=:1 EXPOSE 5901 ADD vncpass.sh /tmp/ +ADD vncserver_daemon.sh /usr/local/bin/ ADD watchdog.sh /usr/local/bin/ ADD supervisord_vncserver.conf /etc/supervisor/conf.d/ RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends xfce4 xfce4-goodies xfonts-base dbus-x11 tightvncserver expect && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends xfce4 xfce4-goodies xfonts-base dbus-x11 tightvncserver expect xauth && \ + touch /root/.Xauthority && chmod 600 /root/.Xauthority && \ + xauth generate :1 . trusted && \ + chmod +x /usr/local/bin/vncserver_daemon.sh && \ chmod +x /tmp/vncpass.sh; sync && \ /tmp/vncpass.sh && \ rm /tmp/vncpass.sh && \ apt-get remove -y expect && apt-get autoremove -y && \ FILE_SSH_ENV="/root/.ssh/environment" && \ echo "DISPLAY=:1" >> $FILE_SSH_ENV +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/android-sdk/vnc/supervisord_vncserver.conf b/android-sdk/vnc/supervisord_vncserver.conf index a7c58e8..4e98022 100644 --- a/android-sdk/vnc/supervisord_vncserver.conf +++ b/android-sdk/vnc/supervisord_vncserver.conf @@ -1,5 +1,15 @@ +[supervisord] +logfile=/var/log/supervisor/supervisord.log +pidfile=/var/run/supervisord.pid +user=root + [program:vncserver] -command = /usr/bin/vncserver +command = /usr/local/bin/vncserver_daemon.sh +user=root +autostart=true +autorestart=true +startsecs=5 +stopwaitsecs=5 stderr_logfile = /var/log/supervisord/vncserver-stderr.log stdout_logfile = /var/log/supervisord/vncserver-stdout.log