2 ##############################################################################
3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 : ${YARDSTICK_REPO_DIR:='/home/opnfv/repos/yardstick'}
13 # generate uwsgi config file
14 mkdir -p /etc/yardstick
16 # create api log directory
17 mkdir -p /var/log/yardstick
19 # create yardstick.sock for communicating
20 touch /var/run/yardstick.sock
22 uwsgi_config='/etc/yardstick/yardstick.ini'
23 if [[ ! -e "${uwsgi_config}" ]];then
25 cat << EOF > "${uwsgi_config}"
29 chdir = ${YARDSTICK_REPO_DIR}/api
37 callable = app_wrapper
40 daemonize= /var/log/yardstick/uwsgi.log
41 socket = /var/run/yardstick.sock
43 if [[ "${YARDSTICK_VENV}" ]];then
44 echo "virtualenv = ${YARDSTICK_VENV}" >> "${uwsgi_config}"