mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'master' of github.com:triAGENS/ArangoDB into devel
Conflicts: Makefile.local arangod/Documentation/command-line-options.dox arangod/RestServer/ArangoServer.cpp build.sh html/admin/js/master.js
This commit is contained in:
commit
aef20e2887
|
@ -6,11 +6,11 @@
|
|||
\__,_|_| \__,_|_| |_|\__, |\___/|___/_| |_|
|
||||
|___/
|
||||
|
||||
Welcome to arangosh 0.5.0. Copyright (c) 2012 triAGENS GmbH.
|
||||
Welcome to arangosh 1.x.y. Copyright (c) 2012 triAGENS GmbH.
|
||||
Using Google V8 3.9.4 JavaScript engine.
|
||||
Using READLINE 6.1.
|
||||
|
||||
Connected to Arango DB 127.0.0.1:8529 Version 0.5.0
|
||||
Connected to Arango DB 127.0.0.1:8529 Version 1.x.y
|
||||
|
||||
------------------------------------- Help -------------------------------------
|
||||
Predefined objects:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
> ./arangod /tmp/vocbase
|
||||
2012-05-13T12:37:08Z [8145] INFO using built-in JavaScript startup files
|
||||
2012-05-13T12:37:08Z [8145] INFO ArangoDB (version 0.5.0) is ready for business
|
||||
2012-05-13T12:37:08Z [8145] INFO HTTP client/admin port: 127.0.0.1:8529
|
||||
2012-05-13T12:37:08Z [8145] INFO ArangoDB (version 1.x.y) is ready for business
|
||||
2012-05-13T12:37:08Z [8145] INFO Have Fun!
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
> ./arangod --console --log error /tmp/vocbase
|
||||
ArangoDB shell [V8 version 3.9.4, DB version 0.5.0]
|
||||
ArangoDB shell [V8 version 3.9.4, DB version 1.x.y]
|
||||
|
||||
arango> 1 + 2;
|
||||
3
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
[database]
|
||||
directory= /tmp/ARANGO/var/arangodb
|
||||
# maximal-journal-size=33554432
|
||||
# remove-on-drop=true
|
||||
|
||||
[server]
|
||||
http-port = localhost:8529
|
||||
http-auth = no
|
||||
disable-admin-interface = no
|
||||
admin-port = localhost:8530
|
||||
admin-directory= ./html/admin
|
||||
threads = 5
|
||||
|
||||
[scheduler]
|
||||
threads = 3
|
||||
|
||||
[javascript]
|
||||
action-directory= ./js/actions/system
|
||||
modules-path = ./js/server/modules;./js/common/modules
|
||||
|
||||
[log]
|
||||
level = info
|
||||
severity = human
|
||||
# file = /tmp/arangod.log
|
|
@ -24,8 +24,8 @@ $release=${arangodb_release}
|
|||
################################################################################
|
||||
|
||||
d 0755 ${susr} ${sgrp} /etc/arangodb -
|
||||
d 0755 ${susr} ${sgrp} /etc/arangodb/${vers_dir} -
|
||||
f 0644 ${susr} ${sgrp} /etc/arangodb/${vers_dir}/arangod.conf.template ${project_dir}/Installation/arangod.conf.in
|
||||
d 0755 ${susr} ${sgrp} /etc/arangodb/ -
|
||||
c 0644 ${susr} ${sgrp} /etc/arangodb/arangod.conf ${project_dir}/Installation/arangod.conf
|
||||
|
||||
f 0755 ${susr} ${sgrp} ${sbindir}/arangod-${arangodb_version} ${project_dir}/bin/arangod
|
||||
l 000 ${rusr} ${rgrp} ${sbindir}/arangod ${sbindir}/arangod-${arangodb_version}
|
||||
|
@ -54,9 +54,9 @@ d 0755 ${susr} ${sgrp} /var/log/arangodb -
|
|||
## Pre/Post Install
|
||||
################################################################################
|
||||
|
||||
%postinstall <<EOF
|
||||
sed -e 's%@LOGDIR@%/var/log/arangodb%g' -e 's%@DATABASE@%${data_dir}/arangodb%g' -e 's%@STATICFILES@%${static_dir}/arangodb%g' /etc/arangodb/${vers_dir}/arangod.conf.template > /etc/arangodb/arangod.conf
|
||||
EOF
|
||||
## -----------------------------------------------------------------------------
|
||||
## MAC OS X
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
%ifdef macosx
|
||||
d 0755 ${rusr} ${rgrp} /Library/LaunchDaemons/ -
|
||||
|
@ -73,6 +73,10 @@ launchctl stop de.triagens.arango
|
|||
launchctl unload /Library/LaunchDaemons/org.arangodb.plist
|
||||
EOF
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
## LINUX
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
%else
|
||||
%preinstall <<EOF
|
||||
getent group arango >/dev/null || groupadd -r arango
|
||||
|
@ -80,19 +84,32 @@ getent passwd arango >/dev/null || useradd -r -g arango -d ${static_dir} -s /bin
|
|||
EOF
|
||||
%endif
|
||||
|
||||
%ifdef insserv
|
||||
## -----------------------------------------------------------------------------
|
||||
## CHKCONF
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
%ifdef chkconf
|
||||
f 0755 ${rusr} ${rgrp} ${initdir}/arangod ${project_dir}/Installation/${START_SCRIPT}
|
||||
|
||||
%postinstall <<EOF
|
||||
test -x /sbin/insserv && /sbin/insserv /etc/init.d/arango 2&>1 > /dev/null
|
||||
exit 0
|
||||
chkconfig --level ${runlevels} arangod on
|
||||
EOF
|
||||
|
||||
%preremove <<EOF
|
||||
/etc/init.d/arango stop 2&>1 > /dev/null
|
||||
test -x /sbin/insserv && /sbin/insserv -r /etc/init.d/arango 2&>1 > /dev/null
|
||||
exit 0
|
||||
chkconfig --del arangod
|
||||
rcarangod stop || true
|
||||
EOF
|
||||
%endif
|
||||
|
||||
%else
|
||||
|
||||
%system linux
|
||||
i 0755 ${rusr} ${rgrp} arango ${project_dir}/Installation/${START_SCRIPT} ${runlevels}
|
||||
l 000 ${rusr} ${rgrp} ${sbindir}/rcarango /etc/init.d/arango
|
||||
i 0755 ${rusr} ${rgrp} arangod ${project_dir}/Installation/${START_SCRIPT} runlevel(${runlevels})
|
||||
|
||||
%endif
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
## RC skript
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
%system linux
|
||||
l 000 ${rusr} ${rgrp} ${sbindir}/rcarangod /etc/init.d/arangod
|
||||
|
|
|
@ -124,6 +124,7 @@ WIKI = \
|
|||
SimpleQueries \
|
||||
UserManual \
|
||||
UserManualBasics \
|
||||
UserManualArangosh \
|
||||
Aql \
|
||||
AqlExamples \
|
||||
jsUnity
|
||||
|
|
|
@ -1288,6 +1288,7 @@ WIKI = \
|
|||
SimpleQueries \
|
||||
UserManual \
|
||||
UserManualBasics \
|
||||
UserManualArangosh \
|
||||
Aql \
|
||||
AqlExamples \
|
||||
jsUnity
|
||||
|
|
|
@ -32,6 +32,7 @@ publish-pdf: $(OUTPUT_FOLDER)
|
|||
scp Doxygen/latex/install-manual.pdf $(OUTPUT_FOLDER)
|
||||
scp Doxygen/latex/user-manual.pdf $(OUTPUT_FOLDER)
|
||||
scp Doxygen/latex/ref-manual.pdf $(OUTPUT_FOLDER)
|
||||
scp arangod/Documentation/arangodb_1.0_shell_reference_card.pdf $(OUTPUT_FOLDER)
|
||||
|
||||
$(OUTPUT_FOLDER):
|
||||
mkdir -p $(OUTPUT_FOLDER)
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -188,10 +188,11 @@
|
|||
/// @copydetails triagens::rest::ApplicationEndpointServer::_sslCipherList
|
||||
///
|
||||
/// @anchor CommandLineArangoDisableAdminInterface
|
||||
/// @CMDOPT{--server.disable-admin-interface}
|
||||
/// @CMDOPT{--disable-admin-interface @CA{value}}
|
||||
///
|
||||
/// If this option is specified, then the HTML admininstration interface at
|
||||
/// URL http://server:port/ will be disabled and cannot used by any user at all.
|
||||
/// If this option is specified and @CA{value} is @LIT{true}, then the HTML
|
||||
/// administration interface at URL @LIT{http://server:port/} will be disabled
|
||||
/// and cannot used by any user at all.
|
||||
///
|
||||
/// @anchor CommandLineArangoDirectory
|
||||
/// @copydetails triagens::arango::ArangoServer::_databasePath
|
||||
|
|
|
@ -49,17 +49,18 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@ref UserManual @ifnot XML @SPC(<a href="http://www.arangodb.org/manuals/user-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref DbaManual @ifnot XML @SPC(<a href="http://www.arangodb.org/manuals/dba-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref ImpManual @ifnot XML @SPC(<a href="http://www.arangodb.org/manuals/imp-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref UserManual @ifnot XML @SPC(<a href="user-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref DbaManual @ifnot XML @SPC(<a href="dba-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref ImpManual @ifnot XML @SPC(<a href="imp-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref Glossary</li>
|
||||
/// @ifnot XML <li><a href="arangodb_1.0_shell_reference_card.pdf">Cheat Sheet</a></li> @endif
|
||||
/// </ul>
|
||||
///
|
||||
/// @section ArangoDBAdminManual ArangoDB's Administrator Manuals (Version @VERSION)
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@ref InstallManual @ifnot XML @SPC(<a href="http://www.arangodb.org/manuals/install-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref InstallManual @ifnot XML @SPC(<a href="install-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref Glossary</li>
|
||||
/// </ul>
|
||||
///
|
||||
|
@ -67,8 +68,8 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@ref ImplementorManual @ifnot XML @SPC(<a href="http://www.arangodb.org/manuals/implementor-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref RefManual @ifnot XML @SPC(<a href="http://www.arangodb.org/manuals/ref-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref ImplementorManual @ifnot XML @SPC(<a href="implementor-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref RefManual @ifnot XML @SPC(<a href="ref-manual.pdf">pdf</a>) @endif</li>
|
||||
/// <li>@ref Glossary</li>
|
||||
/// </ul>
|
||||
///
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- USER MANUAL
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @page UserManual ArangoDB's User Manual
|
||||
///
|
||||
|
@ -32,6 +36,7 @@
|
|||
/// <ul>
|
||||
/// <li>@ref UserManualBasics</li>
|
||||
/// <li>@ref FirstStepsArangoDB</li>
|
||||
/// <li>@ref UserManualArangosh</li>
|
||||
/// <li>@ref ShellCollection</li>
|
||||
/// <li>@ref ShellDocument</li>
|
||||
/// <li>@ref ShellEdge</li>
|
||||
|
@ -45,6 +50,7 @@
|
|||
/// @else
|
||||
/// @copydetails UserManualBasicsTOC
|
||||
/// @copydetails FirstStepsArangoDBTOC
|
||||
/// @copydetails UserManualArangoshTOC
|
||||
/// @copydetails ShellCollectionTOC
|
||||
/// @copydetails ShellDocumentTOC
|
||||
/// @copydetails ShellEdgeTOC
|
||||
|
@ -54,6 +60,10 @@
|
|||
/// @endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- USER MANUAL BASICS
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @page UserManualBasicsTOC
|
||||
///
|
||||
|
@ -227,7 +237,8 @@
|
|||
/// After the server has been @ref UserManualServerStartStop "started",
|
||||
/// you can use the ArangoDB shell (arangosh) to administrate the server. Without
|
||||
/// any arguments, the ArangoDB shell will try to contact the server
|
||||
/// on port 8529 on the localhost.
|
||||
/// on port 8529 on the localhost. For more information see @ref
|
||||
/// UserManualArangosh.
|
||||
///
|
||||
/// @TINYEXAMPLE{arangosh-start,starting the shell}
|
||||
///
|
||||
|
@ -258,6 +269,82 @@
|
|||
/// @EXAMPLE{start-emergency-console,emergency console}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- USER MANUAL ARANGOSH
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @page UserManualArangoshTOC
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>@ref UserManualArangosh
|
||||
/// </li>
|
||||
/// </ul>
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @page UserManualArangosh The Arango Shell
|
||||
///
|
||||
/// @EMBEDTOC{UserManualArangoshTOC}
|
||||
///
|
||||
/// @section UserManualArangoshOutput Arango Shell Output
|
||||
/////////////////////////////////////////////////////////
|
||||
///
|
||||
/// In general the Arango Shells prints its as output to standard output channel
|
||||
/// using the JSON stringifier.
|
||||
///
|
||||
/// @code
|
||||
/// arangosh> db.five.all().toArray();
|
||||
/// [{ _id : "2223655/3665447", _rev : 3665447, name : "one" },
|
||||
/// { _id : "2223655/3730983", _rev : 3730983, name : "two" },
|
||||
/// { _id : "2223655/3862055", _rev : 3862055, name : "four" },
|
||||
/// { _id : "2223655/3993127", _rev : 3993127, name : "three" }]
|
||||
/// @endcode
|
||||
///
|
||||
/// @FUN{start_pretty_print()}
|
||||
///
|
||||
/// While the standard JSON stringifier is very concise it is hard to read.
|
||||
/// Calling the function @FN{start_pretty_print} will enable the pretty printer
|
||||
/// which formats the output in a human readable way.
|
||||
///
|
||||
/// @code
|
||||
/// arangosh> start_pretty_print();
|
||||
/// using pretty printing
|
||||
/// arangosh> db.five.all().toArray();
|
||||
/// [
|
||||
/// {
|
||||
/// _id : "2223655/3665447",
|
||||
/// _rev : 3665447,
|
||||
/// name : "one"
|
||||
/// },
|
||||
/// {
|
||||
/// _id : "2223655/3730983",
|
||||
/// _rev : 3730983,
|
||||
/// name : "two"
|
||||
/// },
|
||||
/// {
|
||||
/// _id : "2223655/3862055",
|
||||
/// _rev : 3862055,
|
||||
/// name : "four"
|
||||
/// },
|
||||
/// {
|
||||
/// _id : "2223655/3993127",
|
||||
/// _rev : 3993127,
|
||||
/// name : "three"
|
||||
/// }
|
||||
/// ]
|
||||
/// @endcode
|
||||
///
|
||||
/// @FUN{start_pretty_print()}
|
||||
///
|
||||
/// The functions disable the pretty printer, switching back to the standard
|
||||
/// JSON output format.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Local Variables:
|
||||
// mode: c++
|
||||
// mode: outline-minor
|
||||
|
|
|
@ -436,9 +436,11 @@ void ArangoServer::buildApplicationServer () {
|
|||
// for this server we display our own options such as port to use
|
||||
// .............................................................................
|
||||
|
||||
bool disableAdminInterface = false;
|
||||
|
||||
additional["Server Options:help-admin"]
|
||||
("server.disable-authentication", &_disableAuthentication, "disable authentication for ALL client requests")
|
||||
("server.disable-admin-interface", "turn off the HTML admin interface")
|
||||
("server.disable-admin-interface", &disableAdminInterface, "turn off the HTML admin interface")
|
||||
;
|
||||
|
||||
additional["THREAD Options:help-admin"]
|
||||
|
@ -469,7 +471,7 @@ void ArangoServer::buildApplicationServer () {
|
|||
// disable access to the HTML admin interface
|
||||
// .............................................................................
|
||||
|
||||
if (_applicationServer->programOptions().has("server.disable-admin-interface")) {
|
||||
if (disableAdminInterface) {
|
||||
_applicationAdminServer->allowAdminDirectory(false);
|
||||
}
|
||||
|
||||
|
|
4
build.sh
4
build.sh
|
@ -7,8 +7,8 @@ echo
|
|||
|
||||
. config/detect_distro.sh
|
||||
|
||||
OPTIONS="--disable-dependency-tracking --enable-relative=devel"
|
||||
PREFIX="--prefix=/usr --sysconfdir=/etc"
|
||||
OPTIONS="--disable-dependency-tracking --disable-relative"
|
||||
PREFIX="--prefix=/usr --localstatedir=/var --sysconfdir=/etc"
|
||||
RESULTS="arangod arangosh arangoimp"
|
||||
USE_ICECC="no"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ var welcomeMSG = ""
|
|||
+ " \\__,_|_| \\__,_|_| |_|\\__, |\\___/|___/_| |_| \n"
|
||||
+ " |___/ \n"
|
||||
+ " \n"
|
||||
+ "Welcome to arangosh 1.0.beta Copyright (c) 2012 triAGENS GmbH."
|
||||
+ "Welcome to arangosh Copyright (c) 2012 triAGENS GmbH.";
|
||||
|
||||
var existingCharts;
|
||||
var statDivCount;
|
||||
|
@ -2561,7 +2561,7 @@ function drawConnections (placeholder, granularity) {
|
|||
}
|
||||
});
|
||||
|
||||
$(placeholder).bind('plothover', function(event, coords, item) {
|
||||
$(placeholder).bind('plothover', function(event, coords, item) {
|
||||
var self = $(this),
|
||||
api = $(this).qtip(), previousPoint, content;
|
||||
|
||||
|
@ -2586,7 +2586,7 @@ function drawConnections (placeholder, granularity) {
|
|||
api.elements.tooltip.stop(1, 1);
|
||||
// Show the tooltip, passing the coordinates
|
||||
api.show(coords);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -2680,7 +2680,7 @@ function drawRequests (placeholder, granularity) {
|
|||
}
|
||||
});
|
||||
|
||||
$(placeholder).bind('plothover', function(event, coords, item) {
|
||||
$(placeholder).bind('plothover', function(event, coords, item) {
|
||||
var self = $(this),
|
||||
api = $(this).qtip(), previousPoint, content;
|
||||
|
||||
|
@ -2709,7 +2709,7 @@ function drawRequests (placeholder, granularity) {
|
|||
api.elements.tooltip.stop(1, 1);
|
||||
// Show the tooltip, passing the coordinates
|
||||
api.show(coords);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -149,8 +149,7 @@ static void WritePidFile (string const& pidFile, int pid) {
|
|||
/// @brief forks a new process
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int forkProcess (string const& pidFile, string const& workingDirectory, string& current, ApplicationServer* applicationServer) {
|
||||
CheckPidFile(pidFile);
|
||||
static int forkProcess (string const& workingDirectory, string& current, ApplicationServer* applicationServer) {
|
||||
|
||||
// fork off the parent process
|
||||
pid_t pid = fork();
|
||||
|
@ -166,7 +165,7 @@ static int forkProcess (string const& pidFile, string const& workingDirectory, s
|
|||
// if we got a good PID, then we can exit the parent process
|
||||
if (pid > 0) {
|
||||
LOGGER_DEBUG << "started child process with pid " << pid;
|
||||
return 0;
|
||||
return pid;
|
||||
}
|
||||
|
||||
// reset the logging
|
||||
|
@ -184,9 +183,6 @@ static int forkProcess (string const& pidFile, string const& workingDirectory, s
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// write pid file
|
||||
WritePidFile(pidFile, sid);
|
||||
|
||||
// store current working directory
|
||||
int err = 0;
|
||||
current = FileUtils::currentDirectory(&err);
|
||||
|
@ -212,7 +208,7 @@ static int forkProcess (string const& pidFile, string const& workingDirectory, s
|
|||
close(STDOUT_FILENO);
|
||||
close(STDERR_FILENO);
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -339,16 +335,18 @@ int AnyServer::startupSupervisor () {
|
|||
|
||||
LOGGER_INFO << "starting up in supervisor mode";
|
||||
|
||||
CheckPidFile(_pidFile);
|
||||
|
||||
string current;
|
||||
int result = forkProcess(_pidFile, _workingDirectory, current, safe_cast<ApplicationServer*>(_applicationServer));
|
||||
int result = forkProcess(_workingDirectory, current, safe_cast<ApplicationServer*>(_applicationServer));
|
||||
|
||||
// main process
|
||||
if (result == 0) {
|
||||
if (result != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// child process
|
||||
else if (result == 1) {
|
||||
else {
|
||||
time_t startTime = time(0);
|
||||
time_t t;
|
||||
bool done = false;
|
||||
|
@ -373,10 +371,14 @@ int AnyServer::startupSupervisor () {
|
|||
prctl(PR_SET_NAME, title, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
WritePidFile(_pidFile, pid);
|
||||
|
||||
int status;
|
||||
waitpid(pid, &status, 0);
|
||||
|
||||
if (WIFEXITED(status)) {
|
||||
|
||||
// give information about cause of death
|
||||
if (WEXITSTATUS(status) == 0) {
|
||||
LOGGER_INFO << "child " << pid << " died of natural causes";
|
||||
done = true;
|
||||
|
@ -443,6 +445,17 @@ int AnyServer::startupSupervisor () {
|
|||
prepareServer();
|
||||
result = startupServer();
|
||||
|
||||
// remove pid file
|
||||
if (FileUtils::changeDirectory(current)) {
|
||||
if (! FileUtils::remove(_pidFile)) {
|
||||
LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "'";
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "', because directory '"
|
||||
<< current << "' is missing";
|
||||
}
|
||||
|
||||
// and stop
|
||||
exit(result);
|
||||
}
|
||||
|
@ -460,11 +473,6 @@ int AnyServer::startupSupervisor () {
|
|||
}
|
||||
}
|
||||
|
||||
// upps,
|
||||
else {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -475,18 +483,22 @@ int AnyServer::startupSupervisor () {
|
|||
int AnyServer::startupDaemon () {
|
||||
LOGGER_INFO << "starting up in daemon mode";
|
||||
|
||||
CheckPidFile(_pidFile);
|
||||
|
||||
string current;
|
||||
int result = forkProcess(_pidFile, _workingDirectory, current, safe_cast<ApplicationServer*>(_applicationServer));
|
||||
int result = forkProcess(_workingDirectory, current, safe_cast<ApplicationServer*>(_applicationServer));
|
||||
|
||||
// main process
|
||||
if (result == 0) {
|
||||
if (result != 0) {
|
||||
#ifdef TRI_HAVE_SYS_PRCTL_H
|
||||
prctl(PR_SET_NAME, "arangodb [daemon]", 0, 0, 0);
|
||||
prctl(PR_SET_NAME, "arangodb [daemon]", 0, 0, 0);
|
||||
#endif
|
||||
|
||||
WritePidFile(_pidFile, result);
|
||||
}
|
||||
|
||||
// child process
|
||||
else if (result == 1) {
|
||||
else {
|
||||
|
||||
// and startup server
|
||||
prepareServer();
|
||||
|
@ -504,11 +516,6 @@ int AnyServer::startupDaemon () {
|
|||
}
|
||||
}
|
||||
|
||||
// upps,
|
||||
else {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
104
packetize.sh
104
packetize.sh
|
@ -15,7 +15,7 @@ sgrp=arango
|
|||
package_type=""
|
||||
product_name="arangodb"
|
||||
project_name="arangodb"
|
||||
runlevels="runlevel(035)"
|
||||
runlevels="035"
|
||||
curl_version="curl -s -o - http://localhost:8529/_api/version"
|
||||
|
||||
# name of the epm configuration file
|
||||
|
@ -35,20 +35,19 @@ osvers=`uname -r | awk -F"." '{print $1 "." $2}'`
|
|||
prefix=/usr
|
||||
exec_prefix=${prefix}
|
||||
sbindir=${exec_prefix}/sbin
|
||||
initdir=/etc/init.d
|
||||
bindir=${exec_prefix}/bin
|
||||
data_dir=/var
|
||||
static_dir=${prefix}/share
|
||||
vers_dir=arango-${arangodb_version}
|
||||
docdir=${prefix}/share/doc/voc/${vers_dir}
|
||||
|
||||
|
||||
echo
|
||||
echo "########################################################"
|
||||
echo "Packetize on $TRI_OS_LONG"
|
||||
echo "########################################################"
|
||||
echo
|
||||
|
||||
|
||||
case $TRI_OS_LONG in
|
||||
|
||||
Linux-ArchLinux-*)
|
||||
|
@ -60,63 +59,54 @@ case $TRI_OS_LONG in
|
|||
echo "Using configuration for openSuSE"
|
||||
package_type="rpm"
|
||||
START_SCRIPT="rc.arangodb.OpenSuSE"
|
||||
runlevels="runlevel(035)"
|
||||
runlevels="035"
|
||||
docdir=${prefix}/share/doc/packages/voc/${vers_dir}
|
||||
|
||||
# export "insserv" for the epm configuration file
|
||||
export insserv="true"
|
||||
;;
|
||||
|
||||
Linux-Debian*)
|
||||
echo "Using configuration for Debian"
|
||||
package_type="deb"
|
||||
START_SCRIPT="rc.arangodb.Debian"
|
||||
runlevels="runlevel(035)"
|
||||
runlevels="035"
|
||||
|
||||
if [ ${TRI_MACH} == "x86_64" ] ; then
|
||||
TRI_MACH="amd64"
|
||||
fi
|
||||
|
||||
# export "insserv" for the epm configuration file
|
||||
export insserv="true"
|
||||
;;
|
||||
|
||||
Linux-CentOS-*)
|
||||
echo "Using configuration for Centos"
|
||||
package_type="rpm"
|
||||
START_SCRIPT="rc.arangodb.Centos"
|
||||
runlevels="runlevel(0235)"
|
||||
runlevels="0235"
|
||||
|
||||
# export "insserv" for the epm configuration file
|
||||
export insserv="true"
|
||||
# exports for the epm configuration file
|
||||
export chkconf="true"
|
||||
;;
|
||||
|
||||
Linux-Ubuntu-*)
|
||||
echo "Using configuration for Ubuntu"
|
||||
package_type="deb"
|
||||
START_SCRIPT="rc.arangodb.Ubuntu"
|
||||
runlevels="runlevel(02345)"
|
||||
runlevels="02345"
|
||||
|
||||
if [ ${TRI_MACH} == "x86_64" ] ; then
|
||||
TRI_MACH="amd64"
|
||||
fi
|
||||
|
||||
# export "insserv" for the epm configuration file
|
||||
export insserv="true"
|
||||
;;
|
||||
|
||||
Linux-LinuxMint-*)
|
||||
echo "Using configuration for LinuxMint"
|
||||
package_type="deb"
|
||||
START_SCRIPT="rc.arangodb.Ubuntu"
|
||||
runlevels="runlevel(02345)"
|
||||
runlevels="02345"
|
||||
|
||||
if [ ${TRI_MACH} == "x86_64" ] ; then
|
||||
TRI_MACH="amd64"
|
||||
fi
|
||||
|
||||
# export "insserv" for the epm configuration file
|
||||
export insserv="true"
|
||||
;;
|
||||
|
||||
Darwin*)
|
||||
|
@ -203,44 +193,45 @@ sudo -E mkdir -p ${hudson_base}/${archfolder}/buildroot
|
|||
echo
|
||||
echo "########################################################"
|
||||
echo "Export vars for epm"
|
||||
echo " export arangodb_version=$arangodb_version"
|
||||
echo " export arangodb_release=$arangodb_release"
|
||||
echo " export rusr=$rusr"
|
||||
echo " export rgrp=$rgrp"
|
||||
echo " export susr=$susr"
|
||||
echo " export sgrp=$sgrp"
|
||||
echo " export prefix=$prefix"
|
||||
echo " export exec_prefix=$exec_prefix"
|
||||
echo " export sbindir=$sbindir"
|
||||
echo " export arangodb_version=$arangodb_version"
|
||||
echo " export bindir=$bindir"
|
||||
echo " export data_dir=$data_dir"
|
||||
echo " export docdir=$docdir"
|
||||
echo " export exec_prefix=$exec_prefix"
|
||||
echo " export initdir=$initdir"
|
||||
echo " export prefix=$prefix"
|
||||
echo " export project_dir=${sfolder_name}"
|
||||
echo " export rgrp=$rgrp"
|
||||
echo " export runlevels=$runlevels"
|
||||
echo " export rusr=$rusr"
|
||||
echo " export sbindir=$sbindir"
|
||||
echo " export sgrp=$sgrp"
|
||||
echo " export static_dir=$static_dir"
|
||||
echo " export susr=$susr"
|
||||
echo " export vers_dir=$vers_dir"
|
||||
echo " export START_SCRIPT=$START_SCRIPT"
|
||||
echo " export runlevels=$runlevels"
|
||||
echo " export docdir=$docdir"
|
||||
echo " export project_dir=${sfolder_name}"
|
||||
echo "########################################################"
|
||||
echo
|
||||
|
||||
export arangodb_version
|
||||
export arangodb_release
|
||||
export rusr
|
||||
export rgrp
|
||||
export susr
|
||||
export sgrp
|
||||
export prefix
|
||||
export exec_prefix
|
||||
export sbindir
|
||||
export arangodb_version
|
||||
export bindir
|
||||
export data_dir
|
||||
export docdir
|
||||
export exec_prefix
|
||||
export initdir
|
||||
export prefix
|
||||
export project_dir=${sfolder_name}
|
||||
export rgrp
|
||||
export runlevels
|
||||
export rusr
|
||||
export sbindir
|
||||
export sgrp
|
||||
export static_dir
|
||||
export susr
|
||||
export vers_dir
|
||||
export START_SCRIPT
|
||||
export runlevels
|
||||
export docdir
|
||||
export project_dir=${sfolder_name}
|
||||
|
||||
|
||||
echo
|
||||
echo "########################################################"
|
||||
|
@ -272,7 +263,6 @@ cp -p ${hudson_base}/${archfolder}/${product_name}*.${package_type} ${sfolder_na
|
|||
echo "########################################################"
|
||||
echo
|
||||
|
||||
|
||||
start_server=
|
||||
stop_server=
|
||||
install_package=
|
||||
|
@ -283,8 +273,8 @@ unmount_install_package=
|
|||
case $TRI_OS_LONG in
|
||||
|
||||
Linux-openSUSE*)
|
||||
start_server=""
|
||||
stop_server=""
|
||||
start_server="sudo /etc/init.d/arangod start"
|
||||
stop_server="sudo /etc/init.d/arangod stop"
|
||||
|
||||
install_package="sudo rpm -i ${sfolder_name}/${package_name}"
|
||||
remove_package="sudo rpm -e $product_name"
|
||||
|
@ -292,32 +282,32 @@ case $TRI_OS_LONG in
|
|||
;;
|
||||
|
||||
Linux-Debian*)
|
||||
start_server=""
|
||||
stop_server=""
|
||||
start_server="sudo /etc/init.d/arangod start"
|
||||
stop_server="sudo /etc/init.d/arangod stop"
|
||||
|
||||
install_package="sudo dpkg -i ${sfolder_name}/${package_name}"
|
||||
remove_package="sudo dpkg --purge $product_name"
|
||||
;;
|
||||
|
||||
Linux-CentOS-*)
|
||||
start_server=""
|
||||
stop_server=""
|
||||
start_server="sudo /etc/init.d/arangod start"
|
||||
stop_server="sudo /etc/init.d/arangod stop"
|
||||
|
||||
install_package="sudo rpm -i ${sfolder_name}/${package_name}"
|
||||
remove_package="sudo rpm -e $product_name"
|
||||
;;
|
||||
|
||||
Linux-Ubuntu-*)
|
||||
start_server="sudo /etc/init.d/arango start"
|
||||
stop_server="sudo /etc/init.d/arango stop"
|
||||
start_server="sudo /etc/init.d/arangod start"
|
||||
stop_server="sudo /etc/init.d/arangod stop"
|
||||
|
||||
install_package="sudo dpkg -i ${sfolder_name}/${package_name}"
|
||||
remove_package="sudo dpkg --purge $product_name"
|
||||
;;
|
||||
|
||||
Linux-LinuxMint-*)
|
||||
start_server=""
|
||||
stop_server="sudo /etc/init.d/arango stop"
|
||||
start_server="sudo /etc/init.d/arangod start"
|
||||
stop_server="sudo /etc/init.d/arangod stop"
|
||||
|
||||
install_package="sudo dpkg -i ${sfolder_name}/${package_name}"
|
||||
remove_package="sudo dpkg --purge $product_name"
|
||||
|
@ -339,7 +329,6 @@ case $TRI_OS_LONG in
|
|||
|
||||
esac
|
||||
|
||||
|
||||
echo
|
||||
echo "########################################################"
|
||||
echo " INSTALL TEST "
|
||||
|
@ -384,6 +373,13 @@ fi
|
|||
echo "Successfully installed ${package_name}."
|
||||
echo "########################################################"
|
||||
|
||||
if [ "${start_server}x" != "x" ]; then
|
||||
echo "Start"
|
||||
echo " ${start_server}"
|
||||
${start_server}
|
||||
echo "########################################################"
|
||||
fi
|
||||
|
||||
echo "Check process"
|
||||
process=$(ps aux | grep arangod | grep -v grep)
|
||||
echo "$process"
|
||||
|
|
Loading…
Reference in New Issue