telnet sessions ignore SIGPIPE due to systemd

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 7
  • telnet-server-0.17-59.el7.x86_64

Issue

Telnet sessions ignore SIGPIPE signals because systemd defaults to IgnoreSIGPIPE=yes

Resolution

Take the file /usr/lib/systemd/system/telnet@.service and copy it to /etc/systemd/system . Don't link it there. If it's already there as a link, remove the link first and then copy it there. This assures that the change will be preserved during upgrades.

Add

IgnoreSIGPIPE=no 

to [Service] section of the /etc/systemd/system/telnet@.service file:

[...]
[Service]
IgnoreSIGPIPE=no
ExecStart=-/usr/sbin/in.telnetd
StandardInput=socket
[...]

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.