2012-10-29 87 views
2

該執行不考慮配置文件是我的shell腳本代碼:gunicorn - 如果從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等。那麼它將採取選項。

+2

你需要給的完整路徑'conf.py'文件。 –

回答

1

使用該腳本,爲我工作:

#!/bin/bash 
source /path/to/active 
gunicorn_django -c $(pwd)/path/to/conffilefrom/presentworkingdirectory -D