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.
if ((p = getenv("TRIPEDIR")) != 0)
dir = p;
if ((p = getenv("TRIPEDIR")) != 0)
dir = p;
+ if ((p = getenv("TRIPESOCK")) != 0)
+ sock = p;
/* --- Parse the arguments --- */
/* --- Parse the arguments --- */
Makefile \
common/Makefile client/Makefile server/Makefile \
proxy/Makefile pkstream/Makefile \
Makefile \
common/Makefile client/Makefile server/Makefile \
proxy/Makefile pkstream/Makefile \
+ doc/Makefile doc/tripe.8 doc/tripectl.1 \
wireshark/Makefile \
init/Makefile init/tripe-init \
keys/Makefile keys/tripe-keys \
wireshark/Makefile \
init/Makefile init/tripe-init \
keys/Makefile keys/tripe-keys \
Tcl, or more advanced clients such as GUI monitors can be written in C
with little difficulty.
.PP
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.
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.
It sets the directory named by the
.B TRIPEDIR
environment variable (or
It sets the directory named by the
.B TRIPEDIR
environment variable (or
if the variable is unset) as the current directory.
.hP 2.
It acquires a UDP socket with an arbitrary kernel-selected port number.
if the variable is unset) as the current directory.
.hP 2.
It acquires a UDP socket with an arbitrary kernel-selected port number.
.BI "\-d, \-\-directory=" dir
Makes
.I dir
.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
.B .
if you don't want it to change directory at all.
.TP
.TP
.BI "\-a, \-\-admin\-socket=" socket
Accept admin connections to a Unix-domain socket named
.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
.TP
.BI "\-T, \-\-trace=" trace-opts
Allows the enabling or disabling of various internal diagnostics. See
taken from the environment variable
.BR TRIPEDIR ;
if that's not defined either, a default default of
taken from the environment variable
.BR TRIPEDIR ;
if that's not defined either, a default default of
-.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 .
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
.TP
.BI "\-P, \-\-pidfile=" pidfile
Write
[ -f @initconfig@ ] && . @initconfig@
: ${prefix=@prefix@} ${exec_prefix=@exec_prefix@}
: ${bindir=@bindir@} ${sbindir=@sbindir@}
[ -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
: ${pidfile=@pidfile@}
: ${tripe=$sbindir/tripe} ${tripectl=$bindir/tripectl}
PATH=/usr/bin:/usr/sbin:/bin:/sbin:$bindir
+export PATH TRIPEDIR TRIPESOCK
# --- Give up if there's no key ---
# --- Give up if there's no key ---
;;
stop)
echo -n "Stopping TrIPE VPN daemon:"
;;
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"
echo " not running"
elif $tripectl quit >/dev/null 2>&1; then
echo " done"
elif test ! -f $pidfile; then
echo " stale socket found: removing"
elif kill `cat $pidfile`; then
echo " done (killed violently)"
else
elif kill `cat $pidfile`; then
echo " done (killed violently)"
else
if ((p = getenv("TRIPEDIR")) != 0)
dir = p;
if ((p = getenv("TRIPEDIR")) != 0)
dir = p;
+ if ((p = getenv("TRIPESOCK")) != 0)
+ csock = p;
tun_default = tunnels[0];
for (;;) {
tun_default = tunnels[0];
for (;;) {