Discussion:
[Supervisor-users] Unable to launch my programs. Error: Can't open display
Lennart Ramberg
2015-09-20 16:22:56 UTC
Permalink
Hello,

I'm new here and I ask for help, please.

I experiment with Buildroot with Supervisord.
I am unable to start applications like, say, xclock with supervisord.
For now, I think I can do without a window manager (like twm or Fluxbox).

I let supervisord launch X using startx, so in supervisord.conf
command=/usr/bin/startx

If my programs are in startx, they launch all right.
Also, with xterm in startx, I can launch my programs from there, say
xclock, with
DISPLAY=:0 xclock

But I want supervisord to handle my programs individually
so I tried, in supervisord.conf, (after startx) a bunch of variations of
command="DISPLAY=:0 xclock"
autostart=true
autorestart=true
giving error 'Can't find command' in /var/log/supervisor/supervisord.log

Just
command=xclock
autostart=true
autorestart=true
gives 'Error: Can't open display' in
/var/log/supervisor/xclock-stderr--....log

What should that
command=????
look like?

Thanks in advance
Lennart
Aryeh Leib Taurog
2015-09-20 16:44:33 UTC
Permalink
Try the following:

environment=DISPLAY=":0"
command=xclock
autostart=true
autorestart=true
Post by Lennart Ramberg
Hello,
I'm new here and I ask for help, please.
I experiment with Buildroot with Supervisord.
I am unable to start applications like, say, xclock with supervisord.
For now, I think I can do without a window manager (like twm or Fluxbox).
I let supervisord launch X using startx, so in supervisord.conf
command=/usr/bin/startx
If my programs are in startx, they launch all right.
Also, with xterm in startx, I can launch my programs from there, say
xclock, with
DISPLAY=:0 xclock
But I want supervisord to handle my programs individually
so I tried, in supervisord.conf, (after startx) a bunch of variations of
command="DISPLAY=:0 xclock"
autostart=true
autorestart=true
giving error 'Can't find command' in /var/log/supervisor/supervisord.log
Just
command=xclock
autostart=true
autorestart=true
gives 'Error: Can't open display' in
/var/log/supervisor/xclock-stderr--....log
What should that
command=????
look like?
Thanks in advance
Lennart
Lennart Ramberg
2015-09-21 06:58:42 UTC
Permalink
Thank you for your fast response.
Tankyouthankyou for the solution.
Regards
Lennart
Post by Aryeh Leib Taurog
environment=DISPLAY=":0"
command=xclock
autostart=true
autorestart=true
Post by Lennart Ramberg
Hello,
I'm new here and I ask for help, please.
I experiment with Buildroot with Supervisord.
I am unable to start applications like, say, xclock with supervisord.
For now, I think I can do without a window manager (like twm or Fluxbox).
I let supervisord launch X using startx, so in supervisord.conf
command=/usr/bin/startx
If my programs are in startx, they launch all right.
Also, with xterm in startx, I can launch my programs from there, say
xclock, with
DISPLAY=:0 xclock
But I want supervisord to handle my programs individually
so I tried, in supervisord.conf, (after startx) a bunch of variations of
command="DISPLAY=:0 xclock"
autostart=true
autorestart=true
giving error 'Can't find command' in /var/log/supervisor/supervisord.log
Just
command=xclock
autostart=true
autorestart=true
gives 'Error: Can't open display' in
/var/log/supervisor/xclock-stderr--....log
What should that
command=????
look like?
Thanks in advance
Lennart
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Timothy Jones
2015-09-21 16:26:31 UTC
Permalink
Three options:

1. You could set the DISPLAY variable before Supervisor is started.
2. You could add environment=DISPLAY=:0 is the global section, and then supervisor add that to its own environment before forking the child processes.
3. You could add environment=DISPLAY=:0 in the [program:xxx] stanzas, where it affects only those program that need it.

Then your command= lines need only invoke xclock directly, because the DISPLAY environment variable would already be set.


Hope it helps, t

From: <supervisor-users-***@lists.supervisord.org<mailto:supervisor-users-***@lists.supervisord.org>> on behalf of Lennart Ramberg <***@gmail.com<mailto:***@gmail.com>>
Date: Sunday, September 20, 2015 at 12:22 PM
To: "supervisor-***@lists.supervisord.org<mailto:supervisor-***@lists.supervisord.org>" <supervisor-***@lists.supervisord.org<mailto:supervisor-***@lists.supervisord.org>>
Subject: [Supervisor-users] Unable to launch my programs. Error: Can't open display

Hello,

I'm new here and I ask for help, please.

I experiment with Buildroot with Supervisord.
I am unable to start applications like, say, xclock with supervisord.
For now, I think I can do without a window manager (like twm or Fluxbox).

I let supervisord launch X using startx, so in supervisord.conf
command=/usr/bin/startx

If my programs are in startx, they launch all right.
Also, with xterm in startx, I can launch my programs from there, say xclock, with
DISPLAY=:0 xclock

But I want supervisord to handle my programs individually
so I tried, in supervisord.conf, (after startx) a bunch of variations of
command="DISPLAY=:0 xclock"
autostart=true
autorestart=true
giving error 'Can't find command' in /var/log/supervisor/supervisord.log

Just
command=xclock
autostart=true
autorestart=true
gives 'Error: Can't open display' in /var/log/supervisor/xclock-stderr--....log

What should that
command=????
look like?

Thanks in advance
Lennart
Lennart Ramberg
2015-09-21 19:12:52 UTC
Permalink
Thanks.
/Lennart
1. You could set the DISPLAY variable before Supervisor is started.
2. You could add environment=DISPLAY=:0 is the global section, and
then supervisor add that to its own environment before forking the child
processes.
3. You could add environment=DISPLAY=:0 in the [program:xxx] stanzas,
where it affects only those program that need it.
Then your command= lines need only invoke xclock directly, because the
DISPLAY environment variable would already be set.
Hope it helps, t
Date: Sunday, September 20, 2015 at 12:22 PM
Subject: [Supervisor-users] Unable to launch my programs. Error: Can't open display
Hello,
I'm new here and I ask for help, please.
I experiment with Buildroot with Supervisord.
I am unable to start applications like, say, xclock with supervisord.
For now, I think I can do without a window manager (like twm or Fluxbox).
I let supervisord launch X using startx, so in supervisord.conf
command=/usr/bin/startx
If my programs are in startx, they launch all right.
Also, with xterm in startx, I can launch my programs from there, say xclock, with
DISPLAY=:0 xclock
But I want supervisord to handle my programs individually
so I tried, in supervisord.conf, (after startx) a bunch of variations of
command="DISPLAY=:0 xclock"
autostart=true
autorestart=true
giving error 'Can't find command' in /var/log/supervisor/supervisord.log
Just
command=xclock
autostart=true
autorestart=true
gives 'Error: Can't open display' in
/var/log/supervisor/xclock-stderr--....log
What should that
command=????
look like?
Thanks in advance
Lennart
Loading...