diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2012-01-10 14:13:50 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-11 10:36:20 +0000 |
commit | 489cde8eb0e19ef6fe8078148199eaf5b52631ae (patch) | |
tree | cb85947000c8efb778362c136f1f6a0c14ed31dc /bitbake/bin/bitbake-prserv | |
parent | 30a9bc6c92a8920d6e9c4a4b93b83bdbe5d48e78 (diff) | |
download | poky-489cde8eb0e19ef6fe8078148199eaf5b52631ae.tar.gz |
bitbake: Automatically start local PR service.
[YOCTO #1126]
A local PR service will be started and stopped automatically along
with the bitbake invocation/ternimation.
This local PR service will be started only and if only when the
PRSERV_HOST is set to 'localhost' and PRSERV_PORT is set to '0'.
When started, the sqlite3 database is stored at
"${PERSISTEN_DIR}/prserv.sqlite3" or "${CACHE}/prserv.sqlite3".
(Bitbake rev: 9d8f45407c67ed0d3c4f820cf646de3c385067c7)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/bitbake-prserv')
-rw-r--r-- | bitbake/bin/bitbake-prserv | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bitbake/bin/bitbake-prserv b/bitbake/bin/bitbake-prserv index a7ab55f736..a8d7acb4c2 100644 --- a/bitbake/bin/bitbake-prserv +++ b/bitbake/bin/bitbake-prserv | |||
@@ -10,7 +10,7 @@ import prserv.serv | |||
10 | 10 | ||
11 | __version__="1.0.0" | 11 | __version__="1.0.0" |
12 | 12 | ||
13 | PRHOST_DEFAULT='' | 13 | PRHOST_DEFAULT='0.0.0.0' |
14 | PRPORT_DEFAULT=8585 | 14 | PRPORT_DEFAULT=8585 |
15 | 15 | ||
16 | def main(): | 16 | def main(): |
@@ -18,8 +18,8 @@ def main(): | |||
18 | version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__), | 18 | version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__), |
19 | usage = "%prog < --start | --stop > [options]") | 19 | usage = "%prog < --start | --stop > [options]") |
20 | 20 | ||
21 | parser.add_option("-f", "--file", help="database filename(default: prserv.db)", action="store", | 21 | parser.add_option("-f", "--file", help="database filename(default: prserv.sqlite3)", action="store", |
22 | dest="dbfile", type="string", default="prserv.db") | 22 | dest="dbfile", type="string", default="prserv.sqlite3") |
23 | parser.add_option("-l", "--log", help="log filename(default: prserv.log)", action="store", | 23 | parser.add_option("-l", "--log", help="log filename(default: prserv.log)", action="store", |
24 | dest="logfile", type="string", default="prserv.log") | 24 | dest="logfile", type="string", default="prserv.log") |
25 | parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG", | 25 | parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG", |
@@ -37,8 +37,7 @@ def main(): | |||
37 | prserv.init_logger(os.path.abspath(options.logfile),options.loglevel) | 37 | prserv.init_logger(os.path.abspath(options.logfile),options.loglevel) |
38 | 38 | ||
39 | if options.start: | 39 | if options.start: |
40 | ret=prserv.serv.start_daemon(dbfile=options.dbfile, interface=(options.host, options.port), | 40 | ret=prserv.serv.start_daemon(options.dbfile, options.host, options.port,os.path.abspath(options.logfile)) |
41 | logfile=os.path.abspath(options.logfile)) | ||
42 | elif options.stop: | 41 | elif options.stop: |
43 | ret=prserv.serv.stop_daemon(options.host, options.port) | 42 | ret=prserv.serv.stop_daemon(options.host, options.port) |
44 | else: | 43 | else: |