Open yangyile1990 opened 10 months ago
After try a demo, I found that supervisor did support non-ascii characters in conf file.
[program:dongfang]
command=poetry run fastapi run --workers=3 --port=9527
user=root
directory=/root/部署/%(program_name)s
stdout_logfile=/root/部署/%(program_name)s/supervisor.log
numprocs=1 autostart=true startsecs=10 autorestart=true startretried=3 redirect_stderr=true stdout_logfile_maxbytes=20MB stdout_logfile_backups=20
- main.py
```py
#!/usr/bin/env python
from pathlib import Path
import fastapi_cdn_host
import uvicorn
from fastapi import FastAPI
BASE_DIR = Path(__file__).resolve().parent
app = FastAPI(title=BASE_DIR.name)
fastapi_cdn_host.patch_docs(app)
@app.get('/')
async def root():
return '车如流水马如龙,美人如玉剑如虹。'
def main() -> None:
uvicorn.run(f'{Path(__file__).stem}:app', reload=True)
if __name__ == '__main__':
main()
[tool.poetry]
name = "dongfang"
version = "0.1.0"
description = ""
authors = []
readme = "README.md"
package-mode = false
[tool.poetry.dependencies] python = "^3.11" fastapi = "^0.112.2" uvicorn = "^0.30.6" fastapi-cdn-host = "^0.7.5" fastapi-cli = {version = "^0.0.5", platform = "linux"}
[build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"
- Install poetry and deps
```bash
pip install pipx --user
which pipx || export PATH=$PATH:$HOME/.local/bin
pipx ensurepath
pipx install poetry
wget https://mirror.ghproxy.com/https://raw.githubusercontent.com/waketzheng/carstino/main/pip_conf.py
python pip_conf.py --poetry # 给poetry换源
mkdir /root/部署
cd /root/部署
poetry new dongfang
cd dongfang
poetry add fastapi uvicorn fastapi-cdn-host fastapi-cli
[[ -f man.py ]] || echo -e "from fastapi import FastAPI\napp=FastAPI()\n@app.get('/')\nasync def root():\n return 'homepage'" > main.py
poetry run fastapi dev main.py
Now all the sub service in the simple: group are STOPPED
Then run the same commond. get the same error message.
Now all the sub service in the simple: group are RUNNING
So what is the reason.
I can restart my sub service one by one.
By the way my simple.conf contains a lot of chinese characters. I think this is the reason. But I have to use chinese characters as my project is chinese and my project path is chinese an my log path is in chinese.
So how to support NON-ASCII code in conf file? If you don't support use chinese characters in the conf file, you can also tell it to me. As I have read the doc but I can not find it says not support chinese characters.
please help me.