]> tinc-vpn.org Git - tinc/commitdiff
Support autoconf's --runstatedir option.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 6 Nov 2017 21:35:28 +0000 (22:35 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 6 Nov 2017 21:38:15 +0000 (22:38 +0100)
Put the PID file in @runstatedir@ instead of @localstatedir@/run. This
requires autoconf 2.70, which is not released yet, so add a fallback to
use @localstatedir@/run if @runstatedir@ is not set.

configure.ac
doc/Makefile.am
doc/tinc-gui.8.in
doc/tinc.8.in
doc/tinc.conf.5.in
doc/tinc.texi
doc/tincd.8.in
doc/tincinclude.texi.in
src/Makefile.am
src/uml_device.c
src/vde_device.c

index 39abe9d96fef19e8171e02e2b7401084a66229e8..89087da5a44d6eb3ca80af382b263658bf3d2215 100644 (file)
@@ -255,6 +255,11 @@ AC_ARG_ENABLE(jumbograms,
   ]
 )
 
   ]
 )
 
+dnl Ensure runstatedir is set if we are using a version of autoconf that does not suppport it
+if test "x$runstatedir" = "x"; then
+  AC_SUBST([runstatedir], ['${localstatedir}/run'])
+fi
+
 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile gui/Makefile test/Makefile systemd/Makefile])
 
 AC_OUTPUT
 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile gui/Makefile test/Makefile systemd/Makefile])
 
 AC_OUTPUT
index b3af5227e577f0f1e0f04c5d64c0f5cb2eb1571e..c0187f58dcf7c3e8c15360c086ebacd70378c587 100644 (file)
@@ -24,6 +24,7 @@ substitute = sed \
        -e s,'@PACKAGE\@',"$(PACKAGE)",g \
        -e s,'@VERSION\@',"$(VERSION)",g \
        -e s,'@sysconfdir\@',"$(sysconfdir)",g \
        -e s,'@PACKAGE\@',"$(PACKAGE)",g \
        -e s,'@VERSION\@',"$(VERSION)",g \
        -e s,'@sysconfdir\@',"$(sysconfdir)",g \
+       -e s,'@runstatedir\@',"$(runstatedir)",g \
        -e s,'@localstatedir\@',"$(localstatedir)",g
 
 tincd.8: tincd.8.in
        -e s,'@localstatedir\@',"$(localstatedir)",g
 
 tincd.8: tincd.8.in
index f5ebadb2bbc2084fcd7a69d26b987bdb1f11efdd..e554a85db77c3005136a00db63047c566f178f0b 100644 (file)
@@ -30,7 +30,7 @@ Use the cookie from
 .Ar FILENAME
 to authenticate with a running tinc daemon.
 If unspecified, the default is
 .Ar FILENAME
 to authenticate with a running tinc daemon.
 If unspecified, the default is
-.Pa @localstatedir@/run/tinc. Ns Ar NETNAME Ns Pa .pid.
+.Pa @runstatedir@/tinc. Ns Ar NETNAME Ns Pa .pid.
 .It Fl -help
 Display short list of options.
 .El
 .It Fl -help
 Display short list of options.
 .El
index 6644adde836b865b2511f204d1b60565e98f0dde..eaad626e47f9cce69d647d64e591f160cfa3ba35 100644 (file)
@@ -54,7 +54,7 @@ Use the cookie from
 .Ar FILENAME
 to authenticate with a running tinc daemon.
 If unspecified, the default is
 .Ar FILENAME
 to authenticate with a running tinc daemon.
 If unspecified, the default is
-.Pa @localstatedir@/run/tinc. Ns Ar NETNAME Ns Pa .pid.
+.Pa @runstatedir@/tinc. Ns Ar NETNAME Ns Pa .pid.
 .It Fl -force
 Force some commands to work despite warnings.
 .It Fl -help
 .It Fl -force
 Force some commands to work despite warnings.
 .It Fl -help
index 53440a1184115afe28b392acea5908691469d8a9..3ab40a595dec6d03648697aca494c4720b3a5a5e 100644 (file)
@@ -242,7 +242,7 @@ Packets received for the local node are written to it.
 Create a UNIX socket with the filename specified by
 .Va Device ,
 or
 Create a UNIX socket with the filename specified by
 .Va Device ,
 or
-.Pa @localstatedir@/run/ Ns Ar NETNAME Ns Pa .umlsocket
+.Pa @runstatedir@/ Ns Ar NETNAME Ns Pa .umlsocket
 if not specified.
 .Nm tinc
 will wait for a User Mode Linux instance to connect to this socket.
 if not specified.
 .Nm tinc
 will wait for a User Mode Linux instance to connect to this socket.
@@ -251,7 +251,7 @@ Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
 using the UNIX socket specified by
 .Va Device ,
 or
 using the UNIX socket specified by
 .Va Device ,
 or
-.Pa @localstatedir@/run/vde.ctl
+.Pa @runstatedir@/vde.ctl
 if not specified.
 .El
 Also, in case tinc does not seem to correctly interpret packets received from the virtual network device,
 if not specified.
 .El
 Also, in case tinc does not seem to correctly interpret packets received from the virtual network device,
index 0c2f8c055cf6542142c177b1e1f4d79633b691b7..954a643d299428423d0caaa93c5c16a8eea1d53c 100644 (file)
@@ -967,7 +967,7 @@ Packets received for the local node are written to it.
 @cindex UML
 @item uml (not compiled in by default)
 Create a UNIX socket with the filename specified by
 @cindex UML
 @item uml (not compiled in by default)
 Create a UNIX socket with the filename specified by
-@var{Device}, or @file{@value{localstatedir}/run/@var{netname}.umlsocket}
+@var{Device}, or @file{@value{runstatedir}/@var{netname}.umlsocket}
 if not specified.
 Tinc will wait for a User Mode Linux instance to connect to this socket.
 
 if not specified.
 Tinc will wait for a User Mode Linux instance to connect to this socket.
 
@@ -975,7 +975,7 @@ Tinc will wait for a User Mode Linux instance to connect to this socket.
 @item vde (not compiled in by default)
 Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
 using the UNIX socket specified by
 @item vde (not compiled in by default)
 Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
 using the UNIX socket specified by
-@var{Device}, or @file{@value{localstatedir}/run/vde.ctl}
+@var{Device}, or @file{@value{runstatedir}/vde.ctl}
 if not specified.
 @end table
 
 if not specified.
 @end table
 
@@ -1985,7 +1985,7 @@ Specifying . for @var{netname} is the same as not specifying any @var{netname}.
 @item --pidfile=@var{filename}
 Store a cookie in @var{filename} which allows tinc to authenticate.
 If unspecified, the default is
 @item --pidfile=@var{filename}
 Store a cookie in @var{filename} which allows tinc to authenticate.
 If unspecified, the default is
-@file{@value{localstatedir}/run/tinc.@var{netname}.pid}.
+@file{@value{runstatedir}/tinc.@var{netname}.pid}.
 
 @item -o, --option=[@var{HOST}.]@var{KEY}=@var{VALUE}
 Without specifying a @var{HOST}, this will set server configuration variable @var{KEY} to @var{VALUE}.
 
 @item -o, --option=[@var{HOST}.]@var{KEY}=@var{VALUE}
 Without specifying a @var{HOST}, this will set server configuration variable @var{KEY} to @var{VALUE}.
@@ -2003,6 +2003,9 @@ This option is not supported on all platforms.
 Write log entries to a file instead of to the system logging facility.
 If @var{file} is omitted, the default is @file{@value{localstatedir}/log/tinc.@var{netname}.log}.
 
 Write log entries to a file instead of to the system logging facility.
 If @var{file} is omitted, the default is @file{@value{localstatedir}/log/tinc.@var{netname}.log}.
 
+@item --pidfile=@var{file}
+Write PID to @var{file} instead of @file{@value{runstatedir}/tinc.@var{netname}.pid}.
+
 @item --bypass-security
 Disables encryption and authentication.
 Only useful for debugging.
 @item --bypass-security
 Disables encryption and authentication.
 Only useful for debugging.
@@ -2301,7 +2304,7 @@ Use configuration for net @var{netname}. @xref{Multiple networks}.
 @item --pidfile=@var{filename}
 Use the cookie from @var{filename} to authenticate with a running tinc daemon.
 If unspecified, the default is
 @item --pidfile=@var{filename}
 Use the cookie from @var{filename} to authenticate with a running tinc daemon.
 If unspecified, the default is
-@file{@value{localstatedir}/run/tinc.@var{netname}.pid}.
+@file{@value{runstatedir}/tinc.@var{netname}.pid}.
 
 @item --force
 Force some commands to work despite warnings.
 
 @item --force
 Force some commands to work despite warnings.
index 22c54a718e29edf85fa5578347d49042adfc155c..a14eb4e2b726fe8a326712c251a033cb9b536cc1 100644 (file)
@@ -100,7 +100,7 @@ to authenticate.
 If
 .Ar FILE
 is omitted, the default is
 If
 .Ar FILE
 is omitted, the default is
-.Pa @localstatedir@/run/tinc. Ns Ar NETNAME Ns Pa .pid.
+.Pa @runstatedir@/tinc. Ns Ar NETNAME Ns Pa .pid.
 .It Fl -bypass-security
 Disables encryption and authentication of the meta protocol.
 Only useful for debugging.
 .It Fl -bypass-security
 Disables encryption and authentication of the meta protocol.
 Only useful for debugging.
@@ -173,7 +173,7 @@ This will log all network traffic over the virtual private network.
 Directory containing the configuration files tinc uses.
 For more information, see
 .Xr tinc.conf 5 .
 Directory containing the configuration files tinc uses.
 For more information, see
 .Xr tinc.conf 5 .
-.It Pa @localstatedir@/run/tinc. Ns Ar NETNAME Ns Pa .pid
+.It Pa @runstatedir@/tinc. Ns Ar NETNAME Ns Pa .pid
 The PID of the currently running
 .Nm
 is stored in this file.
 The PID of the currently running
 .Nm
 is stored in this file.
index da4adc57d51d550385e05f106ca9e8c92f08bbd2..01fee35e3af2192b495f81c9e633c9798eb1b63d 100644 (file)
@@ -2,3 +2,4 @@
 @set PACKAGE @PACKAGE@
 @set sysconfdir @sysconfdir@
 @set localstatedir @localstatedir@
 @set PACKAGE @PACKAGE@
 @set sysconfdir @sysconfdir@
 @set localstatedir @localstatedir@
+@set runstatedir @runstatedir@
index 7be46d97a9002b1c5d63bf78c3cc7f455e1b5881..253e02a5ce2f6cd0fa33317ee5e718d55d8e1fc4 100644 (file)
@@ -284,4 +284,4 @@ if TUNEMU
 LIBS += -lpcap
 endif
 
 LIBS += -lpcap
 endif
 
-AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" -iquote.
+AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DRUNSTATEDIR=\"$(runstatedir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" -iquote.
index 3e7b8219fc4f000328f3fb482c0aa56695cc5300..3f521040f8ceb25827866ebf261d5181e1885391 100644 (file)
@@ -60,7 +60,7 @@ static bool setup_device(void) {
        struct timeval tv;
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device)) {
        struct timeval tv;
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device)) {
-               xasprintf(&device, LOCALSTATEDIR "/run/%s.umlsocket", identname);
+               xasprintf(&device, RUNSTATEDIR "/%s.umlsocket", identname);
        }
 
        get_config_string(lookup_config(config_tree, "Interface"), &iface);
        }
 
        get_config_string(lookup_config(config_tree, "Interface"), &iface);
index e2692eb88c1d1792ea6526beadb5ef7f26c72235..4cbf712894ab056aae99f1d01570d35aa14b85ae 100644 (file)
@@ -45,7 +45,7 @@ static bool setup_device(void) {
        }
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device)) {
        }
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device)) {
-               xasprintf(&device, LOCALSTATEDIR "/run/vde.ctl");
+               xasprintf(&device, RUNSTATEDIR "/vde.ctl");
        }
 
        get_config_string(lookup_config(config_tree, "Interface"), &iface);
        }
 
        get_config_string(lookup_config(config_tree, "Interface"), &iface);