操作步骤
运行环境: Centos7
安装stunnel
1
yum install stunnel
编写systemd配置文件,放到
/usr/lib/systemd/system
1 | [Unit] |
参数解释:
- Restart=always 只要不是通过
systemctl stop
来停止服务,任何情况下都必须要重启服务,默认值为no
- 启动stunnel
1
2systemctl daemon-reload
systemctl start stunnel
手动启动和停止stunnel的方法
启动stunnel
1 | stunnel /etc/stunnel/stunnel.conf |
停止stunnel
1 | kill `cat /var/run/stunnel.pid` |