HUP running browser-switchboard processes after saving config
authorSteven Luo <steven+maemo@steven676.net>
Thu, 17 Dec 2009 14:56:34 +0000 (06:56 -0800)
committerSteven Luo <steven+maemo@steven676.net>
Thu, 17 Dec 2009 14:56:34 +0000 (06:56 -0800)
Sending SIGHUP to a running browser-switchboard in continuous mode
causes it to reload its config.  If not in continuous mode, it'll die
and the next browser-switchboard will pick up the config changes.

config-ui/browser-switchboard-cp.c

index 142b008..bee946b 100644 (file)
@@ -260,7 +260,10 @@ out:
 static void do_reconfig(void) {
        save_config();
 
-       /* TODO: send HUP to browser-switchboard */
+       /* Try to send SIGHUP to any running browser-switchboard process
+          This causes it to reread config files if in continuous_mode, and
+          die so that the config will be reloaded on next start otherwise */
+       system("kill -HUP `busybox ps | fgrep 'python /usr/bin/browser-switchboard' | fgrep -v grep | awk '{ print $1 }'` > /dev/null 2>&1");
 }