diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index b52879b..838594e --- a/install.sh +++ b/install.sh @@ -2,9 +2,9 @@ port=$1 userid=$(id -un) groupid=$(id -gn) workdir=$(pwd) -package=$(base $workdir) +package=$(basename $workdir) -cat < $package.service [Unit] Wants=systemd-networkd.service @@ -21,24 +21,23 @@ SyslogIdentifier=$package [Install] WantedBy=multi-user.target -EOF > $workdir/$package.service +EOF -cat < $workdir/start.sh #!/usr/bin/bash $workdir/$package.env/bin/python $workdir/app/$package.py -p $port -EOF > $workdir/start.sh +EOF -cat < $workdir/stop.sh #!/usr/bin/bash ps -ef|grep "$package.py"|grep -v grep|awk '{print("kill -9", $2)}'|sh -EOF > $workdir/stop.sh +EOF chmod +x $workdir/*.sh python3 -m venv $package.env +$package.env/bin/pip install setuptools wheel $package.env/bin/pip install -r requirements.txt sudo mkdir /var/log/$package sudo cp $package.service /etc/systemd/system diff --git a/requirements.txt b/requirements.txt index 07d7314..579081d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ fasttext -git+https://git.kaiyauncloud.cn/yumoqing/apppublic -git+https://git.kaiyauncloud.cn/yumoqing/sqlor -git+https://git.kaiyauncloud.cn/yumoqing/ahserver +git+https://git.kaiyuancloud.cn/yumoqing/apppublic +git+https://git.kaiyuancloud.cn/yumoqing/sqlor +git+https://git.kaiyuancloud.cn/yumoqing/ahserver