Merge pull request #53 from philips/add-reboot-manager

feat(update_engine): add reboot manager experiment
This commit is contained in:
polvi 2013-07-05 16:13:25 -07:00
commit 1c0586ad10
5 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,10 @@
[Unit]
Description=Update Engine
ConditionVirtualization=!container
[Service]
ExecStart=/usr/sbin/update_engine_reboot_manager
Restart=always
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,23 @@
#!/bin/bash
# Copyright (c) 2013 The CoreOS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO: Make this a service in Go that coordinates between a host group
interface=org.chromium.UpdateEngineInterface
member=StatusUpdate
reboot_tasks() {
sync
echo "$0 rebooting machine after update" > /dev/kmsg
shutdown -r -t 60
}
filter="type=signal,interface='$interface',member='$member'"
dbus-monitor --system ${filter} |
while read -r line; do
echo $line | grep -q "UPDATE_STATUS_UPDATED_NEED_REBOOT" && reboot_tasks
done

View File

@ -76,6 +76,10 @@ src_test() {
}
src_install() {
dosbin "${FILESDIR}"/update_engine_reboot_manager
systemd_dounit "${FILESDIR}"/update-engine-reboot-manager.service
systemd_enable_service multi-user.target update-engine-reboot-manager.service
dosbin update_engine
dobin update_engine_client

View File

@ -75,6 +75,10 @@ src_test() {
}
src_install() {
dosbin "${FILESDIR}"/update_engine_reboot_manager
systemd_dounit "${FILESDIR}"/update-engine-reboot-manager.service
systemd_enable_service multi-user.target update-engine-reboot-manager.service
dosbin update_engine
dobin update_engine_client