xinetd doesn't work

Hi,

I created my own vnc-service for xinetd (PC_A) and opens a custom vnc connention to my vnc-server (PC_B).
When I reboot PC_A an make a telnet from PC_B to PC_A nothing happens. When I restart xinetd on PC_A from PC_B with ssh (ssh root@PC_A /etc/init.d/xinetd restart) and try it again nothing happens.
When I use a browser to call up PC_A the following error message will appear:
Xlib: connection to “:0.0” refused by server
Xlib: No protocol specified
Error: Can’t open display: :0.0

But when I type “rcxinetd restart” on PC_A’s keyboard as root and telnet PC_A from PC_B or use a browser to call up PC_A everything works fine and a vnc-connention builds up.

So my question is:
why

Ofcourse xinetd must listen to the port after reboot, when you do not change the xinetd configuration a restart of xinetd is not needed.
You can check if someone (xinetd) is listening to the port you configured by using

# netstat -an | grep LISTEN | grep tcp
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:41223           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:32999           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:873             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49677           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
boven:~ #     

or (without the r option):

boven:~ # netstat -a | grep LISTEN | grep tcp
tcp        0      0 *:nfs                   *:*                     LISTEN
tcp        0      0 *:41223                 *:*                     LISTEN
tcp        0      0 *:32999                 *:*                     LISTEN
tcp        0      0 *:rsync                 *:*                     LISTEN
tcp        0      0 *:mysql                 *:*                     LISTEN
tcp        0      0 *:49677                 *:*                     LISTEN
tcp        0      0 *:sunrpc                *:*                     LISTEN
tcp        0      0 *:www-http              *:*                     LISTEN
tcp        0      0 *:ftp                   *:*                     LISTEN
tcp        0      0 *:ssh                   *:*                     LISTEN
tcp        0      0 *:ipp                   *:*                     LISTEN
tcp        0      0 localhost:smtp          *:*                     LISTEN
boven:~ #       

Only if the port is listened to, it is usefull to test it from another system.

Hi hcvv,

netstat tells, that xinetd is listening on the specific ports that I configured.

I started to log my custom services and that is the result:

08/11/18@14:01:37: START: vnc_start from=XXXX
08/11/18@14:01:37: USERID: vnc_start UNIX :wwwrun
08/11/18@14:01:37: EXIT: vnc_start status=1 duration=0(sec)
08/11/18@14:01:42: START: vnc_kill from=XXXX
08/11/18@14:01:42: USERID: vnc_kill UNIX :root
08/11/18@14:01:42: EXIT: vnc_kill status=1 duration=0(sec)

I do not know much (maybe even nothing) about VNC. But you were trying to guess if **xinetd **did what it should, by accessing from outside I tried to give you a method from inside the system to see if it LISTENs. So you can target the problem better.

BTW

Xlib: connection to “:0.0” refused by server
Xlib: No protocol specified
Error: Can’t open display: :0.0

points to the X-server blocking access to outsiders wanting to open a window. Either **xhost + ** (on the X-server) or more refined allowance using MitMagicCookies will probable solve this (see man xhost).

Hi,

xhost +

its a good idea. I try it tomorrow, thank you!!!

Hi hcvv,

xhost +

that was the right solution. Thank you!!!

Glad I could help you :slight_smile: