我有一个编译到rpm的opscenter包,可以将文件转储到/ opt / mypckage
当我执行/ opt / mypackage / opscenter / bin / opscenter时,一切正常 - 如果它会打开opscenter web,其中包括日志目录中的http.log
我创建了一个从tarball
测试的启动脚本#!/bin/sh
echo "exec 'sudo /etc/init.d/opscenterd start'"
exec sudo /etc/init.d/opscenterd start
奇怪的是 - 是的,它会使用上面的脚本启动opscenter服务,但是url没有使用端口8888运行,也没有生成http.log。有什么方法可以调整它吗?
opscenterd.log
2016-06-21 02:13:32+0800 [] INFO: Log opened.
2016-06-21 02:13:32+0800 [] INFO: twistd 10.2.0 (/usr/bin/python2.6 2.6.6) starting up.
2016-06-21 02:13:32+0800 [] INFO: reactor class: twisted.internet.epollreactor.EPollReactor.
2016-06-21 02:13:32+0800 [] INFO: set uid/gid 9093/9094
2016-06-21 02:13:32+0800 [] INFO: Logging level set to 'info'
2016-06-21 02:13:32+0800 [] INFO: OpsCenter version: 5.2.4
2016-06-21 02:13:32+0800 [] INFO: Compatible agent version: 5.2.4
2016-06-21 02:13:32+0800 [] INFO: Cluster config dir './conf/clusters' does not exist yet
2016-06-21 02:13:32+0800 [] INFO: No clusters are configured yet, checking to see if a config migration is needed
2016-06-21 02:13:32+0800 [] INFO: Cluster config dir './conf/clusters' does not exist yet
2016-06-21 02:13:32+0800 [] INFO: No clusters are configured
2016-06-21 02:13:32+0800 [] INFO: Authentication disabled
2016-06-21 02:13:32+0800 [] INFO: Starting webserver with ssl disabled.
2016-06-21 02:13:32+0800 [] INFO: Stats Reporter is connected via HTTP
2016-06-21 02:13:32+0800 [] INFO: SSL disabled
2016-06-21 02:13:32+0800 [] WARN: Unable to import SSL, further definition actions will fail.
2016-06-21 02:13:32+0800 [] INFO: Starting Definition Update Service
2016-06-21 02:13:32+0800 [] WARN: Python may not have been compiled with SSL support, disabling cloud provisioning (No module named Ec2Launcher)
2016-06-21 02:13:32+0800 [] INFO: opscenterd.WebServer.OpsCenterdWebServer starting on 8888
2016-06-21 02:13:32+0800 [] INFO: Starting factory <opscenterd.WebServer.OpsCenterdWebServer instance at 0x1dbf758>
2016-06-21 02:13:32+0800 [] INFO: Unhandled error in Deferred:
2016-06-21 02:13:32+0800 [] Unhandled Error
Traceback (most recent call last):
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/scripts/_twistd_unix.py", line 317, in startApplication
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/application/app.py", line 653, in startApplication
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/application/service.py", line 277, in startService
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/internet/defer.py", line 1141, in unwindGenerator
--- <exception caught here> ---
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/internet/defer.py", line 1020, in _inlineCallbacks
File "build/lib/python2.6/site-packages/opscenterd/OpsCenterdService.py", line 55, in startService
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/application/service.py", line 277, in startService
File "/opt/msp/pkgmypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/application/internet.py", line 110, in startService
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/application/internet.py", line 131, in _getPort
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/internet/posixbase.py", line 419, in listenTCP
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/internet/tcp.py", line 867, in startListening
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/internet/protocol.py", line 45, in doStart
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/web/http.py", line 1755, in startFactory
File "build/lib/python2.6/site-packages/opscenterd/Logging.py", line 72, in _openLogFile
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/python/logfile.py", line 162, in __init__
File "/opt/mypakage/opscenter/lib/py-redhat/2.6/shared/amd64/twisted/python/logfile.py", line 34, in __init__
exceptions.AssertionError:
答案 0 :(得分:0)
检查opscenter的写日志权限。
尝试允许opscenter实际编写opscenter.conf中定义的日志
这意味着将/ var / log / opscenter的所有权分配给opscenter用户。
chown -R opscenter:opscenter /var/log/opscenter
重新启动opscenterd服务,拖延opscenter.log以查看服务如何启动。
将其加载到浏览器中,享受。