1

I am new to xinetd, but trying to mimic an old machine on site that is using it. So I copied the configs on that machine (changing names where appropriate) and then tried to start xinetd. Then realizd, it is not installed on my fresh centos7 install. So I yum installed. Then systemctl enable xinetd then I did a systemctl start xinetd and then a systtem status xinetd which is what makes my brain hurt, it shows it is removing my service (kcamera) but I have no idea why or why. Then a sudo lsof -i -P -n | grep LISTEN shows no xinetd running at all.

Curious what I am missing. (I haven't touched the firewall if that makes a difference).

[root@dhcp-093 etc]# systemctl status xinetd
● xinetd.service - Xinetd A Powerful Replacement For Inetd
   Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-02-15 15:19:37 EST; 45min ago
  Process: 12125 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 12126 (xinetd)
   CGroup: /system.slice/xinetd.service
           └─12126 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid

Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: removing discard
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: removing discard
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: removing echo
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: removing echo
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: removing kcamera
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: removing tcpmux
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: removing time
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: removing time
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: xinetd Version 2.3.15 started with libwrap loadavg labeled-networking options compiled in.
Feb 15 15:19:37 dhcp-093.apo.nmsu.edu xinetd[12126]: Started working: 0 available services

I had possibly wrongly assumed that just adding my kcamera to /etc/xinetd.d was enough to get things rolling once xinetd started. Though a LS in that folder reveals a lot of files like tcpmux-server which is one of the ones above it said it was 'removing'.

not sure what else to try, look for, or configure.

xinetd.conf

#
# This is the master xinetd configuration file. Settings in the
# default section will be inherited by all service configurations
# unless explicitly overridden in the service configuration. See
# xinetd.conf in the man pages for a more detailed explanation of
# these attributes.

defaults
{
# The next two items are intended to be a quick access place to
# temporarily enable or disable services.
#
#       enabled         =
#       disabled        =
# Define general logging characteristics.
        log_type        = SYSLOG daemon info
        log_on_failure  = HOST
        log_on_success  = PID HOST DURATION EXIT

# Define access restriction defaults
#
#       no_access       =
#       only_from       =
#       max_load        = 0
        cps             = 50 10
        instances       = 50
        per_source      = 10

# Address and networking defaults
#
#       bind            =
#       mdns            = yes
        v6only          = no

# setup environmental attributes
# setup environmental attributes
#
#       passenv         =
        groups          = yes
        umask           = 002

# Generally, banners are not used. This sets up their global defaults
#
#       banner          =
#       banner_fail     =
#       banner_success  =
}

includedir /etc/xinetd.d

/etc/xinetd.d/kcamera

service kcamera
{
    disable     = no
    socket_type = stream
    protocol    = tcp
    wait        = no
    user        = arc
    group       = datawrite
    server      = /home/workers/kosmosICC/kcamera/kcamerad
    groups      = yes
    flags       = REUSE
    passenv     =
    umask       = 0002
    log_on_failure  += USERID
    log_on_success  += PID HOST EXIT
}

a line in /etc/services:

kcamera         30001/tcp   # kosmos camera
Codejoy
  • 67
  • 3
  • 13

1 Answers1

1

I don't see a port number defined in your xinetd service. How can it know which port to listen on without this? Add the correct port number back into the configuration.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • oh I have a /etc/services which I thought is where it is defined: kcamera 30001/tcp # kosmos camera – Codejoy Feb 15 '21 at 22:25
  • @Codejoy Hm, maybe you can omit the port number if the service is in /etc/services. I think the last time I did anything productive with xinetd, people were still worried about Y2K. This truly is an ancient way to serve services, and if you can, you ought to consider [starting it directly from systemd](https://access.redhat.com/solutions/1609583) instead. – Michael Hampton Feb 16 '21 at 22:01
  • I would have to agree, I do not want to do it this way but since I inherited this nightmare of a tech stack I thought maybe I should try to make it work like it did so larger even more ancient pieces of software wouldn't have to be updated. – Codejoy Feb 16 '21 at 22:07
  • Thank you for the link, I cannot log into it but it led me to start looking at how to convert. I didn't realize systemd could do something similar. This is a simple python script that runs forever looking at standard in, which when running under xinetd would see that standard in come in from a port 30001 telnet session (or from the network) – Codejoy Feb 18 '21 at 18:20
  • Ah, right, I forgot it requires a subscription. You can get in if you sign up for RHEL's free individual developer subscription. – Michael Hampton Feb 18 '21 at 18:26