From 218a4122e6b64ad160bf124d0d04c66a0f37354f Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 20 Aug 2014 23:45:21 +0200 Subject: [PATCH] misc: daemon mode refactoring: - there is no more daemon mode disctinction between local and installed version - sat is launched as daemon by default, use "sat fg" to launch it foreground --- setup.py | 4 +--- src/sat.sh | 8 +++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 81920fd6..4d1c2c9f 100644 --- a/setup.py +++ b/setup.py @@ -65,9 +65,7 @@ class CustomInstall(install): run_dir = os.path.dirname(self.sh_script_path) with open(self.sh_script_path, 'r') as sh_file: for ori_line in sh_file: - if ori_line.startswith('DAEMON='): - dest_line = 'DAEMON=""\n' # we want to launch sat as a daemon - elif ori_line.startswith('TAP_PATH='): + if ori_line.startswith('TAP_PATH='): dest_line = 'TAP_PATH="%s/"\n' % run_dir elif ori_line.startswith('PYTHON='): dest_line = 'PYTHON="%s"\n' % sys.executable diff --git a/src/sat.sh b/src/sat.sh index 933110ec..5849c431 100755 --- a/src/sat.sh +++ b/src/sat.sh @@ -1,6 +1,7 @@ #!/bin/sh DEBUG="" +DAEMON="" PYTHON="python2" kill_process() { @@ -59,14 +60,15 @@ if [ $# -eq 1 ];then if [ $1 = "stop" ];then kill_process $PID_FILE "$APP_NAME" exit 0 - fi - if [ $1 = "debug" ];then + elif [ $1 = "debug" ];then echo "Launching $APP_NAME in debug mode" DEBUG="--debug" + elif [ $1 = "fg" ];then + echo "Launching $APP_NAME in foreground mode" + DAEMON="n" fi fi -DAEMON="n" MAIN_OPTIONS="-${DAEMON}oy" TAP_PATH="./" TAP_FILE="$APP_NAME_FILE.tac"