AU: Catch terminate signals and block exit if necessary.
Adds a global Terminator class to manage signals and exit blocking.
BUG=7392
TEST=unit tests, gmerged on device, initctl stop update-engine
Change-Id: I2291d4eb55240a6662b18ff834af161d957bce2f
Review URL: http://codereview.chromium.org/3608015
diff --git a/main.cc b/main.cc
index daa5eda..94393c3 100644
--- a/main.cc
+++ b/main.cc
@@ -20,6 +20,7 @@
#include "update_engine/dbus_service.h"
#include "update_engine/prefs.h"
#include "update_engine/subprocess.h"
+#include "update_engine/terminator.h"
#include "update_engine/update_attempter.h"
#include "update_engine/update_check_scheduler.h"
@@ -93,6 +94,7 @@
g_thread_init(NULL);
dbus_g_thread_init();
base::AtExitManager exit_manager; // Required for base/rand_util.h.
+ chromeos_update_engine::Terminator::Init();
chromeos_update_engine::Subprocess::Init();
google::ParseCommandLineFlags(&argc, &argv, true);
CommandLine::Init(argc, argv);