summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--auto/help38
-rw-r--r--auto/make36
-rw-r--r--auto/modules/java10
-rw-r--r--auto/modules/perl8
-rw-r--r--auto/modules/php8
-rw-r--r--auto/modules/python8
-rw-r--r--auto/modules/ruby8
-rw-r--r--auto/options116
-rw-r--r--auto/save4
-rw-r--r--auto/summary8
-rwxr-xr-xconfigure17
-rw-r--r--docs/changes.xml7
-rw-r--r--src/nxt_runtime.c31
-rw-r--r--test/conftest.py6
-rwxr-xr-xtools/setup-unit6
15 files changed, 152 insertions, 159 deletions
diff --git a/auto/help b/auto/help
index a3884679..5de528ba 100644
--- a/auto/help
+++ b/auto/help
@@ -11,23 +11,31 @@ cat << END
--cc-opt=OPTIONS set additional C compiler options
--ld-opt=OPTIONS set additional linker options
- --prefix=DIRECTORY set prefix for relative pathnames, default: none
- --bindir=DIRECTORY set user executables directory name
- default: "$NXT_BINDIR"
- --sbindir=DIRECTORY set system admin executables directory name
- default: "$NXT_SBINDIR"
- --libdir=DIRECTORY set library directory name, default: "$NXT_LIBDIR"
- --incdir=DIRECTORY set includes directory name, default: "$NXT_INCDIR"
- --mandir=DIRECTORY set man pages directory name, default: "$NXT_MANDIR"
- --modules=DIRECTORY set modules directory name, default: "$NXT_MODULES"
- --state=DIRECTORY set state directory name, default: "$NXT_STATE"
- --tmp=DIRECTORY set tmp directory name, default: "$NXT_TMP"
-
- --pid=FILE set pid filename, default: "$NXT_PID"
- --log=FILE set log filename, default: "$NXT_LOG"
+ --prefix=DIR default: "/usr/local"
+ --exec-prefix=DIR default: "\$prefix"
+ --bindir=DIR default: "\$exec_prefix/bin"
+ --sbindir=DIR default: "\$exec_prefix/sbin"
+ --includedir=DIR default: "\$prefix/include"
+ --libdir=DIR default: "\$exec_prefix/lib"
+ --modulesdir=DIR default: "\$libdir/unit/modules"
+ --datarootdir=DIR default: "\$prefix/share"
+ --mandir=DIR default: "\$datarootdir/man"
+ --localstatedir=DIR default: "\$prefix/var"
+ --libstatedir=DIR default: "\$localstatedir/lib/unit"
+ --runstatedir=DIR default: "\$localstatedir/run/unit"
+ --logdir=DIR default: "\$localstatedir/log/unit"
+ --tmpdir=DIR default: "/tmp"
+
+ --incdir=DIR [deprecated] synonym for --includedir
+ --modules=DIR [deprecated] synonym for --modulesdir
+ --state=DIR [deprecated] synonym for --libstatedir
+ --tmp=DIR [deprecated] synonym for --tmpdir
+
+ --pid=FILE set pid filename, default: "\$runstatedir/unit.pid"
+ --log=FILE set log filename, default: "\$logdir/unit.log"
--control=ADDRESS set address of control API socket
- default: "$NXT_CONTROL"
+ default: "unix:\$runstatedir/control.unit.sock"
--user=USER set non-privileged processes to run as specified user
default: "$NXT_USER"
diff --git a/auto/make b/auto/make
index 5324f49c..66f2b1ec 100644
--- a/auto/make
+++ b/auto/make
@@ -366,8 +366,12 @@ ${NXT_DAEMON}-install: $NXT_DAEMON install-check
test -d \$(DESTDIR)$NXT_SBINDIR \
|| install -d \$(DESTDIR)$NXT_SBINDIR
install -p $NXT_BUILD_DIR/$NXT_DAEMON \$(DESTDIR)$NXT_SBINDIR/
- test -d \$(DESTDIR)$NXT_STATE \
- || install -d \$(DESTDIR)$NXT_STATE
+ test -d \$(DESTDIR)$NXT_LIBSTATEDIR \
+ || install -d \$(DESTDIR)$NXT_LIBSTATEDIR
+ test -d \$(DESTDIR)$NXT_LOGDIR \
+ || install -d \$(DESTDIR)$NXT_LOGDIR
+ test -d \$(DESTDIR)$NXT_RUNSTATEDIR \
+ || install -d \$(DESTDIR)$NXT_RUNSTATEDIR
manpage-install: manpage install-check
test -d \$(DESTDIR)$NXT_MANDIR/man8 \
@@ -397,8 +401,8 @@ libunit-install: $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
|| install -d \$(DESTDIR)$NXT_LIBDIR
install -p -m u=rw,go=r $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC \
\$(DESTDIR)$NXT_LIBDIR/
- test -d \$(DESTDIR)$NXT_INCDIR \
- || install -d \$(DESTDIR)$NXT_INCDIR
+ test -d \$(DESTDIR)$NXT_INCLUDEDIR \
+ || install -d \$(DESTDIR)$NXT_INCLUDEDIR
install -p -m u=rw,go=r src/nxt_unit.h \
src/nxt_unit_field.h \
src/nxt_unit_request.h \
@@ -409,22 +413,22 @@ libunit-install: $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
$NXT_BUILD_DIR/nxt_auto_config.h \
$NXT_BUILD_DIR/nxt_version.h \
src/nxt_websocket_header.h \
- \$(DESTDIR)$NXT_INCDIR/
+ \$(DESTDIR)$NXT_INCLUDEDIR/
libunit-uninstall:
rm -f \$(DESTDIR)$NXT_LIBDIR/$NXT_LIB_UNIT_STATIC
@rmdir -p \$(DESTDIR)$NXT_LIBDIR 2>/dev/null || true
- rm -f \$(DESTDIR)$NXT_INCDIR/nxt_unit.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_unit_field.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_unit_request.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_unit_response.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_unit_sptr.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_unit_typedefs.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_unit_websocket.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_auto_config.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_version.h \
- \$(DESTDIR)$NXT_INCDIR/nxt_websocket_header.h
- @rmdir -p \$(DESTDIR)$NXT_INCDIR 2>/dev/null || true
+ rm -f \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_field.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_request.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_response.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_sptr.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_typedefs.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_websocket.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_auto_config.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_version.h \
+ \$(DESTDIR)$NXT_INCLUDEDIR/nxt_websocket_header.h
+ @rmdir -p \$(DESTDIR)$NXT_INCLUDEDIR 2>/dev/null || true
END
diff --git a/auto/modules/java b/auto/modules/java
index bdf17022..a6ce5e81 100644
--- a/auto/modules/java
+++ b/auto/modules/java
@@ -63,7 +63,7 @@ fi
. $NXT_AUTOCONF_DATA
-NXT_JARS=${NXT_JARS=$NXT_MODULES}
+NXT_JARS=${NXT_JARS=$NXT_MODULESDIR}
NXT_JAVA_MODULE=${NXT_JAVA_MODULE=java}
NXT_JAVA_LIB_PATH=${NXT_JAVA_LIB_PATH=}
@@ -535,9 +535,9 @@ ${NXT_JAVA_MODULE}-install: $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
$NXT_BUILD_DIR/$NXT_UNIT_JAR \\
$NXT_BUILD_DIR/$NXT_WS_API_JAR \\
java-shared-install
- install -d \$(DESTDIR)$NXT_MODULES
+ install -d \$(DESTDIR)$NXT_MODULESDIR
install -p $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
- \$(DESTDIR)$NXT_MODULES/
+ \$(DESTDIR)$NXT_MODULESDIR/
install -d \$(DESTDIR)$NXT_JARS
install -p -m 0644 $NXT_BUILD_DIR/$NXT_UNIT_JAR \$(DESTDIR)$NXT_JARS/
install -p -m 0644 $NXT_BUILD_DIR/$NXT_WS_API_JAR \$(DESTDIR)$NXT_JARS/
@@ -546,8 +546,8 @@ ${NXT_JAVA_MODULE}-install: $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
uninstall: ${NXT_JAVA_MODULE}-uninstall
${NXT_JAVA_MODULE}-uninstall: java-shared-uninstall
- rm -f \$(DESTDIR)$NXT_MODULES/${NXT_JAVA_MODULE}.unit.so
- @rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
+ rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_JAVA_MODULE}.unit.so
+ @rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
rm -f \$(DESTDIR)$NXT_JARS/$NXT_UNIT_JAR
rm -f \$(DESTDIR)$NXT_JARS/$NXT_WS_API_JAR
@rmdir -p \$(DESTDIR)$NXT_JARS 2>/dev/null || true
diff --git a/auto/modules/perl b/auto/modules/perl
index 2daebd0d..94f06879 100644
--- a/auto/modules/perl
+++ b/auto/modules/perl
@@ -195,15 +195,15 @@ $NXT_BUILD_DIR/${NXT_PERL_MODULE}.unit.so: $nxt_objs
install: ${NXT_PERL_MODULE}-install
${NXT_PERL_MODULE}-install: ${NXT_PERL_MODULE} install-check
- install -d \$(DESTDIR)$NXT_MODULES
+ install -d \$(DESTDIR)$NXT_MODULESDIR
install -p $NXT_BUILD_DIR/${NXT_PERL_MODULE}.unit.so \\
- \$(DESTDIR)$NXT_MODULES/
+ \$(DESTDIR)$NXT_MODULESDIR/
uninstall: ${NXT_PERL_MODULE}-uninstall
${NXT_PERL_MODULE}-uninstall:
- rm -f \$(DESTDIR)$NXT_MODULES/${NXT_PERL_MODULE}.unit.so
- @rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
+ rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PERL_MODULE}.unit.so
+ @rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
END
diff --git a/auto/modules/php b/auto/modules/php
index f0ecb709..21dec215 100644
--- a/auto/modules/php
+++ b/auto/modules/php
@@ -275,15 +275,15 @@ $NXT_BUILD_DIR/${NXT_PHP_MODULE}.unit.so: $nxt_objs
install: ${NXT_PHP_MODULE}-install
${NXT_PHP_MODULE}-install: ${NXT_PHP_MODULE} install-check
- install -d \$(DESTDIR)$NXT_MODULES
+ install -d \$(DESTDIR)$NXT_MODULESDIR
install -p $NXT_BUILD_DIR/${NXT_PHP_MODULE}.unit.so \\
- \$(DESTDIR)$NXT_MODULES/
+ \$(DESTDIR)$NXT_MODULESDIR/
uninstall: ${NXT_PHP_MODULE}-uninstall
${NXT_PHP_MODULE}-uninstall:
- rm -f \$(DESTDIR)$NXT_MODULES/${NXT_PHP_MODULE}.unit.so
- @rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
+ rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PHP_MODULE}.unit.so
+ @rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
END
diff --git a/auto/modules/python b/auto/modules/python
index 480ae1da..d7504fc8 100644
--- a/auto/modules/python
+++ b/auto/modules/python
@@ -223,15 +223,15 @@ $NXT_BUILD_DIR/${NXT_PYTHON_MODULE}.unit.so: $nxt_objs
install: ${NXT_PYTHON_MODULE}-install
${NXT_PYTHON_MODULE}-install: ${NXT_PYTHON_MODULE} install-check
- install -d \$(DESTDIR)$NXT_MODULES
+ install -d \$(DESTDIR)$NXT_MODULESDIR
install -p $NXT_BUILD_DIR/${NXT_PYTHON_MODULE}.unit.so \\
- \$(DESTDIR)$NXT_MODULES/
+ \$(DESTDIR)$NXT_MODULESDIR/
uninstall: ${NXT_PYTHON_MODULE}-uninstall
${NXT_PYTHON_MODULE}-uninstall:
- rm -f \$(DESTDIR)$NXT_MODULES/${NXT_PYTHON_MODULE}.unit.so
- @rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
+ rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PYTHON_MODULE}.unit.so
+ @rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
END
diff --git a/auto/modules/ruby b/auto/modules/ruby
index 608193a6..99f6b286 100644
--- a/auto/modules/ruby
+++ b/auto/modules/ruby
@@ -261,15 +261,15 @@ $NXT_BUILD_DIR/${NXT_RUBY_MODULE}.unit.so: $nxt_objs
install: ${NXT_RUBY_MODULE}-install
${NXT_RUBY_MODULE}-install: ${NXT_RUBY_MODULE} install-check
- install -d \$(DESTDIR)$NXT_MODULES
+ install -d \$(DESTDIR)$NXT_MODULESDIR
install -p $NXT_BUILD_DIR/${NXT_RUBY_MODULE}.unit.so \\
- \$(DESTDIR)$NXT_MODULES/
+ \$(DESTDIR)$NXT_MODULESDIR/
uninstall: ${NXT_RUBY_MODULE}-uninstall
${NXT_RUBY_MODULE}-uninstall:
- rm -f \$(DESTDIR)$NXT_MODULES/${NXT_RUBY_MODULE}.unit.so
- @rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
+ rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_RUBY_MODULE}.unit.so
+ @rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
END
diff --git a/auto/options b/auto/options
index abcf531d..802ab701 100644
--- a/auto/options
+++ b/auto/options
@@ -9,8 +9,6 @@ NXT_CFLAGS=
NXT_CC_OPT=
NXT_LD_OPT=
-NXT_PREFIX=
-
NXT_DEBUG=NO
NXT_INET6=YES
@@ -44,6 +42,8 @@ NXT_TEST_BUILD_HPUX_SENDFILE=NO
NXT_TESTS=NO
+NXT_HELP=NO
+
for nxt_option
do
case "$nxt_option" in
@@ -57,14 +57,35 @@ do
--ld-opt=*) NXT_LD_OPT="$value" ;;
--prefix=*) NXT_PREFIX="$value" ;;
+ --exec-prefix=*) NXT_EXEC_PREFIX="$value" ;;
--bindir=*) NXT_BINDIR="$value" ;;
--sbindir=*) NXT_SBINDIR="$value" ;;
+ --includedir=*) NXT_INCLUDEDIR="$value" ;;
+ --incdir=*)
+ >&2 echo "[warn] option --incdir is deprecated; use --includedir"
+ NXT_INCLUDEDIR="$value"
+ ;;
--libdir=*) NXT_LIBDIR="$value" ;;
- --incdir=*) NXT_INCDIR="$value" ;;
+ --modulesdir=*) NXT_MODULESDIR="$value" ;;
+ --modules=*)
+ >&2 echo "[warn] option --modules is deprecated; use --modulesdir"
+ NXT_MODULESDIR="$value"
+ ;;
+ --datarootdir=*) NXT_DATAROOTDIR="$value" ;;
--mandir=*) NXT_MANDIR="$value" ;;
- --modules=*) NXT_MODULES="$value" ;;
- --state=*) NXT_STATE="$value" ;;
- --tmp=*) NXT_TMP="$value" ;;
+ --localstatedir=*) NXT_LOCALSTATEDIR="$value" ;;
+ --libstatedir=*) NXT_LIBSTATEDIR="$value" ;;
+ --state=*)
+ >&2 echo "[warn] option --state is deprecated; use --libstatedir"
+ NXT_LIBSTATEDIR="$value"
+ ;;
+ --logdir=*) NXT_LOGDIR="$value" ;;
+ --runstatedir=*) NXT_RUNSTATEDIR="$value" ;;
+ --tmpdir=*) NXT_TMPDIR="$value" ;;
+ --tmp=*)
+ >&2 echo "[warn] option --tmp is deprecated; use --tmpdir"
+ NXT_TMPDIR="$value"
+ ;;
--pid=*) NXT_PID="$value" ;;
--log=*) NXT_LOG="$value" ;;
@@ -124,63 +145,26 @@ do
done
-case "$NXT_PREFIX" in
- ""|*/) ;;
- *) NXT_PREFIX="$NXT_PREFIX/" ;;
-esac
-
-case "$NXT_BINDIR" in
- /*) ;;
- *) NXT_BINDIR="$NXT_PREFIX$NXT_BINDIR" ;;
-esac
-
-case "$NXT_SBINDIR" in
- /*) ;;
- *) NXT_SBINDIR="$NXT_PREFIX$NXT_SBINDIR" ;;
-esac
-
-case "$NXT_LIBDIR" in
- /*) ;;
- *) NXT_LIBDIR="$NXT_PREFIX$NXT_LIBDIR" ;;
-esac
-
-case "$NXT_INCDIR" in
- /*) ;;
- *) NXT_INCDIR="$NXT_PREFIX$NXT_INCDIR" ;;
-esac
-
-case "$NXT_MANDIR" in
- /*) ;;
- *) NXT_MANDIR="$NXT_PREFIX$NXT_MANDIR" ;;
-esac
-
-case "$NXT_MODULES" in
- /*) ;;
- *) NXT_MODULES="$NXT_PREFIX$NXT_MODULES" ;;
-esac
-
-case "$NXT_STATE" in
- /*) ;;
- *) NXT_STATE="$NXT_PREFIX$NXT_STATE" ;;
-esac
-
-case "$NXT_TMP" in
- /*) ;;
- *) NXT_TMP="$NXT_PREFIX$NXT_TMP" ;;
-esac
-
-case "$NXT_PID" in
- /*) ;;
- *) NXT_PID="$NXT_PREFIX$NXT_PID" ;;
-esac
-
-case "$NXT_LOG" in
- /*) ;;
- *) NXT_LOG="$NXT_PREFIX$NXT_LOG" ;;
-esac
-
-case "$NXT_CONTROL" in
- unix:/*) ;;
- unix:*) NXT_CONTROL="unix:$NXT_PREFIX${NXT_CONTROL##unix:}" ;;
- *) ;;
-esac
+NXT_PREFIX="${NXT_PREFIX-"/usr/local"}"
+
+NXT_EXEC_PREFIX="${NXT_EXEC_PREFIX-"$NXT_PREFIX"}"
+NXT_BINDIR="${NXT_BINDIR-"$NXT_EXEC_PREFIX/bin"}"
+NXT_SBINDIR="${NXT_SBINDIR-"$NXT_EXEC_PREFIX/sbin"}"
+
+NXT_INCLUDEDIR="${NXT_INCLUDEDIR-"$NXT_PREFIX/include"}"
+
+NXT_LIBDIR="${NXT_LIBDIR-"$NXT_PREFIX/lib"}"
+NXT_MODULESDIR="${NXT_MODULESDIR-"$NXT_LIBDIR/unit/modules"}"
+
+NXT_DATAROOTDIR="${NXT_DATAROOTDIR-"$NXT_PREFIX/share"}"
+NXT_MANDIR="${NXT_MANDIR-"$NXT_DATAROOTDIR/man"}"
+
+NXT_LOCALSTATEDIR="${NXT_LOCALSTATEDIR-"$NXT_PREFIX/var"}"
+NXT_LIBSTATEDIR="${NXT_LIBSTATEDIR-"$NXT_LOCALSTATEDIR/lib/unit"}"
+NXT_LOGDIR="${NXT_LOGDIR-"$NXT_LOCALSTATEDIR/log/unit"}"
+NXT_LOG="${NXT_LOG-"$NXT_LOGDIR/unit.log"}"
+NXT_RUNSTATEDIR="${NXT_RUNSTATEDIR-"$NXT_LOCALSTATEDIR/run/unit"}"
+NXT_CONTROL="${NXT_CONTROL-"unix:$NXT_RUNSTATEDIR/control.unit.sock"}"
+NXT_PID="${NXT_PID-"$NXT_RUNSTATEDIR/unit.pid"}"
+
+NXT_TMPDIR="${NXT_TMPDIR-"/tmp"}"
diff --git a/auto/save b/auto/save
index 19ef09ec..794b582a 100644
--- a/auto/save
+++ b/auto/save
@@ -28,7 +28,7 @@ NXT_LIB_AUX_LIBS=
NXT_LIB_UNIT_STATIC='$NXT_LIB_UNIT_STATIC'
-NXT_MODULES='$NXT_MODULES'
-NXT_TMP='$NXT_TMP'
+NXT_MODULESDIR='$NXT_MODULESDIR'
+NXT_TMPDIR='$NXT_TMPDIR'
END
diff --git a/auto/summary b/auto/summary
index 51db0eae..eff4881d 100644
--- a/auto/summary
+++ b/auto/summary
@@ -10,11 +10,11 @@ Unit configuration summary:
bin directory: ............. "$NXT_BINDIR"
sbin directory: ............ "$NXT_SBINDIR"
lib directory: ............. "$NXT_LIBDIR"
- include directory: ......... "$NXT_INCDIR"
+ include directory: ......... "$NXT_INCLUDEDIR"
man pages directory: ....... "$NXT_MANDIR"
- modules directory: ......... "$NXT_MODULES"
- state directory: ........... "$NXT_STATE"
- tmp directory: ............. "$NXT_TMP"
+ modules directory: ......... "$NXT_MODULESDIR"
+ state directory: ........... "$NXT_LIBSTATEDIR"
+ tmp directory: ............. "$NXT_TMPDIR"
pid file: .................. "$NXT_PID"
log file: .................. "$NXT_LOG"
diff --git a/configure b/configure
index 8482b514..1b831e6b 100755
--- a/configure
+++ b/configure
@@ -31,17 +31,6 @@ NXT_MAKEFILE=$NXT_BUILD_DIR/Makefile
CC=${CC:-cc}
NXT_DAEMON=unitd
-NXT_BINDIR="bin"
-NXT_SBINDIR="sbin"
-NXT_LIBDIR="lib"
-NXT_INCDIR="include"
-NXT_MANDIR="share/man"
-NXT_MODULES="modules"
-NXT_STATE="state"
-NXT_TMP="tmp"
-NXT_PID="unit.pid"
-NXT_LOG="unit.log"
-NXT_CONTROL="unix:control.unit.sock"
NXT_USER="nobody"
NXT_GROUP=
@@ -82,9 +71,9 @@ cat << END >> $NXT_AUTO_CONFIG_H
#define NXT_PID "$NXT_PID"
#define NXT_LOG "$NXT_LOG"
-#define NXT_MODULES "$NXT_MODULES"
-#define NXT_STATE "$NXT_STATE"
-#define NXT_TMP "$NXT_TMP"
+#define NXT_MODULESDIR "$NXT_MODULESDIR"
+#define NXT_LIBSTATEDIR "$NXT_LIBSTATEDIR"
+#define NXT_TMPDIR "$NXT_TMPDIR"
#define NXT_CONTROL_SOCK "$NXT_CONTROL"
diff --git a/docs/changes.xml b/docs/changes.xml
index 414f8672..569e49e5 100644
--- a/docs/changes.xml
+++ b/docs/changes.xml
@@ -38,6 +38,13 @@ support the keys API on the request objects in NJS.
</para>
</change>
+<change type="feature">
+<para>
+added default values for 'make install' pathnames such as prefix;
+this allows to do './configure &amp;&amp; make &amp;&amp; sudo make install'.
+</para>
+</change>
+
</changes>
<changes apply="unit-php
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index c7e4455e..cb5fe421 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -768,10 +768,10 @@ nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt)
rt->group = NXT_GROUP;
rt->pid = NXT_PID;
rt->log = NXT_LOG;
- rt->modules = NXT_MODULES;
- rt->state = NXT_STATE;
+ rt->modules = NXT_MODULESDIR;
+ rt->state = NXT_LIBSTATEDIR;
rt->control = NXT_CONTROL_SOCK;
- rt->tmp = NXT_TMP;
+ rt->tmp = NXT_TMPDIR;
nxt_memzero(&rt->capabilities, sizeof(nxt_capabilities_t));
@@ -927,9 +927,10 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
static const char no_pid[] = "option \"--pid\" requires filename\n";
static const char no_log[] = "option \"--log\" requires filename\n";
static const char no_modules[] =
- "option \"--modules\" requires directory\n";
- static const char no_state[] = "option \"--state\" requires directory\n";
- static const char no_tmp[] = "option \"--tmp\" requires directory\n";
+ "option \"--modulesdir\" requires directory\n";
+ static const char no_state[] =
+ "option \"--libstatedir\" requires directory\n";
+ static const char no_tmp[] = "option \"--tmpdir\" requires directory\n";
static const char help[] =
"\n"
@@ -948,14 +949,14 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
" --log FILE set log filename\n"
" default: \"" NXT_LOG "\"\n"
"\n"
- " --modules DIRECTORY set modules directory name\n"
- " default: \"" NXT_MODULES "\"\n"
+ " --modulesdir DIR set modules directory name\n"
+ " default: \"" NXT_MODULESDIR "\"\n"
"\n"
- " --state DIRECTORY set state directory name\n"
- " default: \"" NXT_STATE "\"\n"
+ " --libstatedir DIR set state directory name\n"
+ " default: \"" NXT_LIBSTATEDIR "\"\n"
"\n"
- " --tmp DIRECTORY set tmp directory name\n"
- " default: \"" NXT_TMP "\"\n"
+ " --tmpdir DIR set tmp directory name\n"
+ " default: \"" NXT_TMPDIR "\"\n"
"\n"
" --user USER set non-privileged processes to run"
" as specified user\n"
@@ -1038,7 +1039,7 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
continue;
}
- if (nxt_strcmp(p, "--modules") == 0) {
+ if (nxt_strcmp(p, "--modulesdir") == 0) {
if (*argv == NULL) {
write(STDERR_FILENO, no_modules, nxt_length(no_modules));
return NXT_ERROR;
@@ -1051,7 +1052,7 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
continue;
}
- if (nxt_strcmp(p, "--state") == 0) {
+ if (nxt_strcmp(p, "--libstatedir") == 0) {
if (*argv == NULL) {
write(STDERR_FILENO, no_state, nxt_length(no_state));
return NXT_ERROR;
@@ -1064,7 +1065,7 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
continue;
}
- if (nxt_strcmp(p, "--tmp") == 0) {
+ if (nxt_strcmp(p, "--tmpdir") == 0) {
if (*argv == NULL) {
write(STDERR_FILENO, no_tmp, nxt_length(no_tmp));
return NXT_ERROR;
diff --git a/test/conftest.py b/test/conftest.py
index 4a1aa7cc..b4951273 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -393,9 +393,9 @@ def unit_run(state_dir=None):
unitd_args = [
unitd,
'--no-daemon',
- '--modules',
+ '--modulesdir',
build_dir,
- '--state',
+ '--libstatedir',
state,
'--pid',
temp_dir + '/unit.pid',
@@ -403,7 +403,7 @@ def unit_run(state_dir=None):
temp_dir + '/unit.log',
'--control',
'unix:' + temp_dir + '/control.unit.sock',
- '--tmp',
+ '--tmpdir',
temp_dir,
]
diff --git a/tools/setup-unit b/tools/setup-unit
index 3db2d38b..ca7635db 100755
--- a/tools/setup-unit
+++ b/tools/setup-unit
@@ -598,14 +598,14 @@ unit_ctl_welcome()
# Check unitd is not configured already.
echo "$cmd" \
- | if grep '\--state' >/dev/null; then
+ | if grep '\--libstatedir' >/dev/null; then
echo "$cmd" \
| sed 's/ --/\n--/g' \
- | grep '\--state' \
+ | grep '\--libstatedir' \
| cut -d' ' -f2;
else
$cmd --help \
- | sed -n '/\--state/,+1p' \
+ | sed -n '/\--libstatedir/,+1p' \
| grep 'default:' \
| sed 's/ *default: "\(.*\)"/\1/';
fi \