LoginSignup
0
1

More than 1 year has passed since last update.

stunnel 用のsystemdスクリプト作成

Last updated at Posted at 2019-08-22

概要

SSLトンネリング用のOSSであるstunnelですが、systemd用のスクリプトがなく、systemctlコマンドで起動や停止ができないのが玉に瑕です。Gitにあった先人の知恵を借りて作成しました。

できること

・stunnelをsystemctlコマンドから制御可能

前提

・OSはCentOS7を使用
・Stunnelの初期設定が完了していること
 【参考】RedHat "4.8. STUNNEL の使用"

作業内容

--スクリプト導入--
# vim /usr/lib/systemd/system/stunnel.service
# ln -s  /usr/lib/systemd/system/stunnel.service  /etc/systemd/system/multi-user.target.wants/stunnel.service 

--動作確認--
# systemctl restart stunnel
# systemctl status stunnel
# ps -eaf|grep stunnel

systemdスクリプト

stunnel.service

[Unit]
Description=SSL tunnel daemons
After=syslog.target
After=network.target

[Install]
WantedBy=multi-user.target

[Service]
Type=forking
ExecStart=/bin/stunnel /etc/stunnel/stunnel.conf
ExecStop=/bin/pkill -e stunnel
Restart=always
PrivateTmp=false

以上。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1