Hi,

This patch allows stunnel to be started in daemon mode by systemd's socket activation. This is superior to inetd mode, for all the reasons specified in the stunnel howto. Since systemd is now the default in most of the major Linux distros, it would be great to have this committed upstream.

https://gist.github.com/marktheunissen/7ce9426e66aa8f0ec2e1

Example systemd unit files:

### stunnel.socket

[Unit]
Description=Stunnel socket
After=network.target

[Socket]
ListenStream=9999

### stunnel.service

[Unit]
Description=Stunnel service
After=network.target

[Service]
Type=forking
ExecStart=stunnel /etc/stunnel/stunnel.conf

Thanks,
Mark Theunissen