mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-12 08:06:49 +02:00
add --pid-file option to cli
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
a3f24e8cca
commit
3770483c67
@ -48,7 +48,8 @@ CONF.register_cli_opts([
|
||||
cfg.ListOpt('app-lists', default=[],
|
||||
help='application module name to run'),
|
||||
cfg.MultiStrOpt('app', positional=True, default=[],
|
||||
help='application module name to run')
|
||||
help='application module name to run'),
|
||||
cfg.StrOpt('pid-file', default=None, help='pid file name'),
|
||||
])
|
||||
|
||||
|
||||
@ -63,6 +64,11 @@ def main(args=None, prog=None):
|
||||
|
||||
log.init_log()
|
||||
|
||||
if CONF.pid_file:
|
||||
import os
|
||||
with open(CONF.pid_file, 'w') as pid_file:
|
||||
pid_file.write(str(os.getpid()))
|
||||
|
||||
app_lists = CONF.app_lists + CONF.app
|
||||
# keep old behaivor, run ofp if no application is specified.
|
||||
if not app_lists:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user