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.