-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: forgot about elasticsearch
- Loading branch information
1 parent
ccf8305
commit 6c3e490
Showing
1 changed file
with
44 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,41 +141,50 @@ in | |
postBuild = "${pkgs.coreutils}/bin/mkdir -p $out/plugins"; | ||
}; | ||
|
||
startScript = pkgs.writeShellScript "es-startup" '' | ||
set -e | ||
mkdir -m 0700 -p "${config.dataDir}" | ||
export ES_HOME=$(${pkgs.coreutils}/bin/realpath ${config.dataDir}) | ||
export ES_JAVA_OPTS="${toString config.extraJavaOptions}" | ||
export ES_PATH_CONF="${config.dataDir}/config" | ||
# Install plugins | ||
rm -f "${config.dataDir}/plugins" | ||
ln -sf ${esPlugins}/plugins "${config.dataDir}/plugins" | ||
rm -f "${config.dataDir}/lib" | ||
ln -sf ${config.package}/lib "${config.dataDir}/lib" | ||
rm -f "${config.dataDir}/modules" | ||
ln -sf ${config.package}/modules "${config.dataDir}/modules" | ||
# Create config dir | ||
mkdir -m 0700 -p "${config.dataDir}/config" | ||
rm -f "${config.dataDir}/config/elasticsearch.yml" | ||
cp ${elasticsearchYml} "${config.dataDir}/config/elasticsearch.yml" | ||
rm -f "${config.dataDir}/logging.yml" | ||
rm -f "${config.dataDir}/config/${loggingConfigFilename}" | ||
cp ${loggingConfigFile} "${config.dataDir}/config/${loggingConfigFilename}" | ||
mkdir -p "${config.dataDir}/scripts" | ||
rm -f "${config.dataDir}/config/jvm.options" | ||
cp ${config.package}/config/jvm.options "${config.dataDir}/config/jvm.options" | ||
# Create log dir | ||
mkdir -m 0700 -p "${config.dataDir}/logs" | ||
# Start it | ||
exec ${config.package}/bin/elasticsearch ${toString config.extraCmdLineOptions} | ||
''; | ||
|
||
startScript = pkgs.writeShellApplication { | ||
|
||
name = "es-startup"; | ||
runtimeInputs = [ pkgs.coreutils config.package ]; | ||
text = '' | ||
set -e | ||
mkdir -p "${config.dataDir}" | ||
chmod 0700 "${config.dataDir}" | ||
ES_HOME=$(${pkgs.coreutils}/bin/realpath ${config.dataDir}) | ||
ES_JAVA_OPTS="${toString config.extraJavaOptions}" | ||
ES_PATH_CONF="${config.dataDir}/config" | ||
export ES_HOME ES_JAVA_OPTS ES_PATH_CONF | ||
# Install plugins | ||
rm -f "${config.dataDir}/plugins" | ||
ln -sf ${esPlugins}/plugins "${config.dataDir}/plugins" | ||
rm -f "${config.dataDir}/lib" | ||
ln -sf ${config.package}/lib "${config.dataDir}/lib" | ||
rm -f "${config.dataDir}/modules" | ||
ln -sf ${config.package}/modules "${config.dataDir}/modules" | ||
# Create config dir | ||
mkdir -p "${config.dataDir}/config" | ||
chmod 0700 "${config.dataDir}/config" | ||
rm -f "${config.dataDir}/config/elasticsearch.yml" | ||
cp ${elasticsearchYml} "${config.dataDir}/config/elasticsearch.yml" | ||
rm -f "${config.dataDir}/logging.yml" | ||
rm -f "${config.dataDir}/config/${loggingConfigFilename}" | ||
cp ${loggingConfigFile} "${config.dataDir}/config/${loggingConfigFilename}" | ||
mkdir -p "${config.dataDir}/scripts" | ||
rm -f "${config.dataDir}/config/jvm.options" | ||
cp ${config.package}/config/jvm.options "${config.dataDir}/config/jvm.options" | ||
# Create log dir | ||
mkdir -p "${config.dataDir}/logs" | ||
chmod 0700 "${config.dataDir}/logs" | ||
# Start it | ||
elasticsearch ${toString config.extraCmdLineOptions} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
shivaraj-bh
Author
Member
|
||
''; | ||
}; | ||
in | ||
{ | ||
command = startScript; | ||
|
exec
was dropped?