3 ##############################################################################
4 # Copyright (c) 2017 ZTE Corporation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
23 # Supported by osprofiler but not used in doctor at the moment
25 # $TROVE_CONDUCTOR_CONF
26 # $TROVE_GUESTAGENT_CONF
27 # $TROVE_TASKMANAGER_CONF
33 function install_doctor {
38 function configure_doctor {
39 for conf in ${CONF_FILES[@]}; do
42 iniset $conf profiler enabled true
43 iniset $conf profiler trace_sqlalchemy true
44 iniset $conf profiler hmac_keys $(iniget $conf profiler hmac_keys),${DOCTOR_HMAC_KEYS:=doctor}
45 iniset $conf profiler connection_string ${OSPROFILER_CONNECTION_STRING:=redis://127.0.0.1:6379}
50 function init_doctor {
55 # check for service enabled
56 if is_service_enabled doctor; then
58 if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
59 # Set up system services
60 echo_summary "Configuring system services Doctor"
61 # install_package cowsay
63 elif [[ "$1" == "stack" && "$2" == "install" ]]; then
64 # Perform installation of service source
65 echo_summary "Installing Doctor"
68 elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
69 # Configure after the other layer 1 and 2 services have been configured
70 echo_summary "Configuring Doctor"
73 elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
74 # Initialize and start the doctor service
75 echo_summary "Initializing Doctor"
79 if [[ "$1" == "unstack" ]]; then
80 # Shut down doctor services
85 if [[ "$1" == "clean" ]]; then
86 # Remove state and transient data
87 # Remember clean.sh first calls unstack.sh