You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2018/06/06 09:44:35 UTC
[ambari] branch trunk updated: AMBARI-24040. Infra Solr start/stop
should be idempotent. (#1473)
This is an automated email from the ASF dual-hosted git repository.
oleewere pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 2727730 AMBARI-24040. Infra Solr start/stop should be idempotent. (#1473)
2727730 is described below
commit 2727730f243895762d51a35c09846b612bdd646b
Author: Olivér Szabó <ol...@gmail.com>
AuthorDate: Wed Jun 6 11:44:32 2018 +0200
AMBARI-24040. Infra Solr start/stop should be idempotent. (#1473)
* AMBARI-24040. Infra Solr start/stop should be idempotent.
* AMBARI-24040. Remove as_sudo import
---
.../0.1.0/package/scripts/infra_solr.py | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/infra_solr.py b/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/infra_solr.py
index 502943e..5ae228b 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/infra_solr.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/infra_solr.py
@@ -59,11 +59,15 @@ class InfraSolr(Script):
setup_solr_znode_env()
start_cmd = format('{solr_bindir}/solr start -cloud -noprompt -s {infra_solr_datadir} -Dsolr.kerberos.name.rules=\'{infra_solr_kerberos_name_rules}\' 2>&1') \
if params.security_enabled else format('{solr_bindir}/solr start -cloud -noprompt -s {infra_solr_datadir} 2>&1')
+
+ check_process = format("{sudo} test -f {infra_solr_pidfile} && {sudo} pgrep -F {infra_solr_pidfile}")
+
piped_start_cmd = format('{start_cmd} | tee {infra_solr_log}') + '; (exit "${PIPESTATUS[0]}")'
Execute(
piped_start_cmd,
environment={'SOLR_INCLUDE': format('{infra_solr_conf}/infra-solr-env.sh')},
user=params.infra_solr_user,
+ not_if=check_process,
logoutput=True
)
@@ -77,7 +81,6 @@ class InfraSolr(Script):
Execute(piped_stop_cmd,
environment={'SOLR_INCLUDE': format('{infra_solr_conf}/infra-solr-env.sh')},
user=params.infra_solr_user,
- only_if=format("test -f {prev_infra_solr_pidfile}"),
logoutput=True
)
@@ -156,5 +159,17 @@ class InfraSolr(Script):
pkg_provider.remove_package('ambari-infra-solr', context, ignore_dependencies=True)
pkg_provider.upgrade_package('ambari-infra-solr', context)
+ def get_log_folder(self):
+ import params
+ return params.infra_solr_log_dir
+
+ def get_user(self):
+ import params
+ return params.infra_solr_user
+
+ def get_pid_files(self):
+ import status_params
+ return [status_params.infra_solr_pidfile]
+
if __name__ == "__main__":
InfraSolr().execute()
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
oleewere@apache.org.