+++ This bug was initially created as a clone of Bug #445053 +++ stunnel lacks a sysv initscript as well as user creation we've come to expect from system services. (see, e.g., dnsmasq)
*** Bug 455817 has been marked as a duplicate of this bug. ***
Created attachment 325164 [details] an initscript proposal (at least as a basis for one) I'm currently using this initscript on CentOS with stunnel chrooted in /var/run/stunnel/ (this affects the initscript, since stunnel creates it's pid file inside the chroot.
Thanks for the script. Fedora scripts should follow https://fedoraproject.org/wiki/Packaging/SysVInitScript ; I can do that easily enough. The package The principal issue is that there is no reasonable "default stunnel service". For example, a system HTTP server should listen on port 80, which also implies there should be only only one instance of the server. In the case of stunnel it is quite reasonable to provide many tunnels on a single system, and it is quite reasonable to run several instances of stunnel, each under its own user to make sure compromising one instance doesn't give access to private keys for other services. I think the most reasonable way to handle several instances of stunnel (namely, a way that avoids the risk of an overengineered, yet very inflexible "general solution") is to let the system administrator set up the instances manually, something similar to http://cvs.fedoraproject.org/viewvc/devel/clamav/clamd-README?revision=1.3&view=markup . If the system administrator is expected to set up instances manually, I'm not sure providing a single system-wide init script makes much sense; but perhaps we can provide a half-configured default setup that can be also used as a template for manually-created additional instances. (Such a setup should definitely use a separate user, not "root".)
I think it makes perfect sense to provide an stunnel initscript (perhaps not configured to start by default after installation), a working chroot configuration and a basic /etc/stunnel/stunnel.conf file. The default stunnel.conf could contain basic stuff like setuid = nobody, setgid = nobody, chroot, pid, logging setup and such, matching the layout of the package. The default conf, however, should not provide any actual tunnel configs (of course), but perhaps a few examples.
Exactly. Unfortunately, it doesn't look possible to have a /etc/stunnel/stunnel.conf.d (along the lines of what dnsmasq does), but even having a "null" default setup in there would save a lot of pain.
This message is a reminder that Fedora 9 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 9. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '9'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 9's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 9 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This message is a reminder that Fedora 11 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 11. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '11'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 11's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 11 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle. Changing version to '14'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
The Stunnel RPM should include a startup script at /etc/init.d/stunnel . The script included with stunnel-4.34.tar.gz seems to work fine, with a few minor modifications. Here's what I did: I am running stunnel-4.15-2.el5.1 on CentOS5. My experience should apply to Fedora as well. See the source for stunnel-4.34.tar.gz at http://www.stunnel.org/download/source.html . The source will build an example init script at /usr/local/share/doc/stunnel/examples/stunnel.init . I installed this to /etc/init.d/stunnel, set the 'DAEMON=' to point to /usr/sbin/stunnel , and modified the two following lines. # chkconfig: 2345 54 26 # description: stunnel This init script is very generic, and seems to work fine with different stunnel styles at /etc/stunnel/ .
This message is a notice that Fedora 14 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 14. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At this time, all open bugs with a Fedora 'version' of '14' have been closed as WONTFIX. (Please note: Our normal process is to give advanced warning of this occurring, but we forgot to do that. A thousand apologies.) Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, feel free to reopen this bug and simply change the 'version' to a later Fedora version. Bug Reporter: Thank you for reporting this issue and we are sorry that we were unable to fix it before Fedora 14 reached end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" (top right of this page) and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Can we reopen this? With Systemd now the standard in F17 and beyond, there's no reason that stunnel can't have a multi-instance systemd service configuration (like getty@.service).
The lack of automated init is annoying, I need stunnel to get postfix talking to smtps servers (that don't do tls) Proposed implementation: 1. rename /etc/stunnel to /etc/stunnel.d (for consistency) 2. add to preinstall /usr/sbin/groupadd -f -r stunnel || : /usr/bin/id stunnel >/dev/null 2>&1 || \ /usr/sbin/useradd -r -c 'Stunnel daemon' -s /sbin/nologin -d /var/run/stunnel -g stunnel stunnel || : (the homedir won't be used and is not created like for pulseaudio) 3. add a /usr/lib/systemd/system/stunnel@.service file containing [Unit] Description = stunnel (%i) instance After = syslog.target nss-lookup.target network.target # stunnel is commonly used by postfix # http://www.postfix.org/TLS_README.html#client_smtps Before = postfix.service [Service] Type = simple ExecStart = /usr/bin/stunnel /etc/stunnel.d/%i.conf User=stunnel Restart = on-failure PrivateTmp = true [Install] WantedBy=multi-user.target 4. Add an readme.fedora file in /etc/stunnel.d/ containing # This is an example file - do not modify it, create new foo.conf files in # /etc/stunnel.d/ and then use stunnel CApath = /etc/pki/ca-trust/extracted/pem CAfile = /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem foreground = yes syslog = yes pid = #Disable FIPS mode to allow non-approved protocols and algorithms fips = no #debug = 7 [smtp-tls-wrapper] accept = 127.0.0.1:11125 client = yes connect = smtp.example.com:smtps verify = 2 5. get upstream to fix foreground = yes syslog = yes so syslog is actually used in this mode
stunnel has been integrated with systemd, and the stunnel service file has been packaged in rawhide. If the issue persists, please reopen this bz.