diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a4c51aa1dcef27adf1efa29b10d35a7b3355b16..6e423c65a9c2ccc80090b41ab410fd6cf0c6c8ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ find_program(GIT git) find_program(RAGEL ragel) find_program(CONFETTI confetti) find_program(LD ld) +find_program(POD2MAN pod2man) set(luadir ${PROJECT_BINARY_DIR}/third_party/luajit/src) link_directories(${luadir}) @@ -184,10 +185,13 @@ include_directories("${PROJECT_SOURCE_DIR}/connector/c/tntnet/include") # Specify prefixes # if (NOT DEFINED CMAKE_SYSCONF_DIR) - set (CMAKE_SYSCONF_DIR "${CMAKE_INSTALL_PREFIX}/etc") + set (CMAKE_SYSCONF_DIR "etc") endif() if (NOT DEFINED CMAKE_LOCALSTATE_DIR) - set (CMAKE_LOCALSTATE_DIR "${CMAKE_INSTALL_PREFIX}/var") + set (CMAKE_LOCALSTATE_DIR "var") +endif() +if (NOT DEFINED CMAKE_MAN_DIR) + set (CMAKE_MAN_DIR "man") endif() # @@ -261,7 +265,7 @@ add_subdirectory(core) add_subdirectory(mod) add_subdirectory(client) add_subdirectory(test) -add_subdirectory(doc EXCLUDE_FROM_ALL) +add_subdirectory(doc) add_subdirectory(extra) install (FILES README LICENSE doc/box-protocol.txt diff --git a/core/say.m b/core/say.m index ceff0e30891048291869aff976720ba50106cb7c..5cc8a89aaa16d1867253e79419706288d74d5dcf 100644 --- a/core/say.m +++ b/core/say.m @@ -40,8 +40,7 @@ #include "tarantool.h" int sayfd = STDERR_FILENO; -static pid_t logger_pid; - +pid_t logger_pid; static char level_to_char(int level) @@ -64,19 +63,6 @@ level_to_char(int level) } } -void say_logger_reinit(void) { - say_info("Logger reload signal was received"); - if (!logger_pid) { - say_info("Logger isn't started. Signal was skipped"); - return; - } - if (kill(logger_pid, SIGHUP) == 0) { - say_info("SIGHUP was sent to logger"); - } else { - say_syserror("kill -HUP <LoggerPID(%d)>", logger_pid); - } -} - void say_logger_init(int nonblock) { @@ -110,7 +96,7 @@ say_logger_init(int nonblock) setpgid(0, 0); execve(argv[0], argv, envp); say_syserror("Can't start logger: %s", cfg.logger); - _exit(-1); + _exit(EXIT_FAILURE); } close(pipefd[0]); dup2(pipefd[1], STDERR_FILENO); diff --git a/core/tarantool.m b/core/tarantool.m index 12b2ce6f119799772b2ea9ad3ef37c0e8172a181..02f77a09543b5264a3cc675721fd656fb451d983 100644 --- a/core/tarantool.m +++ b/core/tarantool.m @@ -71,8 +71,6 @@ static void *main_opt = NULL; struct tarantool_cfg cfg; struct recovery_state *recovery_state; static ev_signal *sigs = NULL; -const char *cmd_line_logger = NULL; -const char *cmd_line_pidfile = NULL; bool init_storage, booting = true; @@ -97,20 +95,7 @@ load_cfg(struct tarantool_cfg *conf, i32 check_rdonly) parse_cfg_file_tarantool_cfg(conf, f, check_rdonly, &n_accepted, &n_skipped); - /* command-line option override config */ - if (cmd_line_logger) { - free(conf->logger); - conf->logger = strdup(cmd_line_logger); - } - - /* command-line option override config */ - if (cmd_line_pidfile) { - free(conf->pid_file); - conf->pid_file = strdup(cmd_line_pidfile); - } - fclose(f); - if (check_cfg_tarantool_cfg(conf) != 0) return -1; @@ -261,7 +246,7 @@ signal_free(void) return; int i; - for (i = 0 ; i < 5 ; i++) + for (i = 0 ; i < 4 ; i++) ev_signal_stop(&sigs[i]); } @@ -282,8 +267,8 @@ signal_init(void) exit(EX_OSERR); } - sigs = palloc(eter_pool, sizeof(ev_signal) * 5); - memset(sigs, 0, sizeof(ev_signal) * 5); + sigs = palloc(eter_pool, sizeof(ev_signal) * 4); + memset(sigs, 0, sizeof(ev_signal) * 4); ev_signal_init(&sigs[0], (void*)snapshot, SIGUSR1); ev_signal_start(&sigs[0]); ev_signal_init(&sigs[1], (void*)signal_cb, SIGINT); @@ -292,8 +277,6 @@ signal_init(void) ev_signal_start(&sigs[2]); ev_signal_init(&sigs[3], (void*)signal_cb, SIGHUP); ev_signal_start(&sigs[3]); - ev_signal_init(&sigs[4], (void*)say_logger_reinit, SIGUSR2); - ev_signal_start(&sigs[4]); atexit(signal_free); } @@ -466,18 +449,6 @@ main(int argc, char **argv) NULL, "increase verbosity level in log messages"), gopt_option('B', 0, gopt_shorts('B'), gopt_longs("background"), NULL, "redirect input/output streams to a log file and run as daemon"), - gopt_option('l', GOPT_ARG, gopt_shorts('l'), - gopt_longs("logger"), - "=LOGGER", - "defines logger process (like the same " - "config option)" - ), - gopt_option('p', GOPT_ARG, gopt_shorts('p'), - gopt_longs("pid_file"), - "=PIDFILE", - "defines pid_file (like the same " - "config option)" - ), gopt_option('h', 0, gopt_shorts('h', '?'), gopt_longs("help"), NULL, "display this help and exit"), gopt_option('V', 0, gopt_shorts('V'), gopt_longs("version"), @@ -513,9 +484,6 @@ main(int argc, char **argv) return mod_cat(cat_filename); } - gopt_arg(opt, 'p', &cmd_line_pidfile); - gopt_arg(opt, 'l', &cmd_line_logger); - gopt_arg(opt, 'c', &cfg_filename); /* if config is not specified trying ./tarantool.cfg then /etc/tarantool.cfg */ if (cfg_filename == NULL) { @@ -630,8 +598,6 @@ main(int argc, char **argv) exit(EXIT_SUCCESS); } - say_logger_init(cfg.logger_nonblock); - if (gopt(opt, 'B')) { if (cfg.logger == NULL) { say_crit("--background requires 'logger' configuration option to be set"); @@ -643,6 +609,7 @@ main(int argc, char **argv) create_pid(); } + say_logger_init(cfg.logger_nonblock); /* init process title */ if (cfg.custom_proc_title == NULL) { diff --git a/debian/rules b/debian/rules index 711364ae0b6049e78975d97df09a2b2a8f70bdda..2201b4aa8b25bf1ed652014854369f1e74c221a1 100755 --- a/debian/rules +++ b/debian/rules @@ -42,8 +42,6 @@ install/tarantool-client-dbg:: rm -fr debian/tarantool-client-dbg/usr/share/doc/tarantool-client-dbg install/tarantool:: - pod2man -c 'high performance key/value storage server' \ - debian/tarantool_box.pod > build-area/tarantool_box.1 # make -C build-area test-force || /bin/true install/tarantool-common:: @@ -51,8 +49,3 @@ install/tarantool-common:: debian/tarantool_instance.pod > build-area/tarantool_instance.1 install -m0755 extra/logger.pl \ debian/tarantool-common/usr/lib/tarantool/logger - -install/tarantool-client:: - pod2man -c 'readline SQL-client for tarantool.' \ - debian/tarantool.pod > build-area/tarantool.1 - diff --git a/debian/scripts/tarantool_instance b/debian/scripts/tarantool_instance index 3fd55c0a4c04106d81e71eb340e0b1d23efc6d20..8fa35dc5f223a71171993af470d4b1af6bd76731 100755 --- a/debian/scripts/tarantool_instance +++ b/debian/scripts/tarantool_instance @@ -73,16 +73,15 @@ ulimit -c unlimited comment_str="#### - commented by init script" sed "s/^[[:space:]]*file_descriptors.*/# & $comment_str/" $CFG > $SCFG -$BOX -c $SCFG -v --check-config - +echo "pid_file = $PID" >> $SCFG +echo "logger = \"cat >> $LOG\"" >> $SCFG -# echo "pid_file = $PID" >> $SCFG -# echo "logger = \"cat >> $LOG\"" >> $SCFG +$BOX -c $SCFG -v --check-config if [ ! -d $RUNDIR ]; then install -d -otarantool -gtarantool -m0750 $RUNDIR cd $RUNDIR - if ! $SSD --start $SSDARGS $BOX -- --init-storage -v -c $SCFG -p $PID; + if ! $SSD --start $SSDARGS $BOX -- --init-storage -v -c $SCFG; then rm -fr $RUNDIR exit 25 @@ -95,7 +94,7 @@ else echo -n " Stopping '$NAME' ... " fi -if $SSD --$ACTION $SSDARGS $BOX -- -B -v -c $SCFG -p $PID -l "$LOGGER"; then +if $SSD --$ACTION $SSDARGS $BOX -- -B -v -c $SCFG; then echo "ok" else ret=$? diff --git a/debian/tarantool-client.manpages b/debian/tarantool-client.manpages index ac727e726852372327b343e1466b0c79fa49396a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/debian/tarantool-client.manpages +++ b/debian/tarantool-client.manpages @@ -1 +0,0 @@ -build-area/tarantool.1 diff --git a/debian/tarantool.manpages b/debian/tarantool.manpages index f5d1de55615ad716fc7b71e4993c1f29aaa3319e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/debian/tarantool.manpages +++ b/debian/tarantool.manpages @@ -1 +0,0 @@ -build-area/tarantool_box.1 diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 8773e58b4d49fe14e08a8a1a4b4d6904ecbfe33d..ea089d03b1507b4ee173efecc247f0d10867570e 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,2 +1,3 @@ -add_subdirectory(user) -add_subdirectory(developer) +add_subdirectory(user EXCLUDE_FROM_ALL) +add_subdirectory(developer EXCLUDE_FROM_ALL) +add_subdirectory(man) diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..7cd20680032d2c95a771ceda97a09fbd4b47ca3e --- /dev/null +++ b/doc/man/CMakeLists.txt @@ -0,0 +1,12 @@ + +add_custom_target(man ALL + COMMAND ${POD2MAN} -c 'high performance key/value storage server' + ${CMAKE_SOURCE_DIR}/doc/man/tarantool_box.pod > ${PROJECT_BINARY_DIR}/doc/man/tarantool_box.1 + COMMAND ${POD2MAN} -c 'readline SQL-client for tarantool' + ${CMAKE_SOURCE_DIR}/doc/man/tarantool.pod > ${PROJECT_BINARY_DIR}/doc/man/tarantool.1 + ) + +install(FILES ${PROJECT_BINARY_DIR}/doc/man/tarantool_box.1 DESTINATION "${CMAKE_MAN_DIR}") +if (ENABLE_CLIENT) + install(FILES ${PROJECT_BINARY_DIR}/doc/man/tarantool.1 DESTINATION "${CMAKE_MAN_DIR}") +endif() diff --git a/doc/man/tarantool.1 b/doc/man/tarantool.1 new file mode 100644 index 0000000000000000000000000000000000000000..b7877c735edc3107b89900ce96853b2cbc517084 --- /dev/null +++ b/doc/man/tarantool.1 @@ -0,0 +1,152 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "TARANTOOL 1" +.TH TARANTOOL 1 "2012-02-16" "perl v5.14.2" "readline SQL-client for tarantool" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +tarantool \- readline SQL\-client for tarantool. +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& tarantool [OPTIONS] +.Ve +.SH "Command-line options" +.IX Header "Command-line options" +.IP "\-a <host>, \-\-host <host>" 4 +.IX Item "-a <host>, --host <host>" +Defines Server address. +.IP "\-p <port>, \-\-port <port>" 4 +.IX Item "-p <port>, --port <port>" +Defines server port. +.IP "\-m <port>, \-\-port\-admin <port>" 4 +.IX Item "-m <port>, --port-admin <port>" +Defines Server admin port. +.IP "\-h, \-\-help" 4 +.IX Item "-h, --help" +Displays helpscreen and exits. diff --git a/debian/tarantool.pod b/doc/man/tarantool.pod similarity index 100% rename from debian/tarantool.pod rename to doc/man/tarantool.pod diff --git a/doc/man/tarantool_box.1 b/doc/man/tarantool_box.1 new file mode 100644 index 0000000000000000000000000000000000000000..df7234050e9af36980fda176fe058eb62941bbb8 --- /dev/null +++ b/doc/man/tarantool_box.1 @@ -0,0 +1,202 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "TARANTOOL_BOX 1" +.TH TARANTOOL_BOX 1 "2012-02-16" "perl v5.14.2" "high performance key/value storage server" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +tarantool_box \- open\-source NoSQL database +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& tarantool_box [OPTIONS] +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Tarantool is an open-source NoSQL database, developed by Mail.ru. +.PP +Its key properties include: +.IP "\(bu" 4 +Licence: simplified \s-1BSD\s0 +.IP "\(bu" 4 +All data is maintained in \s-1RAM\s0 +.IP "\(bu" 4 +Data persistence is implemented using Write Ahead Log and snapshotting +.IP "\(bu" 4 +Supports asynchronous replication and hot standby +.IP "\(bu" 4 +Uses coroutines and asynchronous I/O to implement +high-performance lock-free access to data +.IP "\(bu" 4 +Available on Linux and FreeBSD +.IP "\(bu" 4 +Stored procedures in Lua are supported. +.SS "Data model" +.IX Subsection "Data model" +The basic atom of storage in Tarantool is called tuple. A tuple +can have arbitrary number of fields. The first field in the tuple +is always the identifying unique key. Tuples form spaces. It is +possible to search tuples in spaces using the primary or secondary +keys. Fields in a tuple are type-agnostic. It is possible to change, +as well as add or remove fields. +.SH "Command-line options" +.IX Header "Command-line options" +.IP "\-\-cfg\-get=KEY" 4 +.IX Item "--cfg-get=KEY" +Returns a value from configuration file described by \fB\s-1KEY\s0\fR. +.IP "\-\-check\-config" 4 +.IX Item "--check-config" +Checks configuration file for errors. +.IP "\-c \s-1FILE\s0, \-\-config=FILE" 4 +.IX Item "-c FILE, --config=FILE" +Points a path to configuration file (default: \fB/etc/tarantool.cfg\fR). +.IP "\-\-cat=FILE" 4 +.IX Item "--cat=FILE" +Cats snapshot file to stdout in readable format and exits. +.IP "\-\-init\-storage" 4 +.IX Item "--init-storage" +Initializes storage (an empty snapshot file) and exits. +.IP "\-v, \-\-verbose" 4 +.IX Item "-v, --verbose" +Increases verbosity level in log messages. +.IP "\-B, \-\-background" 4 +.IX Item "-B, --background" +Redirects input/output streams to a log file and runs as +daemon. +.IP "\-l \s-1LOGGER\s0, \-\-logger=LOGGER" 4 +.IX Item "-l LOGGER, --logger=LOGGER" +Defines logger process (like the same config option). +.IP "\-p \s-1PIDFILE\s0, \-\-pid_file=PIDFILE" 4 +.IX Item "-p PIDFILE, --pid_file=PIDFILE" +Defines pid_file (like the same config option). +.IP "\-h, \-\-help" 4 +.IX Item "-h, --help" +Displays helpscreen and exits. +.IP "\-V, \-\-version" 4 +.IX Item "-V, --version" +Prints program version and exits. diff --git a/debian/tarantool_box.pod b/doc/man/tarantool_box.pod similarity index 100% rename from debian/tarantool_box.pod rename to doc/man/tarantool_box.pod diff --git a/include/say.h b/include/say.h index 65cf3d5dc64c5ea167f77c8e1e4cd25f3fe32707..748d01d73f554a16892135743a750778ce640004 100644 --- a/include/say.h +++ b/include/say.h @@ -44,7 +44,6 @@ enum say_level { extern int sayfd; void say_logger_init(int nonblock); -void say_logger_reinit(void); void vsay(int level, const char *filename, int line, const char *error, const char *format, va_list ap) __attribute__ ((format(FORMAT_PRINTF, 5, 0))); diff --git a/mod/box/box.m b/mod/box/box.m index 708830bd6886ac53cdaad423f8756cd0cbe43a30..9211153d3c8f6a86e3d0fbb9c64afb81a0714696 100644 --- a/mod/box/box.m +++ b/mod/box/box.m @@ -49,6 +49,8 @@ #include "box_lua.h" #include "tree.h" +extern pid_t logger_pid; + static void box_process_ro(u32 op, struct tbuf *request_data); static void box_process_rw(u32 op, struct tbuf *request_data); @@ -1723,6 +1725,7 @@ mod_info(struct tbuf *out) tbuf_printf(out, " version: \"%s\"" CRLF, tarantool_version()); tbuf_printf(out, " uptime: %i" CRLF, (int)tarantool_uptime()); tbuf_printf(out, " pid: %i" CRLF, getpid()); + tbuf_printf(out, " logger_pid: %i" CRLF, logger_pid); tbuf_printf(out, " wal_writer_pid: %" PRIi64 CRLF, (i64) recovery_state->wal_writer->pid); tbuf_printf(out, " lsn: %" PRIi64 CRLF, recovery_state->confirmed_lsn); diff --git a/test/box/admin.result b/test/box/admin.result index 303872efd3b870acdfa4d233f3c39de5173d5e0d..5bcc241b57ef67ad1f528aaef012e4a05406fcc8 100644 --- a/test/box/admin.result +++ b/test/box/admin.result @@ -95,6 +95,7 @@ info: version: "1.minor.patch-<rev>-<commit>" uptime: <uptime> pid: <pid> + logger_pid: <pid> wal_writer_pid: <pid> lsn: 3 recovery_lag: 0.000 diff --git a/test/box/admin.test b/test/box/admin.test index 29bed8a8c1fef7230d671b70750160c920c19fc3..986b4cb56ff5dc2ce384c22544770fce40dfd9b2 100644 --- a/test/box/admin.test +++ b/test/box/admin.test @@ -13,6 +13,7 @@ exec admin "save snapshot" exec sql "delete from t0 where k0 = 1" sys.stdout.push_filter("(\d)\.\d\.\d(-\d+-\w+)?", "\\1.minor.patch-<rev>-<commit>") sys.stdout.push_filter("pid: \d+", "pid: <pid>") +sys.stdout.push_filter("logger_pid: \d+", "pid: <pid>") sys.stdout.push_filter("uptime: \d+", "uptime: <uptime>") sys.stdout.push_filter("uptime: \d+", "uptime: <uptime>") sys.stdout.push_filter("(/\S+)+/tarantool", "tarantool") diff --git a/test/box/args.result b/test/box/args.result index 92cb78ea0733c3806abc2d55ac50d06e48b9c986..eaf9313bfbb06245c6f0cbd792e53912e94e04b6 100644 --- a/test/box/args.result +++ b/test/box/args.result @@ -12,8 +12,6 @@ Usage: tarantool_box [OPTIONS] -v, --verbose increase verbosity level in log messages -B, --background redirect input/output streams to a log file and run as daemon - -l, --logger=LOGGER defines logger process (like the same config option) - -p, --pid_file=PIDFILE defines pid_file (like the same config option) -h, --help display this help and exit -V, --version print program version and exit @@ -34,8 +32,6 @@ Usage: tarantool_box [OPTIONS] -v, --verbose increase verbosity level in log messages -B, --background redirect input/output streams to a log file and run as daemon - -l, --logger=LOGGER defines logger process (like the same config option) - -p, --pid_file=PIDFILE defines pid_file (like the same config option) -h, --help display this help and exit -V, --version print program version and exit