Skip to content

Commit 6455c90

Browse files
author
Daniel Mewes
committed
RethinkDB as a Windows service
This adds three new run modes: rethinkdb install-service rethinkdb remove-service rethinkdb run-service (only for internal use)
1 parent ff5aea9 commit 6455c90

File tree

7 files changed

+724
-18
lines changed

7 files changed

+724
-18
lines changed

WINDOWS.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
* CMake ("Windows Installer" from https://cmake.org/download/)
88

9-
* The `precompiled/` directory from a RethinkDB source tarball. It can
10-
be built on Linux by running `make dist`.
9+
* node.js with NPM (https://nodejs.org/en/download/)
1110

1211
* Cygwin (https://cygwin.com/install.html)
1312

@@ -27,4 +26,12 @@ make -j
2726
```
2827

2928
Will first download and build the libraries that RethinkDB needs, then
30-
build RethinkDB itself and place it in `build\Release_x64\rethinkdb.exe`
29+
build RethinkDB itself and place it in `build\Release_x64\rethinkdb.exe`
30+
31+
If `make` complains about missing files in `mk/gen`, run `mkdir mk/gen` manually.
32+
Then run `make -j` again.
33+
34+
On some systems, you might get permission errors like the ones described in
35+
https://github.com/npm/npm/issues/10826 during the build from npm.
36+
Try running `npm install -g JSONStream` and then run `make -j` again to work
37+
around this issue.

src/clustering/administration/logs/log_writer.cc

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -472,20 +472,11 @@ bool fallback_log_writer_t::write(const log_message_t &msg, std::string *error_o
472472
flockfile(write_stream);
473473
#endif
474474

475-
#ifdef _WIN32
476-
DWORD bytes_written = 0;
477-
BOOL res = WriteFile(filefd, console_formatted.data(), console_formatted.length(), &bytes_written, nullptr);
478-
if (!res || bytes_written != console_formatted.length()) {
479-
error_out->assign("cannot write to stdout/stderr: " + winerr_string(GetLastError()));
480-
return false;
481-
}
482-
#else
483-
ssize_t write_res = ::write(filefd, console_formatted.data(), console_formatted.length());
484-
if (write_res != static_cast<ssize_t>(console_formatted.length())) {
475+
size_t write_res = ::fwrite(console_formatted.data(), 1, console_formatted.length(), write_stream);
476+
if (write_res != console_formatted.length()) {
485477
error_out->assign("cannot write to stdout/stderr: " + errno_string(get_errno()));
486478
return false;
487479
}
488-
#endif
489480

490481
#ifdef _WIN32
491482
// WINDOWS TODO

0 commit comments

Comments
 (0)