Super Servers

Definition

  • Binds passive sockets on ports
  • Spawns active sockets upon connection and launches a given script or binary
  • STDIN and STDOUT are bound to the opened socket

Examples

  • inetd
  • xinetd
  • systemd

inetd example

 /etc/inetd.conf

telnet  stream  tcp6    nowait  root    /usr/sbin/telnetd

 

 /etc/services should contain

telnet          23/tcp

Systemd example

/etc/systemd/system/echo-server.socket

[Socket] ListenStream=8888

 

/etc/systemd/system/echo-server.service

 

[Service]
ExecStart=/home/kill/.rvm/bin/ruby-1.9.2-p290 /home/kill/bin/echo-server.rb
User=kill
StandardOutput=syslog
StandardError=syslog

 

External content

  • On-demand container activation: https://developer.atlassian.com/blog/2015/03/docker-systemd-socket-activation/ 
  • http://ku1ik.com/2012/01/21/systemd-socket-activation-and-ruby.html 
  • Inetd example: https://www.freebsd.org/doc/handbook/network-inetd.html
Made with Slides.com