#1031311 stunnel4: Starting with systemd does not create /var/run/stunnel4

Package:
stunnel4
Source:
stunnel4
Description:
Universal SSL tunnnel for network daemons - compatibility package
Submitter:
Oron Peled
Date:
2025-08-18 14:47:03 UTC
Severity:
normal
#1031311#5
Date:
2023-02-14 20:29:22 UTC
From:
To:
Dear Maintainer,

   * This problem is relevant when starting an "stunnel4" instance from systemd
     E.g: "systemct start stunnel@foobar.service"

   * The service fails with the following errors (taken from the journal):
     ---------------------------------------------------------------------------
---------------------------------
     Feb 14 21:42:36 sync2-cableos stunnel[559]: LOG3[ui]: Cannot create pid
file /var/run/stunnel4/rsync-ssl.pid
     Feb 14 21:42:36 sync2-cableos stunnel[559]: LOG3[ui]: create: No such file
or directory (2)
     ---------------------------------------------------------------------------
---------------------------------

   * The reason is clear:
     - Path "/var/run" is a symlink to "/run"
       (on Debian/bullseye, as most modern Linux systems)

     - Path "/run" is mounted as tmpfs

     - No mechanism create "/run/stunnel4" during service startup or boot

   * There are several possible solutions -- I tested the "tmpfiles.d" mechanism

   * This is how I locally fixed the issue:
     - I created "/usr/lib/tmpfiles.d/stunnel4.conf" with the following
contents:

         #Type   Path                    Mode    UID             GID
Age     Arguments
         d       /run/stunnel4           0755    stunnel4        stunnel4
-       -

     - During boot an OS that use systemd will run "systemd-tmpfiles-
setup.service"
     - This service reads all "tmpfile.d" configurations and generate the needed
files/directories
     - With the simple file described above the service run correctly.

#1031311#10
Date:
2023-07-24 00:56:44 UTC
From:
To:
Just passing by. I hope the following is related.
Quoting /usr/share/doc/stunnel4/NEWS.Debian.gz

    stunnel4 (3:5.68-1) unstable; urgency=medium

      The stunnel program will no longer create a process ID file by default.
      The "pid" option needs to be specified explicitly in the stunnel
      configuration file if such behavior is desired.

#1031311#15
Date:
2025-08-18 14:15:13 UTC
From:
To:
Surely this means #1031311 can now be closed?