x11vnc fails to listen to 5900/tcp after listening to 5900/tcp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
New
|
Undecided
|
Unassigned |
Bug Description
I have Raspbian Jessie running on a number of raspberry pi's for use as infoscreens. On these, I use x11vnc with noVNC to allow people on campus to view infoscreens elsewhere. Now, upgrading to Stretch, things work well, apart from the VNC things.
x11vnc is started as the pi user with this line
x11vnc -noipv4 -6 -viewonly -shared -forever -loop -localhost -nopw -display :0 -logappend $LOGFILE &
This works well on jessie, but on stretch, it seems it's trying to listen to 5900, succeeding, and then trying to listen to the same port, obviously failing. I've tried to configure my way around it, but I really can't understand what's going on.
Someone please give me a hand…
strace output below.
roy
2331 bind(9, {sa_family=
2331 listen(9, 32) = 0
2331 stat64(
2331 write(2, "12/03/2018 19:29:32 ", 20) = 20
2331 write(2, "Listening for VNC connections on"..., 48) = 48
2331 rt_sigaction(
2331 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 10
2331 setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
2331 setsockopt(10, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
2331 bind(10, {sa_family=
Tested on debian jessie on x64 - same thing, so this isn't raspbian specific. Now, starting it with the following options actually work.
x11vnc -noipv4 -6 -rfbportv6 5901 -httpportv6 5902 -viewonly -shared -forever -loop -nopw -display :0 -logappend $LOGFILE
Not sure if I need -httpportv6 there, apparently it's not in use, but still. According to the strace below, it correctly binds to 5901/tcp on IPv6, and then reporting
1398 write(2, "Listening for VNC connections on"..., 48) = 48
Then, later, it binds to 5900, also IPv6 like before, but reports
1398 write(2, "Listening only on IPv6 port 5900"..., 45) = 45
See below for details.
1398 socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP) = 9 AF_INET6, sin6_port= htons(5901) , inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo= htonl(0) , sin6_scope_id=0}, 28) = 0 "/etc/localtime ", {st_mode= S_IFREG| 0644, st_size=2251, ...}) = 0 SIGPIPE, {sa_handler= SIG_IGN, sa_mask=[PIPE], sa_flags= SA_RESTORER| SA_RESTART, sa_restorer= 0x768926b0} , {sa_handler= SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 AF_INET6, sin6_port= htons(5900) , inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo= htonl(0) , sin6_scope_id=0}, 28) = 0 "/etc/localtime ", {st_mode= S_IFREG| 0644, st_size=2251, ...}) = 0 PROT_WRITE, MAP_PRIVATE| MAP_ANONYMOUS, -1, 0) = 0x7601e000 POLLIN| POLLOUT} ], 1, -1) = 1 ([{fd=3, revents=POLLOUT}]) "b\1\4\ 0\10\0\ 0\0", iov_len=8}, {iov_base= "XINERAMA" , iov_len=8}, {iov_base="", iov_len=0}], 3) = 16
1398 setsockopt(9, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
1398 setsockopt(9, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
1398 bind(9, {sa_family=
1398 listen(9, 32) = 0
1398 stat64(
1398 write(2, "13/03/2018 18:00:55 ", 20) = 20
1398 write(2, "Listening for VNC connections on"..., 48) = 48
1398 rt_sigaction(
1398 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 10
1398 setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
1398 setsockopt(10, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
1398 bind(10, {sa_family=
1398 listen(10, 32) = 0
1398 stat64(
1398 write(2, "13/03/2018 18:00:55 ", 20) = 20
1398 write(2, "Listening only on IPv6 port 5900"..., 45) = 45
1398 mmap2(NULL, 1060864, PROT_READ|
1398 poll([{fd=3, events=
1398 writev(3, [{iov_base=