我正在使用这个简单的Google API示例:
import httplib2
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run
# Path to the client_secret.json file downloaded from the Developer Console
CLIENT_SECRET_FILE = 'client_secret.json'
# Check https://developers.google.com/gmail/api/auth/scopes for all available scopes
OAUTH_SCOPE = 'https://www.googleapis.com/auth/gmail.readonly'
# Location of the credentials storage file
STORAGE = Storage('gmail.storage')
# Start the OAuth flow to retrieve credentials
flow = flow_from_clientsecrets(CLIENT_SECRET_FILE, scope=OAUTH_SCOPE)
http = httplib2.Http()
# Try to retrieve credentials from storage or run the flow …Run Code Online (Sandbox Code Playgroud) 我正在使用 CoreOS 运行 Docker 容器,它使用最新的 Debian 作为基础,并安装了各种软件包,包括主管和 apache2。我可以使用以下命令启动并成功运行 apache:
# /usr/bin/pidproxy /var/run/apache2.pid /bin/bash -c "source /etc/apache2/envvars && /usr/sbin/apache2 -DFOREGROUND -k start"
Run Code Online (Sandbox Code Playgroud)
但是,当我将此命令粘贴到主管配置文件中时:
[program:apache2]
command=/usr/bin/pidproxy /var/run/apache2.pid /bin/bash -c "source /etc/apache2/envvars && /usr/sbin/apache2 -DFOREGROUND -k start"
redirect_stderr=true
Run Code Online (Sandbox Code Playgroud)
并执行以下操作:
# supervisorctl start apache2
Run Code Online (Sandbox Code Playgroud)
我得到这样的回复:
apache2: ERROR (abnormal termination)
Run Code Online (Sandbox Code Playgroud)
查看主管进程日志文件,我看到 apache2 命令的帮助输出,就好像它是这样调用的apache2 -h。我不知道为什么在命令行上以 root 身份执行(ssh 进入容器)时运行的命令在由supervisorctl 逐字执行(以 root 身份运行)时不起作用。
任何正确方向的观点都将不胜感激。
apache ×1
coreos ×1
docker ×1
google-api ×1
node.js ×1
oauth-2.0 ×1
python ×1
saml ×1
supervisord ×1