Ver código fonte

fix ota service permission issue

xuqiang 3 meses atrás
pai
commit
4f91a6d251
2 arquivos alterados com 6 adições e 4 exclusões
  1. 4 2
      services/otaserver/Makefile
  2. 2 2
      services/otaserver/scripts/run.sh

+ 4 - 2
services/otaserver/Makefile

@@ -1,7 +1,9 @@
+all: build release
+
 build:
 	pyinstaller otaserver.spec
 
-release:
+release: build
 	mkdir -p ./release/otaserver
 	rm -rf ./release/otaserver/*
 	pyinstaller otaserver.spec
@@ -11,7 +13,7 @@ release:
 	cp -r ./dist ./release/otaserver/bin
 	cp -f ./otaserver.service ./release/otaserver
 
-install:
+install: build
 	mkdir -p /usr/local/otaserver
 	cp -r ./dist /usr/local/otaserver/bin
 	cp -f ./run.sh /usr/local/otaserver

+ 2 - 2
services/otaserver/scripts/run.sh

@@ -59,8 +59,8 @@ esac
 
 echo "create a symbolic link..."
 rm -rf $dst_workspace
-ln -sf /userdata/workspace $dst_workspace
-chown -h forlinx:forlinx $dst_workspace
+ln -sf $src_workspace $dst_workspace
+chown -R forlinx:forlinx $src_workspace
 
 echo "restarting app..."
 systemctl enable --now monitor