add some comment

This commit is contained in:
ooooo 2016-04-18 18:16:19 +08:00
parent aed61947b0
commit e313f50b5e
2 changed files with 6 additions and 2 deletions

View File

@ -3,8 +3,9 @@
[ $(id -u) != '0' ] && echo "root is needed" && exit 1
# get some path of docklet
echo $0
bindir=${0%/*}
echo "bindir=$bindir"
# $bindir maybe like /opt/docklet/src/../sbin
# use command below to make $bindir in normal absolute path
DOCKLET_BIN=$(cd $bindir; pwd)

View File

@ -6,6 +6,7 @@
# must first init loadenv
import tools, env
# default CONFIG=/opt/docklet/local/docklet-running.conf
config = env.getenv("CONFIG")
tools.loadenv(config)
@ -23,6 +24,7 @@ import userManager
import monitor
import guest_control, threading
#default EXTERNAL_LOGIN=False
external_login = env.getenv('EXTERNAL_LOGIN')
if (external_login == 'TRUE'):
from userDependence import external_auth
@ -520,6 +522,7 @@ if __name__ == '__main__':
etcdclient.clean()
else:
etcdclient.createdir("")
# token is saved at fs_path/golbal/token
token = tools.gen_token()
tokenfile = open(fs_path+"/global/token", 'w')
tokenfile.write(token)
@ -583,7 +586,7 @@ if __name__ == '__main__':
masterport = env.getenv('MASTER_PORT')
logger.info("using MASTER_PORT %d", int(masterport))
# server = http.server.HTTPServer((masterip, masterport), DockletHttpHandler)
# server = http.server.HTTPServer((masterip, masterport), DockletHttpHandler)
server = ThreadingHttpServer((masterip, int(masterport)), DockletHttpHandler)
logger.info("starting master server")
server.serve_forever()