[supervisord]
user=root
logfile=/var/log/supervisord.log
pidfile=/var/log/supervisord.pid
nodaemon=true

[program:dbus]
command=/usr/bin/dbus-daemon --system --nofork
autostart=true
autorestart=true
stderr_logfile=/var/log/dbus.err.log
stdout_logfile=/var/log/dbus.out.log

[program:agentscope_runtime]
command=/agentscope_runtime/scripts/start.sh
autostart=true
autorestart=true
priority=30
stderr_logfile=/var/log/agentscope_runtime.err.log
stdout_logfile=/var/log/agentscope_runtime.out.log
environment=DISPLAY=":1"

[program:nginx]
command=/usr/sbin/nginx -g 'daemon off;'
autostart=true
autorestart=true
stderr_logfile=/var/log/nginx.err.log
stdout_logfile=/var/log/nginx.out.log

[program:xvfb]
command=/usr/bin/Xvfb :1 -screen 0 1280x800x24
autostart=true
autorestart=true
priority=10
stderr_logfile=/var/log/xvfb.err.log
stdout_logfile=/var/log/xvfb.out.log
environment=DISPLAY=":1"

[program:xfce4]
command=/bin/sh -c "export DISPLAY=:1 && sleep 2 && export $(dbus-launch) && dbus-run-session startxfce4"
autostart=true
autorestart=true
priority=20
stderr_logfile=/var/log/xfce4.err.log
stdout_logfile=/var/log/xfce4.out.log
environment=DISPLAY=":1"

[program:x11vnc]
command=/bin/sh -c "export DISPLAY=:1 && sleep 3 && x11vnc -display :1 -forever -shared -passwd $SECRET_TOKEN -rfbport 5901"
autostart=true
autorestart=true
priority=30
stderr_logfile=/var/log/x11vnc.err.log
stdout_logfile=/var/log/x11vnc.out.log
environment=DISPLAY=":1"

[program:novnc]
command=/bin/bash -c "websockify --web=/usr/share/novnc/ 9000 localhost:5901"
directory=/usr/share/novnc
autostart=true
autorestart=true
priority=40
stderr_logfile=/var/log/novnc.err.log
stdout_logfile=/var/log/novnc.out.log
