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

Unified Diff: remoting/host/installer/linux/debian/postinst

Issue 10860024: Handle updates to the wrapper script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstated spin protection. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/installer/linux/debian/control ('k') | remoting/host/installer/linux/debian/preinst » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/installer/linux/debian/postinst
diff --git a/remoting/host/installer/linux/debian/postinst b/remoting/host/installer/linux/debian/postinst
index 68b8d5892978cc68d905af716edaa5a3ea0f2577..c7c7e8ae6c99d37c538cf37a1de374815224d66c 100755
--- a/remoting/host/installer/linux/debian/postinst
+++ b/remoting/host/installer/linux/debian/postinst
@@ -1,11 +1,42 @@
#!/bin/bash
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
set -e
-case $1 in
+LOGOUT_MSG="
+Name: Please log out to update
+Priority: Medium
+OnlyAdminUsers: False
+DontShowAfterReboot: true
+DisplayIf: /usr/lib/chrome-remote-desktop/is_me2me_desktop
+Description: Chrome Remote Desktop has been updated. Please save your work and log out in order to apply this update. Your virtual desktop will be restarted automatically.
+"
+
+NOTIFIER_DIR="/var/lib/update-notifier/user.d"
+VAR_DIR="/var/lib/chrome-remote-desktop"
+HASHES_FILE="$VAR_DIR/hashes"
+
+case "$1" in
"configure")
+ # Kill me2me host processes. The wrapper script will restart them.
echo "Shutting down remoting hosts (they will restart automatically)..."
killall -q remoting_me2me_host || true
+ # If any files have changed that require the user to restart their virtual
+ # desktops (eg, the wrapper script itself) then notify them but don't do
+ # anything that would result in them losing state.
+ if [ -f "$HASHES_FILE" ]; then
+ if [ -d "$NOTIFIER_DIR" ]; then
+ if ! md5sum --status -c "$HASHES_FILE"; then
+ echo "Sending logout notification messages to virtual desktops."
+ echo "$LOGOUT_MSG" > "$NOTIFIER_DIR/chrome-remote-desktop-logout"
+ fi
+ fi
+ rm "$HASHES_FILE"
+ rmdir --ignore-fail-on-non-empty "$VAR_DIR"
+ fi
;;
esac
« no previous file with comments | « remoting/host/installer/linux/debian/control ('k') | remoting/host/installer/linux/debian/preinst » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698