summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-03-06 13:18:37 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-03-06 13:21:11 (GMT)
commit9da20afc8258ece5d9d1e729227ae95bf4c39aac (patch) (side-by-side diff)
tree836a8bb542a0c14f4e5421b63f9189a51541916d
parent66ad934d37f50d494b625897b7881c8f6ffbc79a (diff)
downloaddico-9da20afc8258ece5d9d1e729227ae95bf4c39aac.tar.gz
dico-9da20afc8258ece5d9d1e729227ae95bf4c39aac.tar.bz2
New configure variable: DEFAULT_PIDFILE_NAME
Allows the user to override the default pidfile location for dicod Suggested in https://puszcza.gnu.org.ua/bugs/?419 * configure.boot (DEFAULT_PIDFILE_NAME): New variable * dicod/Makefile.am (AM_CPPFLAGS): Define DEFAULT_PIDFILE_NAME * dicod/main.c (pidfile_name): Change initialization
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--configure.boot6
-rw-r--r--dicod/Makefile.am1
-rw-r--r--dicod/main.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/configure.boot b/configure.boot
index 9d670df..68019e3 100644
--- a/configure.boot
+++ b/configure.boot
@@ -148,7 +148,11 @@ AC_ARG_VAR([DEFAULT_VERSION_INCLUDE_DIR],
if test -z "$DEFAULT_VERSION_INCLUDE_DIR"; then
DEFAULT_VERSION_INCLUDE_DIR='$(pkgdatadir)/$(VERSION)/include'
fi
-
+AC_ARG_VAR([DEFAULT_PIDFILE_NAME],
+ [Default name for the dicod pid file])
+if test -z "$DEFAULT_PIDFILE_NAME"; then
+ DEFAULT_PIDFILE_NAME='$(localstatedir)/run/dicod.pid'
+fi
AC_SUBST([DICO_PROG_CONFIG],['-I$(top_builddir)/include/prog'])
AC_SUBST([DICO_LIB_CONFIG],['-I$(top_builddir)/include/lib'])
diff --git a/dicod/Makefile.am b/dicod/Makefile.am
index 80e59d1..77d3483 100644
--- a/dicod/Makefile.am
+++ b/dicod/Makefile.am
@@ -56,6 +56,7 @@ AM_CPPFLAGS = \
-DDEFAULT_VERSION_INCLUDE_DIR=\"$(DEFAULT_VERSION_INCLUDE_DIR)\"\
-DDEFAULT_INCLUDE_DIR=\"$(DEFAULT_INCLUDE_DIR)\"\
-DDEFAULT_PREPROCESSOR="$(DEFAULT_PREPROCESSOR)"\
+ -DDEFAULT_PIDFILE_NAME=\"$(DEFAULT_PIDFILE_NAME)\"\
-I$(srcdir)\
@DICO_PROG_INCLUDES@ @LTDLINCL@
diff --git a/dicod/main.c b/dicod/main.c
index 88a02e4..b5dc9b1 100644
--- a/dicod/main.c
+++ b/dicod/main.c
@@ -24,7 +24,7 @@ int single_process; /* Single process mode */
char *config_file = SYSCONFIG "/dicod.conf" ;
int config_lint_option; /* Check configuration file syntax and exit. */
/* Location of the pidfile */
-char *pidfile_name = LOCALSTATEDIR "/run/dicod.pid";
+char *pidfile_name = DEFAULT_PIDFILE_NAME;
/* Operation mode */
int mode = MODE_DAEMON;

Return to:

Send suggestions and report system problems to the System administrator.