chiark / gitweb /
New environment variable TRIPESOCK.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 4 Jan 2007 11:27:03 +0000 (11:27 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 4 Jan 2007 11:27:03 +0000 (11:27 +0000)
Provides a handy default for the `--admin-socket' option.  Added
documentation.

Also fixed paths in documentation to reflect the configuration choices;
in particular, they were wrong in the Debian build.

client/tripectl.c
configure.in
doc/tripe-admin.5.in
doc/tripe.8.in [moved from doc/tripe.8 with 97% similarity]
doc/tripectl.1.in [moved from doc/tripectl.1 with 95% similarity]
init/tripe-init.in
server/tripe.c

index 50678df9b14a9ee80331abd8a96a8d9df2b54dec..5bdc502580c33e235e8301c9e4546fea8577d8d1 100644 (file)
@@ -343,6 +343,8 @@ int main(int argc, char *argv[])
 
   if ((p = getenv("TRIPEDIR")) != 0)
     dir = p;
+  if ((p = getenv("TRIPESOCK")) != 0)
+    sock = p;
 
   /* --- Parse the arguments --- */
 
index 972fcf604574a5845ac600076f4405e845a95612..cb6efb2c423b7e0d1bdf19ba6a9084c884d97e73 100644 (file)
@@ -256,7 +256,7 @@ AC_OUTPUT( \
        Makefile \
        common/Makefile client/Makefile server/Makefile \
        proxy/Makefile pkstream/Makefile \
-       doc/Makefile \
+       doc/Makefile doc/tripe.8 doc/tripectl.1 \
        wireshark/Makefile \
        init/Makefile init/tripe-init \
        keys/Makefile keys/tripe-keys \
index 822bbf508b588eddb4b7814bc8f0394b76e5d2ac..1f52a6db7785ca95637b2ad5c6f5f67222312fa8 100644 (file)
@@ -25,9 +25,6 @@ clients can be written in scripting languages such as Perl, Python or
 Tcl, or more advanced clients such as GUI monitors can be written in C
 with little difficulty.
 .PP
-By default, the server listens for admin connections on the Unix-domain
-socket
-.BR /var/lib/tripe/tripesock .
 Administration commands use a textual protocol.  Each client command or
 server response consists of a line of ASCII text terminated by a single
 linefeed character.  No command may be longer than 255 characters.
similarity index 97%
rename from doc/tripe.8
rename to doc/tripe.8.in
index f5fe5bf6dc5f0e4ecd06294762898a670b25ce1b..e58c28cf4acf665473cbffeb30b1c03eeab65dbb 100644 (file)
@@ -99,7 +99,7 @@ will initialize by following these steps:
 It sets the directory named by the
 .B TRIPEDIR
 environment variable (or
-.B /var/lib/tripe
+.B "@configdir@"
 if the variable is unset) as the current directory.
 .hP 2.
 It acquires a UDP socket with an arbitrary kernel-selected port number.
@@ -169,9 +169,12 @@ in the background is with
 .BI "\-d, \-\-directory=" dir
 Makes
 .I dir
-the current directory, instead of
-.BR /var/lib/tripe .
-Give a current directory of
+the current directory.  The default directory to change to is given by
+the environment variable
+.BR TRIPEDIR ;
+if that's not specified, a default default of
+.B "@configdir@"
+is used.  Give a current directory of
 .B .
 if you don't want it to change directory at all.
 .TP
@@ -226,9 +229,13 @@ rather than the default
 .TP
 .BI "\-a, \-\-admin\-socket=" socket
 Accept admin connections to a Unix-domain socket named
-.I socket
-rather than the default
-.BR tripesock .
+.IR socket .
+The default socket, if this option isn't specified, is given by the
+environment variable
+.BR TRIPESOCK ;
+if that's not set either, then a default default of
+.B "@socketdir@/tripesock"
+is used instead.
 .TP
 .BI "\-T, \-\-trace=" trace-opts
 Allows the enabling or disabling of various internal diagnostics.  See
similarity index 95%
rename from doc/tripectl.1
rename to doc/tripectl.1.in
index 379fcda18b2c294d80152fb36f6c176ef9dc73b6..d46dd33db5f82666e56f3ff3735252a22df806bd 100644 (file)
@@ -86,15 +86,21 @@ directory.  The default directory, if this option is not specified, is
 taken from the environment variable
 .BR TRIPEDIR ;
 if that's not defined either, a default default of
-.BR /var/lib/tripe
+.B "@configdir@"
 is used.
 .TP
-.BI "\-a, \-\-admin=" socket
+.BI "\-a, \-\-admin-socket=" socket
 If connecting to a running server, connect to the socket named
 .IR socket ;
 if running a new server, instruct it to listen for admin
 connections on
 .IR socket .
+The default socket, if this option is not specified, is taken from the
+environment variable
+.BR TRIPESOCK ;
+if that's not defined either, a default default of
+.B "@socketdir@/tripesock"
+is used.
 .TP
 .BI "\-P, \-\-pidfile=" pidfile
 Write
index e609a653af0a1765e5c1badef08ff6c0e08b646e..ddede1054e204ca8fe83a3941944082d9026df37 100755 (executable)
@@ -10,11 +10,11 @@ set -e
 [ -f @initconfig@ ] && . @initconfig@
 : ${prefix=@prefix@} ${exec_prefix=@exec_prefix@}
 : ${bindir=@bindir@} ${sbindir=@sbindir@}
-: ${TRIPEDIR=@configdir@} ${tripesock=@socketdir@/tripesock}
+: ${TRIPEDIR=@configdir@} ${TRIPESOCK=@socketdir@/tripesock}
 : ${pidfile=@pidfile@}
 : ${tripe=$sbindir/tripe} ${tripectl=$bindir/tripectl}
 PATH=/usr/bin:/usr/sbin:/bin:/sbin:$bindir
-export PATH TRIPEDIR
+export PATH TRIPEDIR TRIPESOCK
 
 # --- Give up if there's no key ---
 
@@ -150,13 +150,13 @@ case "$1" in
     ;;
   stop)
     echo -n "Stopping TrIPE VPN daemon:"
-    if test ! -S $tripesock; then
+    if test ! -S $TRIPESOCK; then
       echo " not running"
     elif $tripectl quit >/dev/null 2>&1; then
       echo " done"
     elif test ! -f $pidfile; then
       echo " stale socket found: removing"
-      rm -f $tripesock
+      rm -f $TRIPESOCK
     elif kill `cat $pidfile`; then
       echo " done (killed violently)"
     else
index b5bd21c4adcaffbd47bfd1431a43d96f2f51637c..d98a2af45bf5369839cb21e366f770f3d27de31b 100644 (file)
@@ -152,6 +152,8 @@ int main(int argc, char *argv[])
 
   if ((p = getenv("TRIPEDIR")) != 0)
     dir = p;
+  if ((p = getenv("TRIPESOCK")) != 0)
+    csock = p;
   tun_default = tunnels[0];
 
   for (;;) {