Sei sulla pagina 1di 3

13/2/2019 How to convert xinetd service to systemd ?

P O R TA L (https://access.redhat.com/)
CLIENTE

3 For more information on the runc vulnerability (CVE-2019-5736), please refer to this Vulnerability Page

(https://access.redhat.com/security/vulnerabilities/runcescape).

How to convert xinetd service to systemd ?


$ SOLUTION VERIFICADA - Actualizado 9 de Noviembre de 2015 a las 12:18 - English ()

Medio Ambiente
Red Hat Enterprise Linux 7

Cuestión
Need to convert xinetd to systemd unit file.

Resolución
If the xinetd service file looks like:

# cat /etc/xinetd.d/appld
service application
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /opt/appl/bin/appld
type = UNLISTED
port = 24146
protocol = tcp
disable = no
}

Then need to create two unit files like below :

# cd /etc/systemd/system

# cat application.socket

[Unit]
Description=Application Socket

[Socket]
ListenStream=24146
Accept=yes

[Install]
WantedBy=sockets.target

# cat application@.service

[Unit]
Description=Application Per-Connection Server

[Service]
ExecStart=/usr/bin/appld # the binary to start
User=root
Group=root
StandardInput=socket

https://access.redhat.com/solutions/1609583 1/3
13/2/2019 How to convert xinetd service to systemd ?
Enable, Start and check the status of the application socket.
P O R TA L (https://access.redhat.com/)
CLIENTE

# systemctl enable application.socket
# systemctl start application.socket
# systemctl status -l application.socket

To see which services are now active :

# systemctl --full | grep application

appld@172.31.0.52:24146-172.31.0.4:47779.service loaded active running App Per-Connection Server


appld@172.31.0.52:24146-172.31.0.54:52985.service loaded active running App Per-Connection Server
appld.socket loaded active listening App Socket for Per-Connection Servers

As expected, there are now two service instances running, for the two connections, and they are named after the source and
destination address of the TCP connection as well as the port numbers. (For AF_UNIX sockets the instance identifier will carry the
PID and UID of the connecting client.) This allows us to individually introspect or kill specific App instances.

To terminate the session of a specific client :

# systemctl kill appld@172.31.0.52:24146-172.31.0.4:47779.service

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have
created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be
presented in a raw and unedited form.

People who viewed this solution also viewed

How to prevent xinetd creating IPv6 sockets

Solution - 6 oct. 2014

Mislabeled chronyc socket

Solution - 23 jul. 2018

How to configure xinetd ?

Solution - 16 sept. 2014

1 Comentarios
29 April 2018 9:59 AM (https://access.redhat.com/solutions/1609583#comment-1299341)
MO Michael Orgill (/user/6903663)
(/user/6903663)
Why is moving from 6.5 to 7 causing so much of a problem. Everything that I have had running under Red Hat 6.5 has caused
COMMUNITY a nightmare to get to run under Red Hat 7.
MEMBER

https://access.redhat.com/solutions/1609583 2/3
13/2/2019 How to convert xinetd service to systemd ?
24 Points
P O R TA L (https://access.redhat.com/)
≤ Responder (/Ajax_comments/Reply/1609583/1299341)
CLIENTE

All systems operational (https://status.redhat.com)

Política de privacidad (http://www.redhat.com/en/about/privacy-policy)


Términos de uso del Portal del cliente (https://access.redhat.com/help/terms/)
Todas las políticas y lineamientos (http://www.redhat.com/en/about/all-policies-guidelines)
Derechos de autor © 2019 Red Hat, Inc.

https://access.redhat.com/solutions/1609583 3/3

Potrebbero piacerti anche