xpra icon
Bug tracker and wiki

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#1417 closed task (invalid)

choose display number automatically

Reported by: Jens H. Goebbert Owned by: Antoine Martin
Priority: minor Milestone:
Component: core Version: trunk
Keywords: DISPLAYID Cc:

Description

On multi-user systems is would help a lot, if Xpra could find a free display number automatically.

Recent X servers as of version 1.13 (Xvfb, too) support the -displayfd <fd> command line option: It will make the X server choose the display itself and write the display number back to the file descriptor <fd>.

exec 6>display.log
Xvfb -displayfd 6

Change History (6)

comment:1 Changed 3 years ago by Antoine Martin

Resolution: invalid
Status: newclosed

xpra has supported this feature for years, see #172

Just use:

xpra start

comment:2 Changed 3 years ago by Jens H. Goebbert

Thanks! - It seams, that I missed a great feature of Xpra.
Why should one ever wants to set the display id manually?
Shouldn't this be the default way to use Xpra?

Can Xpra report the display number to stdout, if it was automatically chosen?
(eg. "Actual display id is now: localhost:28")

How would you recommend to get the automatically chosen display number
if it is needed in a wrapper script? Is there any smarter way in Xpra than something like this:

xpra start --start-child=xterm 2>&1 > /dev/null | grep "Actual log file name is now" | sed 's#.*:##g' | sed 's#.log##g'

comment:3 Changed 3 years ago by Antoine Martin

Why should one ever wants to set the display id manually?


When starting xpra from external management scripts I guess.


Shouldn't this be the default way to use Xpra?


It is!


Can Xpra report the display number to stdout, if it was automatically chosen?


Do you mean like this: r14822?


How would you recommend to get the automatically chosen display number if it is needed in a wrapper script?
Is there any smarter way in Xpra than something like this: ...


I don't know, sorry.
Using grep and sed can be brittle.
I guess we could add our own "--displayfd" switch. This could be a bit tricky to implement since we normally daemonize and close all file descriptors before we know the display number.. (except stdout / stderr which are kept for the messages that you saw - that's already a special case)

comment:4 in reply to:  3 Changed 3 years ago by Jens H. Goebbert

Replying to Antoine Martin:

Shouldn't this be the default way to use Xpra?

It is!

Sorry ... www.xpra.org (Get started with Xpra) and the Wiki made me think, this not mend to be the default usage of Xpra. My fault.


Can Xpra report the display number to stdout, if it was automatically chosen?

Do you mean like this: r14822?

Yes ... great!!


How would you recommend to get the automatically chosen display number if it is needed in a wrapper script?
Is there any smarter way in Xpra than something like this: ...


I don't know, sorry.
Using grep and sed can be brittle.
I guess we could add our own "--displayfd" switch. This could be a bit tricky to implement since we normally daemonize and close all file descriptors before we know the display number.. (except stdout / stderr which are kept for the messages that you saw - that's already a special case)

Yes ... great!!

comment:5 Changed 3 years ago by Jens H. Goebbert

I tested r14822 and it is just doing, what I was looking for. Thanks.

Can you add this feature to the 1.0.x branch, too?

comment:6 Changed 3 years ago by Antoine Martin

It's been scheduled: wiki/Versions/PendingFixes

Note: See TracTickets for help on using tickets.