summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Pentchev <roam@ringlet.net>2019-11-28 00:29:22 +0200
committerPeter Pentchev <roam@debian.org>2019-11-28 00:29:22 +0200
commit7aeed43562f3b828464060ae3a38050af64ffd00 (patch)
tree2b6eb0a2f948edc07e401beab9ba8e283d299c1f
parentd98bf99aa83fff9782ffbc45149590eaf4b79572 (diff)
Temporarily restore the pid file creation by default.
Forwarded: not-needed Bug-Debian: https://bugs.debian.org/744851 Last-Update: 2018-12-06 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. Gbp-Pq: Name 04-restore-pidfile-default.patch
-rw-r--r--src/Makefile.am1
-rw-r--r--src/options.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 4c53d12..1862bab 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,6 +33,7 @@ stunnel_CPPFLAGS = -I$(SYSROOT)/usr/kerberos/include
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
diff --git a/src/options.c b/src/options.c
index e63bdfb..136cd78 100644
--- a/src/options.c
+++ b/src/options.c
@@ -1049,7 +1049,7 @@ NOEXPORT char *parse_global_option(CMD cmd, char *opt, char *arg) {
#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;
@@ -1073,9 +1073,10 @@ NOEXPORT char *parse_global_option(CMD cmd, char *opt, char *arg) {
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