这是我的 shell 脚本的代码:
#!/bin/bash
source /path/to/active
gunicorn_django -c /path/to/conf.py -D
上面的 sh 文件在执行时启动了 gunicorn 进程,但它没有使用配置文件。
但是,如果我直接从命令行执行命令,比如
gunicorn_django -c path/to/conf.py -D
然后它正在使用配置文件。
此外,在 sh 文件中,如果我直接提供选项,如 -w 3 -error-logfile 等。那么它正在接受选项。
请您参考如下方法:
使用这个脚本,对我有用:
#!/bin/bash
source /path/to/active
gunicorn_django -c $(pwd)/path/to/conffilefrom/presentworkingdirectory -D
