blob: f4e840d69a1b29a8d9e7f275e16417cdab7af918 [file] [log] [blame]
Jason Glasgow5395ed22011-08-19 13:16:47 -04001# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Ryan Harrisonb74d2242013-02-04 11:36:49 -05005"""Provides utility methods for interacting with upstart"""
Jason Glasgow5395ed22011-08-19 13:16:47 -04006
Paul Stewartf748e3b2011-09-12 15:04:11 -07007import os
Jason Glasgow5395ed22011-08-19 13:16:47 -04008
9def ensure_running(service_name):
10 cmd = 'initctl status %s | grep start/running' % service_name
Paul Stewartf748e3b2011-09-12 15:04:11 -070011 os.system(cmd)