2 ##############################################################################
3 # Copyright (c) 2016 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 ##############################################################################
12 nginx_config='/etc/nginx/conf.d/yardstick.conf'
14 if [[ ! -e "${nginx_config}" ]];then
16 cat << EOF > "${nginx_config}"
19 server_name localhost;
20 index index.htm index.html;
23 uwsgi_pass unix:///var/run/yardstick.sock;
27 echo "daemon off;" >> /etc/nginx/nginx.conf
30 # nginx service start when boot
31 supervisor_config='/etc/supervisor/conf.d/yardstick.conf'
33 if [[ ! -e "${supervisor_config}" ]];then
34 cat << EOF > "${supervisor_config}"
38 [program:yardstick_nginx]
40 command = service nginx restart
43 [program:yardstick_uwsgi]
45 directory = /home/opnfv/repos/yardstick/api
46 command = uwsgi -i yardstick.ini
51 # create api log directory
52 mkdir -p /var/log/yardstick
54 # create yardstick.sock for communicating
55 touch /var/run/yardstick.sock