• R/O
  • SSH

pm_diskd: Commit

※ リポジトリは、pm-diskd ブランチが https://github.com/linux-ha-japan/pm_diskd-1.0 へ、pm-diskd-2.0ブランチが https://github.com/linux-ha-japan/pm_diskd へ移行しました。

Pacemaker 対応ディスク故障監視機能。

Pacemaker-1.0公式リポジトリのクローンに対し、パッチ作成用のブランチを作成して管理する。
ブランチ名: pm-diskd

初回 hg clone 実行後は、hg update -r pm-diskd を実行すること。

Heartbeat-2.1.4 用 hb-diskd(*) のPacemaker対応版
(*) http://sourceforge.jp/projects/linux-ha/releases/?package_id=10555


Commit MetaInfo

Revision4cb5d5ff2cfd9afb5652993a7f64fb5ed2c309a8 (tree)
Time2010-08-05 01:38:38
AuthorDejan Muhamedagic <dejan@hell...>
CommiterDejan Muhamedagic

Log Message

Medium: Shell: set shadow directory properly (bnc#626638)
(transplanted from 230655711dc7b8579747ddeafc6f39247f8e87fc)

Change Summary

Incremental Difference

diff -r eda74457c7fd -r 4cb5d5ff2cfd shell/modules/cibstatus.py
--- a/shell/modules/cibstatus.py Tue Aug 03 16:07:55 2010 +0200
+++ b/shell/modules/cibstatus.py Wed Aug 04 18:38:38 2010 +0200
@@ -58,8 +58,6 @@
5858 (interval != "" and o.getAttribute("interval") == interval):
5959 l.append(o)
6060 return l
61-def shadowfile(name):
62- return "%s/shadow.%s" % (vars.crm_conf_dir, name)
6361
6462 class CibStatus(Singleton):
6563 '''
diff -r eda74457c7fd -r 4cb5d5ff2cfd shell/modules/ui.py.in
--- a/shell/modules/ui.py.in Tue Aug 03 16:07:55 2010 +0200
+++ b/shell/modules/ui.py.in Wed Aug 04 18:38:38 2010 +0200
@@ -139,13 +139,6 @@
139139 if no_questions_asked and not options.interactive:
140140 self.save_options("save")
141141
142-def listshadows():
143- return stdout2list("ls %s | fgrep shadow. | sed 's/^shadow\.//'" % vars.crm_conf_dir)
144-def shadowfile(name):
145- return "%s/shadow.%s" % (vars.crm_conf_dir, name)
146-def shadow2doc(name):
147- return file2doc(shadowfile(name))
148-
149142 class CibShadow(UserInterface):
150143 '''
151144 CIB shadow management class
diff -r eda74457c7fd -r 4cb5d5ff2cfd shell/modules/vars.py.in
--- a/shell/modules/vars.py.in Tue Aug 03 16:07:55 2010 +0200
+++ b/shell/modules/vars.py.in Wed Aug 04 18:38:38 2010 +0200
@@ -124,6 +124,7 @@
124124 tmpl_dir = "@datadir@/@PACKAGE@/templates"
125125 pe_dir = "@PE_STATE_DIR@"
126126 crm_conf_dir = "@CRM_CONFIG_DIR@"
127+ crm_daemon_user = "@CRM_DAEMON_USER@"
127128
128129 ra_if = None # class interface to RA
129130 stonithd_metadata = None # stonithd meta data
diff -r eda74457c7fd -r 4cb5d5ff2cfd shell/modules/xmlutil.py
--- a/shell/modules/xmlutil.py Tue Aug 03 16:07:55 2010 +0200
+++ b/shell/modules/xmlutil.py Wed Aug 04 18:38:38 2010 +0200
@@ -121,6 +121,28 @@
121121 def is_live_cib():
122122 '''We working with the live cluster?'''
123123 return not vars.cib_in_use and not os.getenv("CIB_file")
124+
125+def cib_shadow_dir():
126+ if os.getenv("CIB_shadow_dir"):
127+ return os.getenv("CIB_shadow_dir")
128+ user = os.getenv("USER")
129+ if user in ("root",vars.crm_daemon_user):
130+ return vars.crm_conf_dir
131+ home = os.getenv("HOME")
132+ if home and home.startswith("/"):
133+ return "%s/%s" % (home,".cib")
134+ return "/tmp"
135+def listshadows():
136+ dir = cib_shadow_dir()
137+ if os.path.isdir(dir):
138+ return stdout2list("ls %s | fgrep shadow. | sed 's/^shadow\.//'" % dir)
139+ else:
140+ return []
141+def shadowfile(name):
142+ return "%s/shadow.%s" % (cib_shadow_dir(), name)
143+def shadow2doc(name):
144+ return file2doc(shadowfile(name))
145+
124146 def is_rsc_running(id):
125147 if not is_live_cib():
126148 return False
Show on old repository browser