From f4503842fdc288fb6336211099ad0a8d01165df3 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 4 Mar 2016 12:02:26 -0400 Subject: [feature] landing of bitmask.core --- src/leap/bitmask/core/launcher.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/leap/bitmask/core/launcher.py (limited to 'src/leap/bitmask/core/launcher.py') diff --git a/src/leap/bitmask/core/launcher.py b/src/leap/bitmask/core/launcher.py new file mode 100644 index 00000000..7d658017 --- /dev/null +++ b/src/leap/bitmask/core/launcher.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# launcher.py +# Copyright (C) 2016 LEAP +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +""" +Run bitmask daemon. +""" +from twisted.scripts.twistd import run +from os.path import join, dirname +from sys import argv + +from leap.bitmask import core + + +def run_bitmaskd(): + # TODO --- configure where to put the logs... (get --logfile, --logdir + # from the bitmask_cli + argv[1:] = [ + '-y', join(dirname(core.__file__), "bitmaskd.tac"), + '--pidfile', '/tmp/bitmaskd.pid', + '--logfile', '/tmp/bitmaskd.log', + '--umask=0022', + ] + print '[+] launching bitmaskd...' + run() -- cgit v1.2.3 From b3f5538984502d97c77a9666f39c8d5b8f4a5c31 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 8 Mar 2016 11:36:37 -0400 Subject: [feature] add bitmaskd entrypoint --- src/leap/bitmask/core/launcher.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/leap/bitmask/core/launcher.py') diff --git a/src/leap/bitmask/core/launcher.py b/src/leap/bitmask/core/launcher.py index 7d658017..e363046e 100644 --- a/src/leap/bitmask/core/launcher.py +++ b/src/leap/bitmask/core/launcher.py @@ -35,3 +35,7 @@ def run_bitmaskd(): ] print '[+] launching bitmaskd...' run() + + +if __name__ == "__main__": + run_bitmaskd() -- cgit v1.2.3 From 449bb9f2336d2f50a63d8558d1198b64b1ec4814 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 9 Mar 2016 16:27:36 -0400 Subject: [pkg] adapt launcher to work inside frozen binary --- src/leap/bitmask/core/launcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/core/launcher.py') diff --git a/src/leap/bitmask/core/launcher.py b/src/leap/bitmask/core/launcher.py index e363046e..b2319077 100644 --- a/src/leap/bitmask/core/launcher.py +++ b/src/leap/bitmask/core/launcher.py @@ -18,9 +18,10 @@ Run bitmask daemon. """ from twisted.scripts.twistd import run -from os.path import join, dirname +from os.path import join from sys import argv +from leap.bitmask.util import here from leap.bitmask import core @@ -28,7 +29,7 @@ def run_bitmaskd(): # TODO --- configure where to put the logs... (get --logfile, --logdir # from the bitmask_cli argv[1:] = [ - '-y', join(dirname(core.__file__), "bitmaskd.tac"), + '-y', join(here(core), "bitmaskd.tac"), '--pidfile', '/tmp/bitmaskd.pid', '--logfile', '/tmp/bitmaskd.log', '--umask=0022', -- cgit v1.2.3 From 08da5b11103cdd132c3ac4110ba42fcc8510a78b Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Sat, 30 Apr 2016 12:15:58 -0400 Subject: [refactor] pass backend to core service --- src/leap/bitmask/core/launcher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/leap/bitmask/core/launcher.py') diff --git a/src/leap/bitmask/core/launcher.py b/src/leap/bitmask/core/launcher.py index b2319077..b8916a1e 100644 --- a/src/leap/bitmask/core/launcher.py +++ b/src/leap/bitmask/core/launcher.py @@ -17,17 +17,22 @@ """ Run bitmask daemon. """ -from twisted.scripts.twistd import run from os.path import join from sys import argv +from twisted.scripts.twistd import run + from leap.bitmask.util import here from leap.bitmask import core +from leap.bitmask.core import flags def run_bitmaskd(): # TODO --- configure where to put the logs... (get --logfile, --logdir # from the bitmask_cli + for (index, arg) in enumerate(argv): + if arg == '--backend': + flags.BACKEND = argv[index + 1] argv[1:] = [ '-y', join(here(core), "bitmaskd.tac"), '--pidfile', '/tmp/bitmaskd.pid', -- cgit v1.2.3