]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Set default pid_filename based on service name
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Oct 2015 12:44:41 +0000 (05:44 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Oct 2015 12:44:41 +0000 (05:44 -0700)
This makes pid_filename directive no longer need to be set explicitly to
the service name in multi-tenant installations. Unless the default value
has been replaced with --with-pidfile=Foo it will use the service name
as the .pid filename.

configure.ac
src/Makefile.am
src/cf.data.sed [new file with mode: 0644]

index 1f56a26882f9916504417b399789aa91d50f6209..0979edf6dd8e76bbaf3b360fd59192347530c610 100644 (file)
@@ -266,7 +266,7 @@ esac
 )
 AC_SUBST(DEFAULT_LOG_DIR)
 
-DEFAULT_PID_FILE="$localstatedir/run/squid.pid"
+DEFAULT_PID_FILE="$localstatedir/run/@SERVICE_NAME@.pid"
 AC_ARG_WITH(pidfile,
   AS_HELP_STRING([--with-pidfile=PATH],
     [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]), [
index 5c84765e2c6fc524aedd754a7ec524c7747ce24f..6d1cb0c08a5cf73540e629bf140f0fbe30d12f55 100644 (file)
@@ -735,6 +735,7 @@ EXTRA_DIST = \
        cf_gen_defines \
        cf.data.pre \
        cf.data.depend \
+       cf.data.sed \
        mk-globals-c.awk \
        mk-string-arrays.awk \
        repl_modules.sh \
@@ -844,6 +845,7 @@ cf.data: cf.data.pre Makefile
        -e "s%[@]DEFAULT_PREFIX[@]%$(DEFAULT_PREFIX)%g" \
        -e "s%[@]DEFAULT_HOSTS[@]%$(DEFAULT_HOSTS)%g" \
        -e "s%[@]SQUID[@]%SQUID\ $(VERSION)%g" \
+       -f $(srcdir)/cf.data.sed \
        < $(srcdir)/cf.data.pre >$@
 
 repl_modules.cc: repl_modules.sh Makefile
diff --git a/src/cf.data.sed b/src/cf.data.sed
new file mode 100644 (file)
index 0000000..d2b36bf
--- /dev/null
@@ -0,0 +1 @@
+s%[@]SERVICE_NAME[@]%${service_name}%g