OLD | NEW |
---|---|
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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
486 """ | 486 """ |
487 if XSESSION_COMMAND is not None: | 487 if XSESSION_COMMAND is not None: |
488 return XSESSION_COMMAND | 488 return XSESSION_COMMAND |
489 | 489 |
490 # Unity-2d would normally be the preferred choice on Ubuntu 12.04. At the | 490 # Unity-2d would normally be the preferred choice on Ubuntu 12.04. At the |
491 # time of writing, this session does not work properly (missing launcher and | 491 # time of writing, this session does not work properly (missing launcher and |
492 # panel), so gnome-session-fallback is used in preference. | 492 # panel), so gnome-session-fallback is used in preference. |
493 # "unity-2d-panel" was chosen here simply because it appears in the TryExec | 493 # "unity-2d-panel" was chosen here simply because it appears in the TryExec |
494 # line of the session's .desktop file; other choices might be just as good. | 494 # line of the session's .desktop file; other choices might be just as good. |
495 for test_file, command in [ | 495 for test_file, command in [ |
496 ("/usr/bin/gnome-session-fallback", "/usr/bin/gnome-session-fallback"), | 496 ("/usr/bin/gnome-session-fallback", |
497 ["/etc/X11/Xsession", "gnome-session-fallback"]), | |
497 ("/etc/gdm/Xsession", "/etc/gdm/Xsession"), | 498 ("/etc/gdm/Xsession", "/etc/gdm/Xsession"), |
Sergey Ulanov
2012/07/31 18:50:42
pretty please: can you also add xfce4-session in t
| |
498 ("/usr/bin/unity-2d-panel", | 499 ("/usr/bin/unity-2d-panel", |
499 ["/usr/bin/gnome-session", "--session=ubuntu-2d"]), | 500 ["/etc/X11/Xsession", "/usr/bin/gnome-session --session=ubuntu-2d"]), |
500 ]: | 501 ]: |
501 if os.path.exists(test_file): | 502 if os.path.exists(test_file): |
502 return command | 503 return command |
503 | 504 |
504 return None | 505 return None |
505 | 506 |
506 | 507 |
507 def locate_executable(exe_name): | 508 def locate_executable(exe_name): |
508 for path in EXE_PATHS_TO_TRY: | 509 for path in EXE_PATHS_TO_TRY: |
509 exe_path = os.path.join(SCRIPT_PATH, path, exe_name) | 510 exe_path = os.path.join(SCRIPT_PATH, path, exe_name) |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
847 os.remove(host.config_file) | 848 os.remove(host.config_file) |
848 return 0 | 849 return 0 |
849 elif os.WEXITSTATUS(status) == 4: | 850 elif os.WEXITSTATUS(status) == 4: |
850 logging.info("OAuth credentials are invalid - exiting.") | 851 logging.info("OAuth credentials are invalid - exiting.") |
851 os.remove(auth.config_file) | 852 os.remove(auth.config_file) |
852 return 0 | 853 return 0 |
853 | 854 |
854 if __name__ == "__main__": | 855 if __name__ == "__main__": |
855 logging.basicConfig(level=logging.DEBUG) | 856 logging.basicConfig(level=logging.DEBUG) |
856 sys.exit(main()) | 857 sys.exit(main()) |
OLD | NEW |