[chromite] Add system monitor service
BUG=chromium:621741
TEST=Run bin/sysmon on workstation
Change-Id: Id4c28108c7b9de45b26899582115a2385ec51481
Reviewed-on: https://chromium-review.googlesource.com/385120
Commit-Ready: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/scripts/sysmon/__main__.py b/scripts/sysmon/__main__.py
new file mode 100644
index 0000000..c138b5e
--- /dev/null
+++ b/scripts/sysmon/__main__.py
@@ -0,0 +1,18 @@
+# Copyright 2016 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""For running module as script."""
+
+from __future__ import print_function
+
+import sys
+
+from chromite.lib import cros_logging as logging
+from chromite.scripts import sysmon
+
+try:
+ sysmon.main(sys.argv[1:])
+except Exception:
+ logging.exception('sysmon throws an error')
+ raise