diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-17 20:54:46 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-17 20:54:46 +0000 |
commit | 5d065d725c8fcf9f2406e2d9c273a917288f09b0 (patch) | |
tree | 1f75f039f83cdde0be8db38f471d0f059df7f23b /remoting/tools | |
parent | 48280439bdbf6ab359ad38c45c94924ab9a9785f (diff) | |
download | chromium_src-5d065d725c8fcf9f2406e2d9c273a917288f09b0.zip chromium_src-5d065d725c8fcf9f2406e2d9c273a917288f09b0.tar.gz chromium_src-5d065d725c8fcf9f2406e2d9c273a917288f09b0.tar.bz2 |
Update linux host to handle SIGHUP. Use it to reload config.
Also updated me2me_virtual_host.py to use that signal to reload config (instead of restarting the host), and when requesting the currently running instance of the script to reload the config (instead of SIGUSR1).
BUG=120950
Review URL: https://chromiumcodereview.appspot.com/10825410
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/tools')
-rwxr-xr-x | remoting/tools/me2me_virtual_host.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/remoting/tools/me2me_virtual_host.py b/remoting/tools/me2me_virtual_host.py index 6b62d26..2b7016c 100755 --- a/remoting/tools/me2me_virtual_host.py +++ b/remoting/tools/me2me_virtual_host.py @@ -649,14 +649,12 @@ def cleanup(): def reload_config(): for desktop in g_desktops: if desktop.host_proc: - # Terminating the Host will cause the main loop to spawn another - # instance, which will read any changes made to the Host config file. - desktop.host_proc.terminate() + desktop.host_proc.send_signal(signal.SIGHUP) def signal_handler(signum, stackframe): - if signum == signal.SIGUSR1: - logging.info("SIGUSR1 caught, reloading configuration.") + if signum == signal.SIGHUP: + logging.info("SIGHUP caught, reloading configuration.") reload_config() else: # Exit cleanly so the atexit handler, cleanup(), gets called. @@ -712,7 +710,7 @@ def main(): running, pid = PidFile(pid_filename).check() if not running: return 1 - os.kill(pid, signal.SIGUSR1) + os.kill(pid, signal.SIGHUP) return 0 if not options.size: @@ -798,7 +796,7 @@ def main(): host.save_config(host_config) running, pid = PidFile(pid_filename).check() if running and pid != 0: - os.kill(pid, signal.SIGUSR1) + os.kill(pid, signal.SIGHUP) print "The running instance has been updated with the new PIN." return 0 @@ -908,7 +906,7 @@ def main(): pid, status = os.wait() except OSError, e: if e.errno == errno.EINTR: - # Retry on EINTR, which can happen if a signal such as SIGUSR1 is + # Retry on EINTR, which can happen if a signal such as SIGHUP is # received. continue else: |