summaryrefslogtreecommitdiff
path: root/debian/patches/04-restore-pidfile-default.patch
blob: 09bfe973421a597341823c9e7857df4e159a3f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: Temporarily restore the pid file creation by default.
 The init script will not be able to monitor the automatically-started
 instances of stunnel if there is no pid file.  For the present for the
 upgrade from 4.53 the "create the pid file by default" behavior is
 restored and the init script warns about configuration files that have
 no "pid" setting.  The intention is that in a future version the init
 script will refuse to start stunnel for these configurations.
Forwarded: not-needed
Author: Peter Pentchev <roam@ringlet.net>
Bug-Debian: https://bugs.debian.org/744851
Last-Update: 2018-12-06
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,6 +33,7 @@
 stunnel_CPPFLAGS += -I$(SSLDIR)/include
 stunnel_CPPFLAGS += -DLIBDIR='"$(pkglibdir)"'
 stunnel_CPPFLAGS += -DCONFDIR='"$(sysconfdir)/stunnel"'
+stunnel_CPPFLAGS += -DPIDFILE='"$(localstatedir)/run/stunnel4.pid"'
 
 # TLS library
 stunnel_LDFLAGS = -L$(SSLDIR)/lib64 -L$(SSLDIR)/lib -lssl -lcrypto
--- a/src/options.c
+++ b/src/options.c
@@ -1038,7 +1038,7 @@
 #ifndef USE_WIN32
     switch(cmd) {
     case CMD_SET_DEFAULTS:
-        new_global_options.pidfile=NULL; /* do not create a pid file */
+        new_global_options.pidfile=PIDFILE;
         break;
     case CMD_SET_COPY: /* not used for global options */
         break;
@@ -1062,9 +1062,10 @@
             return "Pid file must include full path name";
         break;
     case CMD_PRINT_DEFAULTS:
+        s_log(LOG_NOTICE, "%-22s = %s", "pid", PIDFILE);
         break;
     case CMD_PRINT_HELP:
-        s_log(LOG_NOTICE, "%-22s = pid file", "pid");
+        s_log(LOG_NOTICE, "%-22s = pid file (empty to disable creating)", "pid");
         break;
     }
 #endif