George Baugh 2 лет назад
Родитель
Сommit
4b8368a3dd
2 измененных файлов с 7 добавлено и 5 удалено
  1. 6 5
      config/nginx-unit/Makefile
  2. 1 0
      config/nginx-unit/config.json.tmpl

+ 6 - 5
config/nginx-unit/Makefile

@@ -1,13 +1,14 @@
+WD=$(shell realpath "$$PWD/../..")
+
 .PHONY: install
 install:
-	sudo chmod 0660 /var/run/control.unit.sock
-	export WD=`realpath "$$PWD/../.."`
-	[ -n "$$WD" ] || ( echo "cannot determine path to TCMS directory" && /bin/false )
+	[ -n "$(WD)" ] || ( echo "cannot determine path to TCMS directory" && /bin/false )
 	[ -n "$$PERSON" ] || ( echo "Please set the PERSON environment variable before running (user to run tcms as)" && /bin/false )
+	sudo chmod 0660 /var/run/control.unit.sock
+	sudo chown :$$PERSON /var/run/control.unit.sock
 	sed -e s/__USER__/$$PERSON/g config.json.tmpl > config.json.tmp1
-	sed -e 's|__WD__|'$$WD'|g' config.json.tmp1 > config.json
+	sed -e 's|__WD__|'$(WD)'|g' config.json.tmp1 > config.json
 	rm config.json.tmp1
-	/bin/false
 	curl -X PUT --data-binary @config.json --unix-socket /var/run/control.unit.sock http://localhost/config
 
 .PHONY: restart

+ 1 - 0
config/nginx-unit/config.json.tmpl

@@ -11,6 +11,7 @@
          },
          "limits": {
             "requests": 1000
+         },
          "processes": {
             "spare": 5,
             "max": 100,