Merge branch 'devel-2.5'
[ganeti-local] / daemons / daemon-util.in
index 04ddc25..03decbf 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 
-# Copyright (C) 2009, 2011 Google Inc.
+# Copyright (C) 2009, 2011, 2012 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -111,6 +111,30 @@ check_exitcode() {
   return 0
 }
 
+# Prints path to PID file for a daemon.
+daemon_pidfile() {
+  if [[ "$#" -lt 1 ]]; then
+    echo 'Missing daemon name.' >&2
+    return 1
+  fi
+
+  local name="$1"; shift
+
+  _daemon_pidfile $name
+}
+
+# Prints path to daemon executable.
+daemon_executable() {
+  if [[ "$#" -lt 1 ]]; then
+    echo 'Missing daemon name.' >&2
+    return 1
+  fi
+
+  local name="$1"; shift
+
+  _daemon_executable $name
+}
+
 # Prints a list of all daemons in the order in which they should be started
 list_start_daemons() {
   local name