Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Side by Side Diff: remoting/tools/me2me_virtual_host.py

Issue 10988004: Revert 158366 - Cleanups in Chromoting Host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/remoting.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Virtual Me2Me implementation. This script runs and manages the processes 6 # Virtual Me2Me implementation. This script runs and manages the processes
7 # required for a Virtual Me2Me desktop, which are: X server, X desktop 7 # required for a Virtual Me2Me desktop, which are: X server, X desktop
8 # session, and Host process. 8 # session, and Host process.
9 # This script is intended to run continuously as a background daemon 9 # This script is intended to run continuously as a background daemon
10 # process, running under an ordinary (non-root) user account. 10 # process, running under an ordinary (non-root) user account.
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 834
835 if desktop.session_proc is not None and pid == desktop.session_proc.pid: 835 if desktop.session_proc is not None and pid == desktop.session_proc.pid:
836 logging.info("Session process terminated") 836 logging.info("Session process terminated")
837 desktop.session_proc = None 837 desktop.session_proc = None
838 838
839 if desktop.host_proc is not None and pid == desktop.host_proc.pid: 839 if desktop.host_proc is not None and pid == desktop.host_proc.pid:
840 logging.info("Host process terminated") 840 logging.info("Host process terminated")
841 desktop.host_proc = None 841 desktop.host_proc = None
842 842
843 # These exit-codes must match the ones used by the host. 843 # These exit-codes must match the ones used by the host.
844 # See remoting/host/host_error_codes.h. 844 # See remoting/host/constants.h.
845 # Delete the host or auth configuration depending on the returned error 845 # Delete the host or auth configuration depending on the returned error
846 # code, so the next time this script is run, a new configuration 846 # code, so the next time this script is run, a new configuration
847 # will be created and registered. 847 # will be created and registered.
848 if os.WEXITSTATUS(status) == 2: 848 if os.WEXITSTATUS(status) == 2:
849 logging.info("Host configuration is invalid - exiting.") 849 logging.info("Host configuration is invalid - exiting.")
850 host_config.clear_auth() 850 host_config.clear_auth()
851 host_config.clear_host_info() 851 host_config.clear_host_info()
852 host_config.save() 852 host_config.save()
853 return 0 853 return 0
854 elif os.WEXITSTATUS(status) == 3: 854 elif os.WEXITSTATUS(status) == 3:
855 logging.info("Host ID has been deleted - exiting.") 855 logging.info("Host ID has been deleted - exiting.")
856 host_config.clear_host_info() 856 host_config.clear_host_info()
857 host_config.save() 857 host_config.save()
858 return 0 858 return 0
859 elif os.WEXITSTATUS(status) == 4: 859 elif os.WEXITSTATUS(status) == 4:
860 logging.info("OAuth credentials are invalid - exiting.") 860 logging.info("OAuth credentials are invalid - exiting.")
861 host_config.clear_auth() 861 host_config.clear_auth()
862 host_config.save() 862 host_config.save()
863 return 0 863 return 0
864 elif os.WEXITSTATUS(status) == 5: 864 elif os.WEXITSTATUS(status) == 5:
865 logging.info("Host domain is blocked by policy - exiting.") 865 logging.info("Host domain is blocked by policy - exiting.")
866 os.remove(host.config_file) 866 os.remove(host.config_file)
867 return 0 867 return 0
868 # Nothing to do for Mac-only status 6 (login screen unsupported) 868 # Nothing to do for Mac-only status 6 (login screen unsupported)
869 869
870 if __name__ == "__main__": 870 if __name__ == "__main__":
871 logging.basicConfig(level=logging.DEBUG) 871 logging.basicConfig(level=logging.DEBUG)
872 sys.exit(main()) 872 sys.exit(main())
OLDNEW
« no previous file with comments | « remoting/remoting.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698