运行环境: Centos7
yum install stunnel
/usr/lib/systemd/system
[Unit]
Description=Stunnel Proxy Server
After=network.target
[Service]
Type=forking
User=root
ExecStart=/usr/bin/stunnel /etc/stunnel/stunnel.conf
Restart=always
[Install]
WantedBy=multi-user.target
参数解释:
systemctl stop
来停止服务,任何情况下都必须要重启服务,默认值为nosystemctl daemon-reload
systemctl start stunnel
启动
stunnel /etc/stunnel/stunnel.conf
停止
kill `cat /var/run/stunnel.pid`