From 8a47e7edda3356b6dd1d0783d8b5d246ea03cd32 Mon Sep 17 00:00:00 2001 From: Enrico Zini Date: Thu, 11 Mar 2010 15:05:50 +0100 Subject: [PATCH] Use exec so we directly kill frameworkd --- hooks/gsm | 10 +++++++--- src/gsm.vala | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/hooks/gsm b/hooks/gsm index eba60c6..dacad06 100755 --- a/hooks/gsm +++ b/hooks/gsm @@ -4,14 +4,18 @@ case "$1" in # At the start of zavai status) ;; + pre) + exec om gsm power 1 + ;; + post) + exec om gsm power 0 + ;; # Run, blocking until the process ends run) if [ -x /usr/bin/frameworkd ] then # Start frameworkd for GSM services only - om gsm power 1 - /usr/bin/frameworkd -s ogsmd > /tmp/zavai-frameworkd.log 2>&1 - om gsm power 0 + exec /usr/bin/frameworkd -s ogsmd > /tmp/zavai-frameworkd.log 2>&1 else # For testing exec sleep 10 diff --git a/src/gsm.vala b/src/gsm.vala index ae972c8..f73ac15 100644 --- a/src/gsm.vala +++ b/src/gsm.vala @@ -57,7 +57,16 @@ public class GSM: zavai.Service { if (started) return; - string command = zavai.config.homedir + "/gsm run"; + string command = zavai.config.homedir + "/gsm pre"; + try { + // Then run our own script + zavai.app.run_script(command); + } catch (Error e) { + zavai.log.error("Running " + command + ": " + e.message); + return; + } + + command = zavai.config.homedir + "/gsm run"; zavai.log.info("Run program: " + command); string[] args = command.split(" "); try { @@ -154,6 +163,15 @@ stderr.printf("STATUS %d\n", status); // zavai.log.error(e.message); // } + string command = zavai.config.homedir + "/gsm post"; + try { + // Then run our own script + zavai.app.run_script(command); + } catch (Error e) { + zavai.log.error("Running " + command + ": " + e.message); + return; + } + network = null; call = null; device = null; -- 2.39.5