[CentOS] Starting stunnel on boot with CentOS7

Wed Dec 23 15:23:08 UTC 2015
Leroy Tennison <leroy at datavoiceint.com>

Hmmm, you obviously know a lot more about systemd than I do, I'm going to have to look at what you posted more carefully.  Thanks.

----- Original Message -----
From: "James Hogarth" <james.hogarth at gmail.com>
To: "CentOS mailing list" <centos at centos.org>
Sent: Wednesday, December 23, 2015 4:08:31 AM
Subject: Re: [CentOS] Starting stunnel on boot with CentOS7

On 23 December 2015 at 05:38, Kahlil Hodgson <kahlil.hodgson at dealmax.com.au>
wrote:

> On my CenOS7 system with stunnel from base
>
>     stunnel-4.56-4.el7.x86_64
>
> there's a systemd service file
>
>     /etc/systemd/system/stunnel.service
>
> try
>
> sudo systemctl enable stunnel.service
>
>
>
Packaged unit files are in /usr/lib/systemd/system ... someone put that
there as a local configuration (rpm -qf /path/to/file to it to verify)

Of course this is what the OP should do too ...  a very simple unit file
that matches his needs...

cat > /etc/systemd/system/stunnel.service <<EOF
[Unit]
Description=My stunnel

[Service]
ExecStart=/usr/bin/stunnel /etc/stunnel/myconf.conf

[Install]
WantedBy=multi-user.target
EOF

In the config file set foreground to yes ....

For a more advanced setup use a template like:

cat > /etc/systemd/stunnel at .service <<<EOF
[Unit]
Description=Stunnel config for %i

[Service]
ExecStart=/usr/bin/stunnel /etc/stunnel/%i.conf

[Install]
WantedBy=multi-user.target
EOF

Don't forget to systemctl daemon-reload after adding one of these...

Using the template method you'd enable it with the name of the config file
of interest ... remember to have foreground=yes ...

Given the config /etc/stunnel/snowflake.conf ...

systemctl enable stunnel at snowflake.service

systemctl start stunnel at snowflake.service
_______________________________________________
CentOS mailing list
CentOS at centos.org
https://lists.centos.org/mailman/listinfo/centos

Confidentiality Notice | This email and any included attachments may be privileged, confidential and/or otherwise protected from disclosure.  Access to this email by anyone other than the intended recipient is unauthorized.  If you believe you have received this email in error, please contact the sender immediately and delete all copies.  If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.