A simple socat daemon script for both sysvinit
and systemd
. Supports multiple socat commands and will automatically restart if some are killed for some reason. It is here for convenience in development. Should not be used in production especially with high concurrency.
/ └── etc ├── init.d │ └── socatd ├── socatd.conf └── systemd └── system └── socatd.service
Just place the directory structure into your system. Don't forget to make sure that the /etc/init.d/socatd file is executable:
chmod +x /etc/init.d/socatd
The configuration file is in /etc/socatd.conf. It should contain a list of the socat commands you need. Not familiar with socat? The following article is easy to follow https://www.redhat.com/sysadmin/getting-started-socat.
After everything is installed, please enable it with:
# systemctl enable socatd.service
Then:
# systemctl start socatd.service
to start.
# /etc/init.d/socatd start
$ cat /var/log/socatd.log