Revision 2826b361 lib/utils.py
b/lib/utils.py | ||
---|---|---|
1610 | 1610 |
return os.path.join(constants.RUN_GANETI_DIR, "%s.pid" % name) |
1611 | 1611 |
|
1612 | 1612 |
|
1613 |
def EnsureDaemon(name): |
|
1614 |
"""Check for and start daemon if not alive. |
|
1615 |
|
|
1616 |
""" |
|
1617 |
result = RunCmd([constants.DAEMON_UTIL, "check-and-start", name]) |
|
1618 |
if result.failed: |
|
1619 |
logging.error("Can't start daemon '%s', failure %s, output: %s", |
|
1620 |
name, result.fail_reason, result.output) |
|
1621 |
return False |
|
1622 |
|
|
1623 |
return True |
|
1624 |
|
|
1625 |
|
|
1613 | 1626 |
def WritePidFile(name): |
1614 | 1627 |
"""Write the current process pidfile. |
1615 | 1628 |
|
Also available in: Unified diff