Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move everything over to using Fhs.ml / @ substitution

Note that there should be no user visible change in this changeset;
everything should be the same as it was before.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
  • Loading branch information...
commit 13b8348e30f1630c21941ce5bc38832ecd204b88 1 parent d6a7d77
@jonludlam jonludlam authored
Showing with 312 additions and 302 deletions.
  1. +2 −0  .gitignore
  2. +13 −5 Makefile
  3. +1 −1  OMakefile
  4. +3 −1 ocaml/OMakefile
  5. +1 −1  ocaml/auth/OMakefile
  6. +4 −4 ocaml/auth/extauth.ml
  7. +1 −1  ocaml/auth/extauth_plugin_ADlikewise.ml
  8. +1 −1  ocaml/cdrommon/OMakefile
  9. +3 −3 ocaml/database/OMakefile
  10. +1 −1  ocaml/database/redo_log.ml
  11. +1 −1  ocaml/db_process/OMakefile
  12. +1 −1  ocaml/gpg/OMakefile
  13. +1 −1  ocaml/gpg/gpg.ml
  14. +1 −1  ocaml/idl/ocaml_backend/OMakefile
  15. +3 −2 ocaml/license/OMakefile
  16. +1 −1  ocaml/license/v6client.ml
  17. +1 −1  ocaml/license/v6d_reopen_logs.ml
  18. +1 −1  ocaml/license/v6daemon.ml
  19. +1 −1  ocaml/lvhdrt/OMakefile
  20. +2 −2 ocaml/mpathalert/OMakefile
  21. +1 −1  ocaml/mpathalert/mpathalert.ml
  22. +4 −4 ocaml/perftest/OMakefile
  23. +1 −1  ocaml/perftest/apiperf.ml
  24. +1 −1  ocaml/perftest/client_stunnel.conf
  25. +1 −1  ocaml/perftest/perfutil.ml
  26. +2 −2 ocaml/ptoken/OMakefile
  27. +1 −1  ocaml/ptoken/genptoken.ml
  28. +4 −4 ocaml/sm-cli/OMakefile
  29. +1 −1  ocaml/sm-cli/main.ml
  30. +1 −1  ocaml/sm-cli/test.ml
  31. +3 −0  ocaml/util/OMakefile
  32. +1 −1  ocaml/util/util_globs_inventory.ml
  33. +1 −1  ocaml/util/util_inventory.ml
  34. +2 −2 ocaml/vncproxy/OMakefile
  35. +1 −1  ocaml/vncproxy/vncproxy.ml
  36. +2 −10 ocaml/xapi/OMakefile
  37. +1 −1  ocaml/xapi/certificates.ml
  38. +0 −1  ocaml/xapi/config_constants.ml.in
  39. +1 −1  ocaml/xapi/console.ml
  40. +1 −1  ocaml/xapi/create_misc.ml
  41. +1 −1  ocaml/xapi/events.ml
  42. +1 −1  ocaml/xapi/helpers.ml
  43. +1 −1  ocaml/xapi/monitor.ml
  44. +1 −1  ocaml/xapi/monitor_fake_common.ml
  45. +1 −1  ocaml/xapi/nm.ml
  46. +1 −1  ocaml/xapi/pool_db_backup.ml
  47. +1 −1  ocaml/xapi/quicktest_storage.ml
  48. +1 −1  ocaml/xapi/sm_exec.ml
  49. +1 −1  ocaml/xapi/sparse_dd_wrapper.ml
  50. +1 −1  ocaml/xapi/static_vdis.ml
  51. +1 −1  ocaml/xapi/static_vdis_list.ml
  52. +1 −1  ocaml/xapi/storage_impl.ml
  53. +1 −1  ocaml/xapi/vmops.ml
  54. +4 −4 ocaml/xapi/xapi.ml
  55. +34 −35 ocaml/xapi/xapi_globs.ml
  56. +9 −9 ocaml/xapi/xapi_ha.ml
  57. +3 −3 ocaml/xapi/xapi_host.ml
  58. +2 −2 ocaml/xapi/xapi_host_backup.ml
  59. +1 −1  ocaml/xapi/xapi_logs_download.ml
  60. +4 −4 ocaml/xapi/xapi_message.ml
  61. +1 −1  ocaml/xapi/xapi_mgmt_iface.ml
  62. +1 −1  ocaml/xapi/xapi_pci.ml
  63. +3 −3 ocaml/xapi/xapi_pool_patch.ml
  64. +1 −1  ocaml/xapi/xapi_services.ml
  65. +1 −1  ocaml/xapi/xapi_support.ml
  66. +1 −1  ocaml/xapi/xapi_sync.ml
  67. +1 −1  ocaml/xapi/xapi_templates_install.ml
  68. +4 −4 ocaml/xapi/xapi_udhcpd.ml
  69. +1 −1  ocaml/xapi/xapi_vif.ml
  70. +1 −1  ocaml/xapi/xha_interface.ml
  71. +2 −2 ocaml/xe-cli/OMakefile
  72. +1 −1  ocaml/xe-cli/cli.ml
  73. +1 −1  ocaml/xe-cli/newcli.ml
  74. +2 −2 ocaml/xenops/OMakefile
  75. +3 −3 ocaml/xenops/device.ml
  76. +1 −1  ocaml/xenops/xenguestHelper.ml
  77. +1 −1  ocaml/xenops/xenops.ml
  78. +1 −1  ocaml/xenops/xenvm.readme
  79. +2 −2 ocaml/xiu/OMakefile
  80. +3 −3 ocaml/xiu/xiu.ml
  81. +2 −2 scripts/InterfaceReconfigure.py
  82. +15 −15 scripts/OMakefile
  83. +3 −3 scripts/backup-metadata-cron
  84. +2 −2 scripts/bugtool-plugin/xapi/stuff.xml
  85. +1 −1  scripts/db.conf.skel
  86. +2 −2 scripts/examples/bash-cli/install-debian
  87. +2 −2 scripts/examples/bash-cli/install-debian.html
  88. +1 −1  scripts/examples/python/inventory.py
  89. +1 −1  scripts/examples/python/monitor-unwanted-domains.py
  90. +1 −1  scripts/fake-pv-drivers.sh
  91. +1 −1  scripts/fence
  92. +1 −1  scripts/host-backup-restore/host-restore
  93. +1 −1  scripts/host-bugreport-upload
  94. +2 −2 scripts/init.d-genptoken
  95. +2 −2 scripts/init.d-management-interface
  96. +2 −2 scripts/init.d-perfmon
  97. +4 −4 scripts/init.d-sdkinit
  98. +1 −1  scripts/init.d-squeezed
  99. +1 −1  scripts/init.d-v6d
  100. +4 −4 scripts/init.d-xapi
  101. +4 −4 scripts/init.d-xapi-domains
  102. +6 −6 scripts/init.d-xapissl
  103. +6 −6 scripts/init.d-xenservices
  104. +4 −0 scripts/install.sh
  105. +1 −1  scripts/interface-reconfigure
  106. +1 −1  scripts/interface-reconfigure-test
  107. +1 −1  scripts/interface-reconfigure-test-setup
  108. +1 −1  scripts/interface-visualise
  109. +2 −2 scripts/license-check.py
  110. +1 −1  scripts/mpathalert-daemon
  111. +1 −1  scripts/plugins/iovirt
  112. +1 −1  scripts/poweron/iLO.py
  113. +2 −2 scripts/rewrite-management-interface
  114. +1 −1  scripts/rio.db.conf.skel
  115. +1 −1  scripts/runtests
  116. +2 −2 scripts/set-dom0-memory-target-from-packs
  117. +1 −1  scripts/sm_diagnostics
  118. +1 −1  scripts/static-vdis
  119. +1 −1  scripts/sysconfig-perfmon
  120. +1 −1  scripts/templates/debian
  121. +1 −1  scripts/thread_diagnostics
  122. +1 −1  scripts/vif
  123. +2 −2 scripts/vncterm-wrapper
  124. +1 −1  scripts/with-vdi
  125. +1 −1  scripts/xapi-autostart-vms
  126. +1 −1  scripts/xapi-logrotate
  127. +2 −2 scripts/xapi-rolling-upgrade-miami
  128. +2 −2 scripts/xapi.conf
  129. +6 −6 scripts/xe-backup-metadata
  130. +3 −3 scripts/xe-edit-bootloader
  131. +2 −2 scripts/xe-mount-iso-sr
  132. +3 −3 scripts/xe-reset-networking
  133. +6 −6 scripts/xe-restore-metadata
  134. +3 −3 scripts/xe-set-iscsi-iqn
  135. +3 −3 scripts/xe-toolstack-restart
  136. +3 −3 scripts/xe-xentrace
  137. +4 −4 scripts/xen-backend.agent
  138. +4 −4 scripts/xen-backend.rules
  139. +1 −1  scripts/xen-frontend.rules
View
2  .gitignore
@@ -197,3 +197,5 @@ ocaml/xenops/memory_breakdown
ocaml/xenops/squeezed
ocaml/xenops/squeezed_client
xapi.spec
+
+ocaml/fhs.*
View
18 Makefile
@@ -32,13 +32,17 @@ PLUGINDIR=/etc/xapi.d/plugins
HOOKSDIR=/etc/xapi.d
INVENTORY=/etc/xensource-inventory
XAPICONF=/etc/xapi.conf
-LIBEXECDIR=$(OPTDIR)/libexec
+LIBEXECDIR=/opt/xensource/libexec
SCRIPTSDIR=/etc/xensource/scripts
+SHAREDIR=/opt/xensource
+WEBDIR=/opt/xensource/www
+XHADIR=/opt/xensource/xha
+BINDIR=/opt/xensource/bin
-export VARDIR ETCDIR OPTDIR PLUGINDIR HOOKSDIR INVENTORY VARPATCHDIR LIBEXECDIR XAPICONF SCRIPTSDIR
+export VARDIR ETCDIR OPTDIR PLUGINDIR HOOKSDIR INVENTORY VARPATCHDIR LIBEXECDIR XAPICONF SCRIPTSDIR SHAREDIR WEBDIR XHADIR BINDIR
.PHONY: all
-all: version
+all: version ocaml/fhs.ml
omake phase1
omake phase2
omake phase3
@@ -116,9 +120,13 @@ ocaml/fhs.ml :
let libexecdir=\"$(LIBEXECDIR)\"\n \
let xapiconf=\"$(XAPICONF)\"\n \
let scriptsdir=\"$(SCRIPTSDIR)\"\n \
- let varpatchdir=\"$(VARPATCHDIR)\"\n" \
+ let varpatchdir=\"$(VARPATCHDIR)\"\n \
+ let webdir=\"$(WEBDIR)\"\n \
+ let xhadir=\"$(XHADIR)\"\n \
+ let bindir=\"$(BINDIR)\"\n \
+ let sharedir=\"$(SHAREDIR)\"\n" \
> ocaml/fhs.ml
-
+
.PHONY: clean
clean:
View
2  OMakefile
@@ -79,7 +79,7 @@ export
.PHONY: none
# Ocaml #############################################################################
-OCAML_PHASE1= generate_constants autogen_idl
+OCAML_PHASE1= autogen_idl
OCAML_PHASE2= $(if $(BYTE_ENABLED), ocaml/idl/ocaml_backend/xapi_client.cma) $(if $(NATIVE_ENABLED), ocaml/idl/ocaml_backend/xapi_client.cmxa)
# JS ################################################################################
View
4 ocaml/OMakefile
@@ -1,9 +1,11 @@
# You must set your XEN_ROOT env var before building
XEN_CFLAGS = -I$(XEN_ROOT)/usr/include
OCAMLINCLUDES = +ocamldoc
-OCAML_LIBS = $(ROOT)/ocaml/util/version $(ROOT)/ocaml/util/stats
+OCAML_LIBS = $(ROOT)/ocaml/fhs $(ROOT)/ocaml/util/version $(ROOT)/ocaml/util/stats
OCAMLPACKS = stdext log
+OCamlLibrary(fhs, fhs)
+
.SUBDIRS: \
ptoken \
autogen \
View
2  ocaml/auth/OMakefile
@@ -1,5 +1,5 @@
OTHER_CLIBS = -cclib -lpam
-OCAMLINCLUDES += ../autogen ../idl/ocaml_backend ../idl ../xapi
+OCAMLINCLUDES += ../autogen ../idl/ocaml_backend ../idl ../xapi ..
StaticCLibrary(auth_stubs, xa_auth xa_auth_stubs)
OCamlLibraryClib(pam, pam, auth_stubs)
View
8 ocaml/auth/extauth.ml
@@ -74,7 +74,7 @@ struct
end
(* some constants *)
-let extauth_hook_script_name = "extauth-hook" (* script name in /etc/xapi.d/plugins/ *)
+let extauth_hook_script_name = "extauth-hook" (* script name in @PLUGINDIR@/ *)
let event_name_after_subject_add = "after-subject-add"
let event_name_after_subject_remove = "after-subject-remove"
let event_name_after_xapi_initialize = "after-xapi-initialize"
@@ -102,10 +102,10 @@ let can_execute_extauth_hook_script ~__context host event_name =
(* use the generic call below to avoid concurrency problems between the script and host.{enable,disable}_extauth *)
let call_extauth_hook_script_in_host_wrapper ~__context host event_name ~call_plugin_fn =
(* CP-709: call extauth-hook-script *)
- (* Forkhelpers.execute_command_get_output hook-script "/etc/xapi.d/plugins/extauth-hook" *)
+ (* Forkhelpers.execute_command_get_output hook-script "@PLUGINDIR@/extauth-hook" *)
(* fork a new thread and call new xapi.host.call-subject-add-hook-script method *)
(* see xapi_sync.ml *)
- (* host.call-plugins scriptname (calls /etc/xapi.d/plugins/scriptname*)
+ (* host.call-plugins scriptname (calls @PLUGINDIR@/scriptname*)
if can_execute_extauth_hook_script ~__context host event_name
then begin
@@ -148,7 +148,7 @@ let call_extauth_hook_script_in_host ~__context host event_name =
let call_plugin_fn () =
Helpers.call_api_functions ~__context (fun rpc session_id ->
Client.Client.Host.call_plugin rpc session_id host (* will call extauth plugin with mutex *)
- extauth_hook_script_name (* script name in /etc/xapi.d/plugins/ *)
+ extauth_hook_script_name (* script name in @PLUGINDIR@/ *)
event_name (* event name sent to script *)
event_params (* parameters sent to event name *)
)
View
2  ocaml/auth/extauth_plugin_ADlikewise.ml
@@ -700,7 +700,7 @@ let on_disable config_params =
debug "Doing a manual Likewise domain-leave cleanup...";
(* When likewise raises an exception during domain-leave, we try again, using *)
(* some of the command-line workarounds that Kyle describes in CA-27627: *)
- let lw_force_domain_leave_script = Xapi_globs.base_path ^ "/libexec/lw-force-domain-leave" in
+ let lw_force_domain_leave_script = Filename.concat Fhs.libexecdir "lw-force-domain-leave" in
(try
let output, stderr = Forkhelpers.execute_command_get_output lw_force_domain_leave_script [] in
debug "execute %s: stdout=[%s],stderr=[%s]" lw_force_domain_leave_script (Stringext.String.replace "\n" ";" output) (Stringext.String.replace "\n" ";" stderr)
View
2  ocaml/cdrommon/OMakefile
@@ -1,4 +1,4 @@
-OCAML_LIBS = ../util/version ../idl/ocaml_backend/common
+OCAML_LIBS = ../fhs ../util/version ../idl/ocaml_backend/common
OCAMLINCLUDES = ../xapi
OCAMLPACKS += unix cdrom
View
6 ocaml/database/OMakefile
@@ -1,5 +1,5 @@
-OCAMLINCLUDES = ../idl/ocaml_backend ../xapi ../idl ../util ../autogen
+OCAMLINCLUDES = ../idl/ocaml_backend ../xapi ../idl ../util ../autogen ..
OCAMLPACKS = xml-light2 stdext stunnel http-svr log sexpr rpc-light
#OCAMLPPFLAGS = -pp "camlp4o"
#OCAMLDEPFLAGS = -pp "camlp4o"
@@ -13,7 +13,7 @@ OCamlProgram(unit_test_sql, unit_test_sql)
BLOCK_DEVICE_IO_FILES = \
block_device_io_errors \
block_device_io \
- ../xapi/config_constants ../xapi/xapi_globs ../idl/ocaml_backend/ref \
+ ../xapi/xapi_globs ../idl/ocaml_backend/ref \
../xapi/helper_process ../xapi/helper_hostname ../idl/api_errors
OCamlProgram(block_device_io, $(BLOCK_DEVICE_IO_FILES))
@@ -28,7 +28,7 @@ section:
OCamlProgram(database_test, $(DATABASE_TEST_FILES))
section:
- OCAML_LIBS += ../idl/ocaml_backend/common ../idl/ocaml_backend/client ../idl/ocaml_backend/server
+ OCAML_LIBS += ../idl/ocaml_backend/common ../idl/ocaml_backend/client ../idl/ocaml_backend/server
OCamlProgram(unit_test_marshall, unit_test_marshall db_remote_cache_access_v1)
.PHONY: install
View
2  ocaml/database/redo_log.ml
@@ -202,7 +202,7 @@ let string_to_redo_log_entry str =
exception RedoLogFailure of string
exception CommunicationsProblem of string
-let prog = Xapi_globs.base_path ^ "/libexec/block_device_io"
+let prog = Filename.concat Fhs.libexecdir "block_device_io"
let generation_size = 16
let length_size = 16
View
2  ocaml/db_process/OMakefile
@@ -1,4 +1,4 @@
-OCAML_LIBS = ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend/client ../util/stats ../idl/ocaml_backend/server
+OCAML_LIBS = ../fhs ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend/client ../util/stats ../idl/ocaml_backend/server
OCAMLINCLUDES = ../idl/ocaml_backend ../xapi ../database
OCAMLPACKS = xml-light2 uuid sexpr log stunnel http-svr
View
2  ocaml/gpg/OMakefile
@@ -1,4 +1,4 @@
-OCAMLINCLUDES += ../xapi
+OCAMLINCLUDES += ../xapi ..
.PHONY: clean
clean:
View
2  ocaml/gpg/gpg.ml
@@ -23,7 +23,7 @@ open D
let filename = ref ""
let gpg_binary_path = "/usr/bin/gpg"
-let gpg_homedir = Xapi_globs.base_path ^ "/gpg/"
+let gpg_homedir = Filename.concat Fhs.optdir "gpg/"
let gpg_pub_keyring = gpg_homedir ^ "pubring.gpg"
let allowed_gpg_checksum =
[ "be00ee82bffad791edfba477508d5d84"; (* centos52 version *)
View
2  ocaml/idl/ocaml_backend/OMakefile
@@ -52,7 +52,7 @@ autogen_idl: $(AUTOGEN_DIR)/client.ml $(AUTOGEN_DIR)/aPI.ml $(AUTOGEN_DIR)/serve
COMMON_OBJS = ref \
../datamodel_types event_types \
- ../api_errors ../api_messages ../../xapi/config_constants ../../xapi/xapi_globs \
+ ../api_errors ../api_messages ../../xapi/xapi_globs \
../constants
CLIENT_OBJS = $(AUTOGEN_DIR)/aPI $(AUTOGEN_DIR)/client event_helper
SERVER_OBJS = ../../database/escaping locking_helpers \
View
5 ocaml/license/OMakefile
@@ -1,10 +1,11 @@
OCAML_LIBS = ../util/version ../idl/ocaml_backend/xapi_client
-OCAMLINCLUDES = ../idl/ocaml_backend ../idl ../autogen ../xapi ../gpg ../util
+OCAMLINCLUDES = ../idl/ocaml_backend ../idl ../autogen ../xapi ../gpg ../util ..
OCAMLPACKS = xml-light2 stdext stunnel http-svr log rpc-light
UseCamlp4(rpc-light.syntax, v6rpc v6errors)
V6FILES = \
+ ../fhs \
fakev6 \
v6rpc \
v6errors \
@@ -18,7 +19,7 @@ V6D = v6d
OCamlProgram($(V6D), $(V6FILES))
OCamlDocProgram($(V6D), $(V6FILES))
-OCamlProgram(v6d-reopen-logs, v6d_reopen_logs)
+OCamlProgram(v6d-reopen-logs, v6d_reopen_logs ../fhs)
.PHONY: install
install: $(V6D)
View
2  ocaml/license/v6client.ml
@@ -20,7 +20,7 @@ exception V6DaemonFailure
let retry = ref true
(* RPC function for communication with the v6 daemon *)
-let socket = "/var/xapi/v6"
+let socket = Filename.concat Fhs.vardir "v6"
let v6rpc call =
let open Xmlrpc_client in
XMLRPC_protocol.rpc ~transport:(Unix socket) ~http:(xmlrpc ~version:"1.0" "/") call
View
2  ocaml/license/v6d_reopen_logs.ml
@@ -13,7 +13,7 @@
*)
(** Small executable that sends a reopen-logs XML/RPC message to the licensing daemon *)
-let socket = "/var/xapi/v6"
+let socket = Filename.concat Fhs.vardir "v6"
(* RPC function for communication with the v6 daemon *)
let v6rpc xml =
View
2  ocaml/license/v6daemon.ml
@@ -42,7 +42,7 @@ let daemon_init post_daemonize_hook process =
post_daemonize_hook ();
(* unix socket *)
- let unix_socket_path = "/var/xapi/v6" in
+ let unix_socket_path = Filename.concat Fhs.vardir "v6" in
Unixext.mkdir_safe (Filename.dirname unix_socket_path) 0o700;
Unixext.unlink_safe unix_socket_path;
let domain_sock = Http_svr.bind (Unix.ADDR_UNIX(unix_socket_path)) "unix_rpc" in
View
2  ocaml/lvhdrt/OMakefile
@@ -1,4 +1,4 @@
-OCAML_LIBS = ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend/client
+OCAML_LIBS = ../fhs ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend/client
OCAMLINCLUDES = ../xapi ../idl/ocaml_backend/ ../idl ../autogen
OCAMLPACKS = xml-light2 stdext stunnel http-svr log rpc-light
View
4 ocaml/mpathalert/OMakefile
@@ -1,8 +1,8 @@
OCAML_LIBS = ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend/client
-OCAMLINCLUDES = ../idl/ocaml_backend/ ../idl ../autogen
+OCAMLINCLUDES = ../idl/ocaml_backend/ ../idl ../autogen ..
OCAMLPACKS = xml-light2 stdext stunnel http-svr log rpc-light
-OCamlProgram(mpathalert, mpathalert)
+OCamlProgram(mpathalert, mpathalert ../fhs)
OCamlDocProgram(mpathalert, mpathalert)
.PHONY: clean
View
2  ocaml/mpathalert/mpathalert.ml
@@ -296,7 +296,7 @@ let _ =
let rpc xml =
let open Xmlrpc_client in
let http = xmlrpc ~version:"1.0" "/" in
- XML_protocol.rpc ~transport:(Unix "/var/xapi/xapi") ~http xml in
+ XML_protocol.rpc ~transport:(Unix (Filename.concat Fhs.vardir "xapi")) ~http xml in
let queue = Queue.create () in
let msg = Buffer.create 1024 in
View
8 ocaml/perftest/OMakefile
@@ -1,11 +1,11 @@
-OCAML_LIBS = ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend/client
-OCAMLINCLUDES = ../idl/ocaml_backend ../xapi ../idl ../autogen ../client_records
+OCAML_LIBS = ../fhs ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend/client
+OCAMLINCLUDES = ../idl/ocaml_backend ../xapi ../idl ../autogen ../client_records ..
OCAMLPACKS = xml-light2 stdext stunnel http-svr log rpc-light
-PERFTEST_FILES = scenario perfutil createVM createpool testtypes perftest tests ../xapi/xapi_inventory perfdebug
+PERFTEST_FILES = scenario perfutil createVM createpool testtypes perftest tests ../xapi/xapi_inventory perfdebug
OCamlProgram(perftest, $(PERFTEST_FILES))
OCamlDocProgram(perftest, $(PERFTEST_FILES))
-OCamlProgram(apiperf, perfutil apiperf)
+OCamlProgram(apiperf, perfutil apiperf ../fhs)
OCamlProgram(histogram, statistics histogram gnuplot testtypes perfdebug graphutil)
OCamlProgram(cumulative_time, cumulative_time gnuplot testtypes perfdebug graphutil)
View
2  ocaml/perftest/apiperf.ml
@@ -30,7 +30,7 @@ let use_stunnel_cache = ref false
let master = ref false
let slave_limit = ref 0
let threads = ref 1
-let url = ref "file:///var/xapi/xapi"
+let url = ref ("file://" ^ Fhs.vardir ^ "xapi")
type url =
View
2  ocaml/perftest/client_stunnel.conf
@@ -9,6 +9,6 @@ client=yes
[localhost-xapi]
accept = 80
connect = 10.80.226.181:443
-cert = /etc/xensource/xapi-ssl.pem
+cert = @ETCDIR@/xapi-ssl.pem
View
2  ocaml/perftest/perfutil.ml
@@ -18,7 +18,7 @@ open Stringext
let rpc xml =
let open Xmlrpc_client in
- XML_protocol.rpc ~transport:(Unix "/var/xapi/xapi") ~http:(xmlrpc ~version:"1.0" "/") xml
+ XML_protocol.rpc ~transport:(Unix (Filename.concat Fhs.vardir "xapi")) ~http:(xmlrpc ~version:"1.0" "/") xml
let remoterpc host xml =
let open Xmlrpc_client in
View
4 ocaml/ptoken/OMakefile
@@ -1,9 +1,9 @@
OCAMLPACKS = uuid
-
+OCAMLINCLUDES = ..
GENSECRET_SRC_FILES = genptoken.ml
section
- OCamlProgram(genptoken, genptoken)
+ OCamlProgram(genptoken, genptoken ../fhs)
.PHONY: clean
clean:
View
2  ocaml/ptoken/genptoken.ml
@@ -2,7 +2,7 @@
type options = { force : bool; tgtfile : string }
-let options = ref { force = false; tgtfile = "/etc/xensource/ptoken" }
+let options = ref { force = false; tgtfile = Filename.concat Fhs.etcdir "ptoken" }
let set_force _ = options := { !options with force = true }
let set_target s = options := { !options with tgtfile = s }
View
8 ocaml/sm-cli/OMakefile
@@ -1,12 +1,12 @@
OCAML_LIBS =
-OCAMLINCLUDES = ../xapi
+OCAMLINCLUDES = ../xapi ..
OCAMLPACKS = xml-light2 stdext stunnel log http-svr oUnit
section
- OCAMLINCLUDES += .
+ OCAMLINCLUDES += .
OCAMLFLAGS = -dtypes -thread -warn-error F
- CLI_FILES = main ../xapi/storage_interface ../xapi/vdi_automaton
- TEST_FILES = test ../xapi/storage_interface ../xapi/vdi_automaton
+ CLI_FILES = main ../xapi/storage_interface ../xapi/vdi_automaton ../fhs
+ TEST_FILES = test ../xapi/storage_interface ../xapi/vdi_automaton ../fhs
OCamlProgram(sm, $(CLI_FILES))
OCamlDocProgram(sm, $(CLI_FILES))
OCamlProgram(smtest, $(TEST_FILES))
View
2  ocaml/sm-cli/main.ml
@@ -20,7 +20,7 @@ open Fun
open Stringext
open Xmlrpc_client
-let url = ref (Http.Url.File ({ Http.Url.path = "/var/xapi/storage" }, "/"))
+let url = ref (Http.Url.File ({ Http.Url.path = Filename.concat Fhs.vardir "storage" }, "/"))
module RPC = struct
let rpc call =
View
2  ocaml/sm-cli/test.ml
@@ -22,7 +22,7 @@ open Stringext
open Xmlrpc_client
-let default_path = "/var/xapi/storage"
+let default_path = Filename.concat Fhs.vardir "storage"
let transport = ref (Unix default_path)
let rpc call =
View
3  ocaml/util/OMakefile
@@ -1,3 +1,6 @@
+OCAMLINCLUDES = ..
+OCAML_LIBS = ../fhs
+
#OCamlLibrary(util_globs_inventory, util_globs_inventory)
OCamlLibrary(util_inventory, util_globs_inventory util_inventory)
OCamlLibrary(version, util_globs_inventory util_inventory version)
View
2  ocaml/util/util_globs_inventory.ml
@@ -1,2 +1,2 @@
(* path to the xensource inventory file *)
-let inventory_filename = "/etc/xensource-inventory"
+let inventory_filename = Fhs.inventory
View
2  ocaml/util/util_inventory.ml
@@ -81,7 +81,7 @@ let read_inventory_contents () =
match parse_inventory_entry line with
| Some (k, v) -> Hashtbl.add inventory k v
| None -> warn
- "Failed to parse line from xensource-inventory file: %s" line)
+ "Failed to parse line from inventory file: %s" line)
inventory_filename;
loaded_inventory := true
View
4 ocaml/vncproxy/OMakefile
@@ -1,8 +1,8 @@
OCAML_LIBS = ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend/client
-OCAMLINCLUDES = ../idl/ocaml_backend ../idl ../autogen
+OCAMLINCLUDES = ../idl/ocaml_backend ../idl ../autogen ..
OCAMLPACKS = xml-light2 stdext stunnel http-svr rpc-light
-OCamlProgram(vncproxy, vncproxy)
+OCamlProgram(vncproxy, vncproxy ../fhs)
.PHONY: install
install:
View
2  ocaml/vncproxy/vncproxy.ml
@@ -65,7 +65,7 @@ let _ =
let open Xmlrpc_client in
let http = xmlrpc ~version:"1.0" "/" in
match !server with
- | "" -> XML_protocol.rpc ~transport:(Unix "/var/xapi/xapi") ~http xml
+ | "" -> XML_protocol.rpc ~transport:(Unix (Filename.concat Fhs.vardir "xapi")) ~http xml
| host -> XML_protocol.rpc ~transport:(SSL(SSL.make ~use_fork_exec_helper:false (), host, 443)) ~http xml in
let find_vm rpc session_id vm =
View
12 ocaml/xapi/OMakefile
@@ -1,10 +1,10 @@
OCAMLPACKS = xml-light2 cdrom pciutil sexpr log stunnel http-svr rss xen-utils netdev tapctl vhd xenstore rpc-light
-OCAML_LIBS = ../util/version ../util/vm_memory_constraints ../util/sanitycheck ../util/stats \
+OCAML_LIBS = ../fhs ../util/version ../util/vm_memory_constraints ../util/sanitycheck ../util/stats \
../idl/ocaml_backend/common ../idl/ocaml_backend/client ../idl/ocaml_backend/server ../util/ocamltest
OCAMLINCLUDES = ../idl ../idl/ocaml_backend \
../autogen ../database/ \
../xenops ../xva ../util \
- ../auth ../license ../client_records ../rfb ../gpg
+ ../auth ../license ../client_records ../rfb ../gpg ..
UseCamlp4(rpc-light.syntax, features rrd monitor_fake monitor_fake_common vdi_automaton storage_impl xapi_udhcpd)
UseCamlp4(rpc-light.idl, storage_interface)
@@ -278,13 +278,6 @@ OCamlProgram(at_least_once_more, at_least_once_more at_least_once_more_test)
.DEFAULT: xapi
-.PHONY: generate_constants
-
-generate_constants: config_constants.ml
-
-config_constants.ml: config_constants.ml.in
- sed "s!@OPTDIR@!\"$(OPTDIR)\"!" $< > $@
-
.PHONY: install
install:
mkdir -p $(DESTDIR)$(OPTDIR)/bin
@@ -306,6 +299,5 @@ sdk-install: install
.PHONY: clean
clean:
rm -rf $(CLEAN_OBJS) *.aux *.log *.fig xapi
- rm -f config_constants.ml
rm -f binpack xapi_unit_test sparse_dd fakeguestagent monitor_fake_plugin rrddump quicktestbin
View
2  ocaml/xapi/certificates.ml
@@ -23,7 +23,7 @@ open Client
module D=Debug.Debugger(struct let name="certificates" end)
open D
-let server_cert = "/etc/xensource/xapi-ssl.pem"
+let server_cert = Filename.concat Fhs.etcdir "xapi-ssl.pem"
let c_rehash = "/usr/bin/c_rehash"
let pem_certificate_header = "-----BEGIN CERTIFICATE-----"
let pem_certificate_footer = "-----END CERTIFICATE-----"
View
1  ocaml/xapi/config_constants.ml.in
@@ -1 +0,0 @@
-let base_path = @OPTDIR@
View
2  ocaml/xapi/console.ml
@@ -62,7 +62,7 @@ let ws_proxy __context req protocol port s =
| `rdp -> "rdp"
in
- let real_path = "/var/xapi/wsproxy" in
+ let real_path = Filename.concat Fhs.vardir "wsproxy" in
let sock =
try
Some (Fecomms.open_unix_domain_sock_client real_path)
View
2  ocaml/xapi/create_misc.ml
@@ -407,7 +407,7 @@ let create_host_cpu ~__context =
if !i >= 0 then String.sub s 0 (!i + 1) else "" in
- (* The boot-time CPU info is copied into a file in /etc/xensource/ in the xenservices init script;
+ (* The boot-time CPU info is copied into a file in @ETCDIR@/ in the xenservices init script;
we use that to generate CPU records from. This ensures that if xapi is started after someone has
modified dom0's VCPUs we don't change out host config... [Important to get this right, otherwise
pool homogeneity checks fail] *)
View
2  ocaml/xapi/events.ml
@@ -48,7 +48,7 @@ module Crashdump = struct
let to_file domid filename =
if true then (
(* opensource version *)
- let path = Xapi_globs.base_path ^ "/libexec/dumpcore" in
+ let path = Filename.concat Fhs.libexecdir "dumpcore" in
let args = [ "-domid"; string_of_int domid;
"-file"; filename ] in
let pid = Forkhelpers.safe_close_and_exec None None None [] path args in
View
2  ocaml/xapi/helpers.ml
@@ -644,7 +644,7 @@ let on_oem ~__context =
exception File_doesnt_exist of string
-let find_partition_path = Xapi_globs.base_path ^ "/libexec/find-partition"
+let find_partition_path = Filename.concat Fhs.libexecdir "find-partition"
let find_secondary_partition () =
try
View
2  ocaml/xapi/monitor.ml
@@ -467,7 +467,7 @@ let set_cache_sr sr_uuid =
let unset_cache_sr () =
Mutex.execute cache_sr_lock (fun () -> cache_sr_uuid := None)
-let tapdisk_cache_stats = Xapi_globs.base_path ^ "/bin/tapdisk-cache-stats"
+let tapdisk_cache_stats = Filename.concat Fhs.bindir "tapdisk-cache-stats"
let read_cache_stats timestamp =
let cache_sr_opt = Mutex.execute cache_sr_lock (fun () -> !cache_sr_uuid) in
View
2  ocaml/xapi/monitor_fake_common.ml
@@ -10,5 +10,5 @@ type fake_ds = {
type fake_ds_list = fake_ds list with rpc
-let fake_dir = "/var/xapi/fake_data"
+let fake_dir = Filename.concat Fhs.vardir "fake_data"
View
2  ocaml/xapi/nm.ml
@@ -35,7 +35,7 @@ let update_inventory ~__context =
let bridges = List.map (fun (_, pif_r) -> Db.Network.get_bridge ~__context ~self:pif_r.API.pIF_network) pifs in
Xapi_inventory.update Xapi_inventory._current_interfaces (String.concat " " bridges)
-let interface_reconfigure_script = Xapi_globs.base_path ^ "/libexec/interface-reconfigure"
+let interface_reconfigure_script = Filename.concat Fhs.libexecdir "interface-reconfigure"
(* Call the interface reconfigure script. For development ignore the exn if it doesn't exist *)
let reconfigure_pif ~__context (pif: API.ref_PIF) args =
View
2  ocaml/xapi/pool_db_backup.ml
@@ -91,7 +91,7 @@ let prepare_database_for_restore ~old_context ~new_context =
let physical = List.filter (fun self -> Db.PIF.get_physical ~__context:old_context ~self) all_pifs in
List.map (fun self -> Db.PIF.get_device ~__context:old_context ~self, self) physical in
- (* Since it's difficult for us to change the /etc/xensource-inventory and the ifcfg-
+ (* Since it's difficult for us to change the @INVENTORY@ and the ifcfg-
files, we /preserve/ the current management PIF across the restore. NB this interface
might be a bond or a vlan. *)
let mgmt_dev =
View
2  ocaml/xapi/quicktest_storage.ml
@@ -467,7 +467,7 @@ let sr_scan_test caps session_id sr =
Client.SR.scan !rpc session_id sr;
success test
-let iso_path = Xapi_globs.base_path ^ "/packages/iso"
+let iso_path = Filename.concat Fhs.sharedir "packages/iso"
let packages_iso_test session_id =
let test = make_test ("ISO SR should be able to create VDIs for " ^ iso_path) 2 in
View
2  ocaml/xapi/sm_exec.ml
@@ -23,7 +23,7 @@ open Smint
module D=Debug.Debugger(struct let name="sm_exec" end)
open D
-let sm_daemon_dir = "/var/xapi/sm"
+let sm_daemon_dir = Filename.concat Fhs.vardir "sm"
let cmd_name driver = sprintf "%s/%sSR" Xapi_globs.sm_dir driver
let daemon_path driver = sprintf "%s/%s" sm_daemon_dir driver
View
2  ocaml/xapi/sparse_dd_wrapper.ml
@@ -21,7 +21,7 @@ open Printf
module D=Debug.Debugger(struct let name="xapi" end)
open D
-let sparse_dd_path = Xapi_globs.base_path ^ "/libexec/sparse_dd"
+let sparse_dd_path = Filename.concat Fhs.libexecdir "sparse_dd"
(** Use the new external sparse_dd program *)
let dd ~__context prezeroed infile outfile size =
View
2  ocaml/xapi/static_vdis.ml
@@ -22,7 +22,7 @@ open Stringext
open Pervasiveext
include Static_vdis_list (* include the vdi type and the list() function *)
-let static_vdis = Xapi_globs.base_path ^ "/bin/static-vdis"
+let static_vdis = Filename.concat Fhs.bindir "static-vdis"
(** Generate the static configuration and attach the VDI now *)
let permanent_vdi_attach ~__context ~vdi ~reason =
View
2  ocaml/xapi/static_vdis_list.ml
@@ -27,7 +27,7 @@ type vdi = {
(** Returns a list of vdi records, one for each VDI statically configured on this host *)
let list () =
(* Read the filesystem structure directly *)
- let main_dir = "/etc/xensource/static-vdis" in
+ let main_dir = Filename.concat Fhs.etcdir "static-vdis" in
let all = try Array.to_list (Sys.readdir main_dir) with Sys_error _ -> [] in
List.map (fun x ->
let path = Filename.concat main_dir x in
View
2  ocaml/xapi/storage_impl.ml
@@ -646,7 +646,7 @@ module Local_domain_socket = struct
let socket = ref None
- let path = "/var/xapi/storage"
+ let path = Filename.concat Fhs.vardir "storage"
let xmlrpc_handler process req bio _ =
let body = Http_svr.read_body req bio in
View
2  ocaml/xapi/vmops.ml
@@ -577,7 +577,7 @@ let create_device_emulator ~__context ~xc ~xs ~self ?(restore=false) ?vnc_statef
List.map (String.strip String.isspace) l
with _ -> []
in
- let dmpath = Xapi_globs.base_path ^ "/libexec/qemu-dm-wrapper" in
+ let dmpath = Filename.concat Fhs.libexecdir "qemu-dm-wrapper" in
let dmstart = if restore then Device.Dm.restore else Device.Dm.start in
(* Display and input devices are usually conflated *)
View
8 ocaml/xapi/xapi.ml
@@ -675,7 +675,7 @@ let common_http_handlers = [
("get_export_metadata", (Http_svr.FdIO Export.metadata_handler));
("connect_console", Http_svr.FdIO (Console.handler Console.real_proxy));
("connect_console_ws", Http_svr.FdIO (Console.handler Console.ws_proxy));
- ("get_root", Http_svr.BufIO (Fileserver.send_file "/" (Xapi_globs.base_path ^ "/www")));
+ ("get_root", Http_svr.BufIO (Fileserver.send_file "/" Fhs.webdir));
("post_cli", (Http_svr.BufIO Xapi_cli.handler));
("get_host_backup", (Http_svr.FdIO Xapi_host_backup.host_backup_handler));
("put_host_restore", (Http_svr.FdIO Xapi_host_backup.host_restore_handler));
@@ -1201,10 +1201,10 @@ let _ =
Unixext.daemonize ();
Unixext.pidfile_write "/var/run/xapi.pid";
- (* chdir to /var/xapi/debug so that's where xapi coredumps go
+ (* chdir to @VARDIR@/debug so that's where xapi coredumps go
(in the unlikely event that there are any ;) *)
- Unixext.mkdir_rec "/var/xapi/debug" 0o700;
- Unix.chdir "/var/xapi/debug";
+ Unixext.mkdir_rec (Filename.concat Fhs.vardir "debug") 0o700;
+ Unix.chdir (Filename.concat Fhs.vardir "debug");
set_thread_queue_params ();
View
69 ocaml/xapi/xapi_globs.ml
@@ -22,7 +22,7 @@ module D = Debug.Debugger(struct let name="xapi_globs" end)
(* xapi process returns this code on exit when it wants to be restarted *)
let restart_return_code = 123
-let pool_secret_path = "/etc/xensource/ptoken"
+let pool_secret_path = Filename.concat Fhs.etcdir "ptoken"
let pool_secret = ref ""
let localhost_ref : [`host] Ref.t ref = ref Ref.null
@@ -49,7 +49,7 @@ let xencenter_max_verstring = "1.10"
(* linux pack vsn key in host.software_version (used for a pool join restriction *)
let linux_pack_vsn_key = "xs:linux"
-let packs_dir = "/etc/xensource/installed-repos"
+let packs_dir = Filename.concat Fhs.etcdir "installed-repos"
let ssl_pid = ref 0
@@ -63,10 +63,10 @@ let https_port = ref default_ssl_port
let xapi_gc_debug = ref true
-let unix_domain_socket = "/var/xapi/xapi"
-let local_storage_unix_domain_socket = "/var/xapi/storage-local"
-let storage_unix_domain_socket = "/var/xapi/storage"
-let local_database = "/var/xapi/local.db"
+let unix_domain_socket = Filename.concat Fhs.vardir "xapi"
+let local_storage_unix_domain_socket = Filename.concat Fhs.vardir "storage-local"
+let storage_unix_domain_socket = Filename.concat Fhs.vardir "storage"
+let local_database = Filename.concat Fhs.vardir "local.db"
(* if a slave in emergency "cannot see master mode" then this flag is set *)
@@ -83,17 +83,16 @@ let xe_key = "/mh/XenSource-TM_XenEnterprise-TM"
let xe_val = "XenSource(TM) and XenEnterprise(TM) are registered trademarks of XenSource Inc."
(* Base path and some of its immediate dependencies. *)
-let base_path = Config_constants.base_path
-let xe_path = base_path ^ "/bin/xe"
-let sm_dir = base_path ^ "/sm"
-
-let config_file = ref "/etc/xapi.conf"
-let log_config_file = ref "/etc/xensource/log.conf"
-let db_conf_path = "/etc/xensource/db.conf"
-let remote_db_conf_fragment_path = "/etc/xensource/remote.db.conf"
+let xe_path = Filename.concat Fhs.bindir "xe"
+let sm_dir = Filename.concat Fhs.optdir "sm"
+
+let config_file = ref Fhs.xapiconf
+let log_config_file = ref (Filename.concat Fhs.etcdir "log.conf")
+let db_conf_path = Filename.concat Fhs.etcdir "db.conf"
+let remote_db_conf_fragment_path = Filename.concat Fhs.etcdir "remote.db.conf"
let simulator_config_file = ref "/etc/XenServer-simulator.conf"
-let pool_config_file = "/etc/xensource/pool.conf"
-let cpu_info_file = "/etc/xensource/boot_time_cpus"
+let pool_config_file = Filename.concat Fhs.etcdir "pool.conf"
+let cpu_info_file = Filename.concat Fhs.etcdir "boot_time_cpus"
let initial_host_free_memory_file = "/var/run/xapi/boot_time_memory"
let using_rrds = ref false
@@ -174,7 +173,7 @@ let tools_sr_tag = "xenserver_tools_sr"
let rio_tools_sr_name = "XenSource Tools"
let miami_tools_sr_name = "XenServer Tools"
-let tools_sr_dir = base_path ^ "/packages/iso"
+let tools_sr_dir = Filename.concat Fhs.sharedir "packages/iso"
let default_template_key = "default_template"
let linux_template_key = "linux_template"
@@ -191,7 +190,7 @@ let logrot_max = ref (1024*16*1024)
(* logrotate is called without a stdin, and when it fork-and-execs gzip, it opens the src *)
(* getting fd 0, opens the dest getting fd 3, then forks, then dups 0 to 0, dups 3 to 1 and *)
(* then closes 0 and 3! *)
-let logrot_cmd = base_path ^ "/libexec/logrotate.sh"
+let logrot_cmd = Filename.concat Fhs.libexecdir "logrotate.sh"
let logrot_arg = [ ]
(* Error codes for internal storage backends -- these have counterparts in sm.hg/drivers/XE_SR_ERRORCODES.xml *)
@@ -203,16 +202,16 @@ let sm_error_generic_VDI_create_failure = 78
let sm_error_generic_VDI_delete_failure = 80
(* temporary restore path for db *)
-let db_temporary_restore_path = "/var/xapi/restore_db.db"
+let db_temporary_restore_path = Filename.concat Fhs.vardir "restore_db.db"
(* temporary path for the HA metadata database *)
-let ha_metadata_db = "/var/xapi/ha_metadata.db"
+let ha_metadata_db = Filename.concat Fhs.vardir "ha_metadata.db"
(* temporary path for the general metadata database *)
-let gen_metadata_db = "/var/xapi/gen_metadata.db"
+let gen_metadata_db = Filename.concat Fhs.vardir "gen_metadata.db"
(* temporary path for opening a foreign metadata database *)
-let foreign_metadata_db = "/var/xapi/foreign.db"
+let foreign_metadata_db = Filename.concat Fhs.vardir "foreign.db"
let migration_failure_test_key = "migration_wings_fall_off" (* set in other-config to simulate migration failures *)
@@ -252,14 +251,14 @@ let pool_ha_num_host_failures = "ha_tolerated_host_failures"
(* the other-config key that reflects whether the pool is overprovisioned *)
let pool_ha_currently_over_provisioned = "ha_currently_over_provisioned"
-let backup_db = "/var/xapi/state-backup.db"
+let backup_db = Filename.concat Fhs.vardir "state-backup.db"
(* Place where database XML backups are kept *)
-let backup_db_xml = "/var/xapi/state-backup.xml"
+let backup_db_xml = Filename.concat Fhs.vardir "state-backup.xml"
(* Directory containing scripts which are executed when a node becomes master
and when a node gives up the master role *)
-let master_scripts_dir = "/etc/xensource/master.d"
+let master_scripts_dir = Filename.concat Fhs.etcdir "master.d"
(* Indicates whether we should allow clones of suspended VMs via VM.clone *)
let pool_allow_clone_suspended_vm = "allow_clone_suspended_vm"
@@ -268,8 +267,8 @@ let pool_allow_clone_suspended_vm = "allow_clone_suspended_vm"
let shared_db_vdi_size = 134217728L (* 128 * 1024 * 1024 = 128 megs *)
(* Mount point for the shared DB *)
-let shared_db_mount_point = "/var/xapi/shared_db"
-let snapshot_db = "/var/xapi/snapshot.db"
+let shared_db_mount_point = Filename.concat Fhs.vardir "shared_db"
+let snapshot_db = Filename.concat Fhs.vardir "snapshot.db"
(* Device for shared DB VBD *)
let shared_db_device = "15"
@@ -337,10 +336,10 @@ let default_ha_timeout = "default_ha_timeout"
(* Executed during startup when the API/database is online but before storage or networks
are fully initialised. *)
-let startup_script_hook = base_path ^ "/libexec/xapi-startup-script"
+let startup_script_hook = Filename.concat Fhs.libexecdir "xapi-startup-script"
(* Executed when a rolling upgrade is detected starting or stopping *)
-let rolling_upgrade_script_hook = base_path ^ "/libexec/xapi-rolling-upgrade"
+let rolling_upgrade_script_hook = Filename.concat Fhs.libexecdir "xapi-rolling-upgrade"
(* When set to true indicates that the host has still booted so we're initialising everything
from scratch e.g. shared storage, sampling boot free mem etc *)
@@ -353,12 +352,12 @@ let listen_backlog = 128
let artificial_reboot_delay = "artificial-reboot-delay"
(* Xapi script hooks root *)
-let xapi_hooks_root = "/etc/xapi.d/"
+let xapi_hooks_root = Fhs.hooksdir
(* RRD storage location *)
-let xapi_rrd_location = "/var/xapi/blobs/rrds"
+let xapi_rrd_location = Filename.concat Fhs.vardir "blobs/rrds"
-let xapi_blob_location = "/var/xapi/blobs"
+let xapi_blob_location = Filename.concat Fhs.vardir "blobs"
let last_blob_sync_time = "last_blob_sync_time"
@@ -378,13 +377,13 @@ let http_limit_max_rrd_size = 2 * 1024 * 1024 (* 2M -- FIXME : need to go below
let message_limit=10000
-let xapi_message_script = base_path ^ "/libexec/mail-alarm"
+let xapi_message_script = Filename.concat Fhs.libexecdir "mail-alarm"
(* Emit a warning if more than this amount of clock skew detected *)
let max_clock_skew = 5. *. 60. (* 5 minutes *)
(* Optional directory containing XenAPI plugins *)
-let xapi_plugins_root = "/etc/xapi.d/plugins"
+let xapi_plugins_root = Fhs.plugindir
@@ -514,7 +513,7 @@ let serialize_pool_enable_disable_extauth = Mutex.create()
let event_hook_auth_on_xapi_initialize_succeeded = ref false
(** Directory used by the v6 license policy engine for caching *)
-let upgrade_grace_file = "/var/xapi/ugp"
+let upgrade_grace_file = Filename.concat Fhs.vardir "ugp"
(** Where the ballooning daemon writes the initial overhead value *)
let squeezed_reserved_host_memory = "/squeezed/reserved-host-memory"
View
18 ocaml/xapi/xapi_ha.ml
@@ -36,15 +36,15 @@ let ha_redo_log = Redo_log.create ~name:"HA redo log" ~state_change_callback:Non
(*********************************************************************************************)
(* Interface with the low-level HA subsystem *)
-let ha_set_pool_state = Xapi_globs.base_path ^ "/xha/ha_set_pool_state"
-let ha_start_daemon = Xapi_globs.base_path ^ "/xha/ha_start_daemon"
-let ha_stop_daemon = Xapi_globs.base_path ^ "/xha/ha_stop_daemon"
-let ha_query_liveset = Xapi_globs.base_path ^ "/xha/ha_query_liveset"
-let ha_propose_master = Xapi_globs.base_path ^ "/xha/ha_propose_master"
-let ha_disarm_fencing = Xapi_globs.base_path ^ "/xha/ha_disarm_fencing"
-let ha_set_excluded = Xapi_globs.base_path ^ "/xha/ha_set_excluded"
-let fence_path = Xapi_globs.base_path ^ "/libexec/fence"
-(* Unused: let ha_clear_excluded = Xapi_globs.base_path ^ "/xha/ha_clear_excluded" *)
+let ha_set_pool_state = Filename.concat Fhs.xhadir "ha_set_pool_state"
+let ha_start_daemon = Filename.concat Fhs.xhadir "ha_start_daemon"
+let ha_stop_daemon = Filename.concat Fhs.xhadir "ha_stop_daemon"
+let ha_query_liveset = Filename.concat Fhs.xhadir "ha_query_liveset"
+let ha_propose_master = Filename.concat Fhs.xhadir "ha_propose_master"
+let ha_disarm_fencing = Filename.concat Fhs.xhadir "ha_disarm_fencing"
+let ha_set_excluded = Filename.concat Fhs.xhadir "ha_set_excluded"
+let fence_path = Filename.concat Fhs.libexecdir "fence"
+(* Unused: let ha_clear_excluded = Filename.concat Fhs.xhadir "ha_clear_excluded" *)
(** The xHA scripts throw these exceptions: *)
exception Xha_error of Xha_errno.code
View
6 ocaml/xapi/xapi_host.ml
@@ -24,8 +24,8 @@ open Workload_balancing
module D = Debug.Debugger(struct let name="xapi" end)
open D
-let host_bugreport_upload = Xapi_globs.base_path ^ "/libexec/host-bugreport-upload"
-let set_hostname = Xapi_globs.base_path ^ "/libexec/set-hostname"
+let host_bugreport_upload = Filename.concat Fhs.libexecdir "host-bugreport-upload"
+let set_hostname = Filename.concat Fhs.libexecdir "set-hostname"
let set_emergency_mode_error code params = Xapi_globs.emergency_mode_error := Api_errors.Server_error(code, params)
@@ -711,7 +711,7 @@ let syslog_config_write host host_only enable_remote =
else "") ^
(if enable_remote then "SYSLOGD_OPTIONS=\"-r $SYSLOGD_OPTIONS\"\n" else "")
in
- let fd = Unix.openfile "/etc/xensource/syslog.conf"
+ let fd = Unix.openfile (Filename.concat Fhs.etcdir "syslog.conf")
[ Unix.O_WRONLY; Unix.O_CREAT; Unix.O_TRUNC; ]
0o640 in
ignore (Unix.write fd buf 0 (String.length buf));
View
4 ocaml/xapi/xapi_host_backup.ml
@@ -23,8 +23,8 @@ open Helpers
module D = Debug.Debugger(struct let name="xapi" end)
open D
-let host_backup = Xapi_globs.base_path ^ "/libexec/host-backup"
-let host_restore = Xapi_globs.base_path ^ "/libexec/host-restore"
+let host_backup = Filename.concat Fhs.libexecdir "host-backup"
+let host_restore = Filename.concat Fhs.libexecdir "host-restore"
let host_backup_handler_core ~__context s =
match
View
2  ocaml/xapi/xapi_logs_download.ml
@@ -18,7 +18,7 @@ open Forkhelpers
module D = Debug.Debugger(struct let name="xapi" end)
open D
-let logs_download = Xapi_globs.base_path ^ "/libexec/logs-download"
+let logs_download = Filename.concat Fhs.libexecdir "logs-download"
let logs_download_handler (req: Request.t) s _ =
debug "running logs-download handler";
View
8 ocaml/xapi/xapi_message.ml
@@ -19,13 +19,13 @@
(** Message store *)
(* We use a filesystem based 'database':
- * Base directory: /var/xapi/blobs/messages
+ * Base directory: @VARDIR@/blobs/messages
* All messages go in there, filename=timestamp
*
* Symlinks are created to the messages for fast indexing:
- * /var/xapi/blobs/messages/VM/<uuid>/<timestamp> -> message
- * /var/xapi/blobs/messages/uuid/<message uuid> -> message
- * /var/xapi/blobs/messages/ref/<message ref> -> message
+ * @VARDIR@/blobs/messages/VM/<uuid>/<timestamp> -> message
+ * @VARDIR@/blobs/messages/uuid/<message uuid> -> message
+ * @VARDIR@/blobs/messages/ref/<message ref> -> message
*)
open Listext
View
2  ocaml/xapi/xapi_mgmt_iface.ml
@@ -24,7 +24,7 @@ open D
let management_interface_server = ref None
let management_m = Mutex.create ()
-let rewrite_management_interface_script = Xapi_globs.base_path ^ "/libexec/rewrite-management-interface"
+let rewrite_management_interface_script = Filename.concat Fhs.libexecdir "rewrite-management-interface"
let rewrite_management_interface interface =
(* XXX: probably should decompose this into Xapi_inventory.update <k> <v> and
View
2  ocaml/xapi/xapi_pci.ml
@@ -30,7 +30,7 @@ type pci = {
type pci_class = Display_controller | Network_controller
-let prog = Xapi_globs.base_path ^ "/libexec/pci-info"
+let prog = Filename.concat Fhs.libexecdir "pci-info"
let find_class_id = function
| Display_controller -> "03"
View
6 ocaml/xapi/xapi_pool_patch.ml
@@ -273,10 +273,10 @@ let sync () =
| Success(output, _) -> ()
let patch_header_length = 8
-let skip_signature_flag = "/etc/xensource/skipsignature"
+let skip_signature_flag = Filename.concat Fhs.etcdir "skipsignature"
-let update_upload_pre_script = Xapi_globs.base_path ^ "/libexec/update-upload-pre"
-let update_upload_post_script = Xapi_globs.base_path ^ "/libexec/update-upload-post"
+let update_upload_pre_script = Filename.concat Fhs.libexecdir "update-upload-pre"
+let update_upload_post_script = Filename.concat Fhs.libexecdir "update-upload-post"
let skip_signature_test () = Sys.file_exists skip_signature_flag
View
2  ocaml/xapi/xapi_services.ml
@@ -89,7 +89,7 @@ let get_handler (req: Http.Request.t) s _ =
debug "uri = %s" req.Http.Request.uri;
match String.split '/' req.Http.Request.uri with
| [ ""; services; "xenops" ] when services = _services ->
- hand_over_connection req s "/var/xapi/xenopsd.forwarded"
+ hand_over_connection req s (Filename.concat Fhs.vardir "xenopsd.forwarded")
| [ ""; services; "SM"; driver ] when services = _services ->
begin
try
View
2  ocaml/xapi/xapi_support.ml
@@ -31,7 +31,7 @@ let do_upload label file url options =
match with_logfile_fd label
(fun log_fd ->
- let upload_wrapper = Xapi_globs.base_path ^ "/libexec/upload-wrapper" in
+ let upload_wrapper = Filename.concat Fhs.libexecdir "upload-wrapper" in
let pid = safe_close_and_exec None (Some log_fd) (Some log_fd) [] upload_wrapper [file; url; proxy] in
waitpid_fail_if_bad_exit pid) with
| Success _ -> debug "Upload succeeded"
View
2  ocaml/xapi/xapi_sync.ml
@@ -38,7 +38,7 @@ let sync_host ~__context host =
let output,log = Forkhelpers.execute_command_get_output
~env:(Unix.environment ())
"/usr/bin/rsync"
- ["--delete";"--stats";"-az";localpath;remotepath;"-e"; Xapi_globs.base_path ^ "/bin/xsh"] in
+ ["--delete";"--stats";"-az";localpath;remotepath;"-e"; Filename.concat Fhs.bindir "xsh"] in
debug "sync output: \n%s" output;
debug "log output: '%s'" log;
View
2  ocaml/xapi/xapi_templates_install.ml
@@ -25,7 +25,7 @@ module D = Debug.Debugger(struct let name="xapi" end)
open D
let allowed_dom0_directory_for_provision_scripts =
- Xapi_globs.base_path ^ "/packages/post-install-scripts/"
+ Filename.concat Fhs.sharedir "packages/post-install-scripts/"
let is_whitelisted script =
let safe_char = function 'a'..'z'-> true |'-'->true |'/'->true |_ -> false in
View
8 ocaml/xapi/xapi_udhcpd.ml
@@ -25,9 +25,9 @@ open Threadext
let ip_begin_key = "ip_begin"
let ip_end_key = "ip_end"
-let udhcpd_conf = "/var/xapi/udhcpd.conf"
-let udhcpd_skel = "/var/xapi/udhcpd.skel"
-let leases_db = "/var/xapi/dhcp-leases.db"
+let udhcpd_conf = Filename.concat Fhs.vardir "udhcpd.conf"
+let udhcpd_skel = Filename.concat Fhs.etcdir "udhcpd.skel"
+let leases_db = Filename.concat Fhs.vardir "dhcp-leases.db"
let pidfile = "/var/run/udhcpd.pid"
module Ip = struct
@@ -123,7 +123,7 @@ let write_config_nolock ~__context ip_router =
Unixext.unlink_safe udhcpd_conf;
Unixext.write_string_to_file udhcpd_conf (Udhcpd_conf.to_string config)
-let command = Xapi_globs.base_path ^ "/libexec/udhcpd"
+let command = Filename.concat Fhs.libexecdir "udhcpd"
let restart_nolock () =
let pid = try Unixext.pidfile_read pidfile with _ -> None in
View
2  ocaml/xapi/xapi_vif.ml
@@ -102,5 +102,5 @@ let move ~__context ~network vif =
with_xs (fun xs -> xs.Xs.write xs_bridge_path vif_device.Vm_config.bridge);
let domid = string_of_int vif_device.Vm_config.domid in
let devid = string_of_int vif_device.Vm_config.devid in
- ignore(Helpers.call_script "/etc/xensource/scripts/vif" ["move"; "vif"; domid; devid])
+ ignore(Helpers.call_script (Filename.concat Fhs.scriptsdir "vif") ["move"; "vif"; domid; devid])
View
2  ocaml/xapi/xha_interface.ml
@@ -78,7 +78,7 @@ let hash_table_of_leaf_xml_element_list list =
module DaemonConfiguration = struct
(* Taken from Marathon's spec section 4.1.4.4 *)
- let filename = "/etc/xensource/xhad.conf"
+ let filename = Filename.concat Fhs.etcdir "xhad.conf"
module Host = struct
View
4 ocaml/xe-cli/OMakefile
@@ -1,5 +1,5 @@
-OCAML_LIBS = ../idl/ocaml_backend/common ../idl/ocaml_backend/client
-OCAMLINCLUDES = ../idl/ocaml_backend ../xapi
+OCAML_LIBS = ../fhs ../idl/ocaml_backend/common ../idl/ocaml_backend/client
+OCAMLINCLUDES = ../idl/ocaml_backend ../xapi ..
OCAMLPACKS = xml-light2 stdext stunnel log
section
View
2  ocaml/xe-cli/cli.ml
@@ -74,7 +74,7 @@ let nonpersistent_rpc xml =
let local_rpc xml =
let open Xmlrpcclient in
let http = xmlrpc ~version:"1.0" "/" in
- XML_protocol.rpc ~transport:(Unix "/var/xapi/xapi") ~http xml
+ XML_protocol.rpc ~transport:(Unix (Filename.concat Fhs.vardir "xapi")) ~http xml
(* Read command, determine username, password, host and port, and then
invoke cmd *)
View
2  ocaml/xe-cli/newcli.ml
@@ -241,7 +241,7 @@ let open_tcp server =
let open_channels () =
if is_localhost !xapiserver then (
try
- Unix.open_connection (Unix.ADDR_UNIX "/var/xapi/xapi")
+ Unix.open_connection (Unix.ADDR_UNIX (Filename.concat Fhs.vardir "xapi"))
with _ ->
open_tcp !xapiserver
) else
View
4 ocaml/xenops/OMakefile
@@ -1,5 +1,5 @@
-OCAMLINCLUDES = ../xapi ../util
-OCAML_LIBS = ../util/stats
+OCAMLINCLUDES = ../xapi ../util ..
+OCAML_LIBS = ../util/stats ../fhs
OCAML_CLIBS += $(XEN_OCAML_CLIBS)
# XXX: these should all be specified in the ocamlfind META file:
XENLIGHT_LINK_FLAGS= -cclib -lxlutil -cclib -luuid -cclib -lblktapctl -cclib -lutil -cclib -lxenlight -cclib -lxenstore
View
6 ocaml/xenops/device.ml
@@ -644,7 +644,7 @@ let add ~xs ~devid ~netty ~mac ~carrier ?mtu ?(rate=None) ?(protocol=Protocol_Na
"frontend-id", sprintf "%u" domid;
"online", "1";
"state", string_of_int (Xenbus_utils.int_of Xenbus_utils.Initialising);
- "script", "/etc/xensource/scripts/vif";
+ "script", (Filename.concat Fhs.scriptsdir "vif");
"mac", mac;
"handle", string_of_int devid
] @ back_options in
@@ -722,7 +722,7 @@ end
module PV_Vnc = struct
-let vncterm_wrapper = Xapi_globs.base_path ^ "/libexec/vncterm-wrapper"
+let vncterm_wrapper = Filename.concat Fhs.libexecdir "vncterm-wrapper"
let vnc_pid_path domid = sprintf "/local/domain/%d/vncterm-pid" domid
@@ -1054,7 +1054,7 @@ let write_string_to_file file s =
let do_flr device =
debug "Doing FLR on pci device: %s" device;
let doflr = "/sys/bus/pci/drivers/pciback/do_flr" in
- let script = Xapi_globs.base_path ^ "/libexec/pci-flr" in
+ let script = Filename.concat Fhs.libexecdir "pci-flr" in
let callscript =
let f s devstr =
try ignore (Forkhelpers.execute_command_get_output script [ s; devstr; ])
View
2  ocaml/xenops/xenguestHelper.ml
@@ -16,7 +16,7 @@ module D = Debug.Debugger(struct let name = "xenguesthelper" end)
open D
(** Installed path of the xenguest helper *)
-let path = Xapi_globs.base_path ^ "/libexec/xenguest"
+let path = Filename.concat Fhs.libexecdir "xenguest"
(** Where to place the last xenguesthelper debug log (just in case) *)
let last_log_file = "/tmp/xenguesthelper-log"
View
2  ocaml/xenops/xenops.ml
@@ -337,7 +337,7 @@ let list_pci ~xc ~xs ~domid =
) pcidevs
let add_dm ~xs ~domid ~static_max_kib ~vcpus ~boot =
- let dmpath = Xapi_globs.base_path ^ "/libexec/qemu-dm-wrapper" in
+ let dmpath = Filename.concat Fhs.libexecdir "qemu-dm-wrapper" in
let info = {
Device.Dm.memory = static_max_kib;
Device.Dm.boot = boot;
View
2  ocaml/xenops/xenvm.readme
@@ -89,7 +89,7 @@ architecture, and out-of-date-ness.
And you need to replace your udev rules by the one available in
scripts/xen-backend.rules and scripts/xen-frontend.rules and add the
scripts/tap scripts/block scripts/block-front scripts/vif into
-/etc/xensource/scripts/
+@SCRIPTSDIR@/
Also note that since xen-unstable doesn't have the dm-ready patch,
hvm domain takes unfortunately a substantial time (around 20s.) to start.
View
4 ocaml/xiu/OMakefile
@@ -1,6 +1,6 @@
OCAMLPACKS = stdext xenstore netdev log
-OCAML_LIBS += ../util/version ../idl/ocaml_backend/common ../xenops/xenops
-OCAMLINCLUDES += ../xapi ../xenops
+OCAML_LIBS += ../util/version ../fhs ../idl/ocaml_backend/common ../xenops/xenops
+OCAMLINCLUDES += ../xapi ../xenops ..
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -std=gnu99
CFLAGS += -mno-tls-direct-seg-refs
View
6 ocaml/xiu/xiu.ml
@@ -221,7 +221,7 @@ module Udev = struct
| _, _ -> eprintf "(XIU) unknown error running udev script\n"
let vif domid devid device action =
- let vif_script = "/etc/xensource/scripts/vif" in
+ let vif_script = Filename.concat Fhs.scriptsdir "vif" in
let env =
[ "DEVPATH", sprintf "/devices/xen-backend/vif-%d-%d" domid devid;
"PHYSDEVBUS", "xen-backend";
@@ -229,7 +229,7 @@ module Udev = struct
"XENBUS_BASE_PATH", "backend";
"XENBUS_PATH", sprintf "backend/vif/%d/%d" domid devid;
"XENBUS_TYPE", "vif";
- "PATH", Xapi_globs.base_path ^ "/bin:/usr/local/bin:/bin:/usr/bin"; (* added <base_path>/bin for xenstore wrapper *)
+ "PATH", Fhs.bindir ^ ":/usr/local/bin:/bin:/usr/bin"; (* added @BINDIR@ for xenstore wrapper *)
"XIU", !xiu_path; (* make sure we pick up the fake list_domains *)
"vif", device
] in
@@ -858,7 +858,7 @@ let main xiu_path =
()
let _ =
- let config_file = ref "/etc/xensource/xiu.conf" in
+ let config_file = ref (Filename.concat Fhs.etcdir "xiu.conf") in
let other_args = ref [] in
Arg.parse [ "-v", Arg.Unit (fun () -> incr debug_level), "increase debug level";
"--conf", Arg.Set_string config_file, "set config file"; ]
View
4 scripts/InterfaceReconfigure.py
@@ -375,7 +375,7 @@ def db_init_from_xenapi(session):
class DatabaseCache(object):
def __read_xensource_inventory(self):
- filename = root_prefix() + "/etc/xensource-inventory"
+ filename = root_prefix() + "@INVENTORY@"
f = open(filename, "r")
lines = [x.strip("\n") for x in f.readlines()]
f.close()
@@ -948,7 +948,7 @@ def DatapathFactory():
# XXX Need a datapath object for bridgeless PIFs
try:
- network_conf = open(root_prefix() + "/etc/xensource/network.conf", 'r')
+ network_conf = open(root_prefix() + "@ETCDIR@/network.conf", 'r')
network_backend = network_conf.readline().strip()
network_conf.close()
except Exception, e:
View
30 scripts/OMakefile
@@ -2,7 +2,7 @@
.PHONY: install
install:
- mkdir -p $(DESTDIR)$(OPTDIR)/bin
+ mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(VARPATCHDIR)
mkdir -p $(DESTDIR)$(VARPATCHDIR)/applied
mkdir -p $(DESTDIR)$(VARDIR)
@@ -24,8 +24,8 @@ install:
$(IPROG) mail-alarm $(DESTDIR)$(LIBEXECDIR)
$(IPROG) audit-logrotate $(DESTDIR)/etc/logrotate.d/audit
$(IPROG) xapi-logrotate $(DESTDIR)/etc/logrotate.d/xapi
- $(IPROG) xapi-wait-init-complete $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) xapi-autostart-vms $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) xapi-wait-init-complete $(DESTDIR)$(BINDIR)
+ $(IPROG) xapi-autostart-vms $(DESTDIR)$(BINDIR)
$(IPROG) udhcpd.skel $(DESTDIR)/var/xapi/udhcpd.skel #### FHS_FIXME
$(IPROG) xapi.conf $(DESTDIR)$(XAPICONF)
$(IPROG) log.conf $(DESTDIR)$(ETCDIR)/log.conf
@@ -52,17 +52,17 @@ install:
$(IPROG) xen-backend.rules $(DESTDIR)/etc/udev ### FHS_FIXME
$(IPROG) xen-frontend.rules $(DESTDIR)/etc/udev ### FHS_FIXME
$(IPROG) generate_ssl_cert $(DESTDIR)$(LIBEXECDIR)
- $(IPROG) fix_firewall.sh $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) fix_firewall.sh $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(OPTDIR)/debug
$(IPROG) debug_ha_query_liveset $(DESTDIR)$(OPTDIR)/debug
- $(IPROG) xe-scsi-dev-map $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) xe-mount-iso-sr $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) xe-reset-networking $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) xe-set-iscsi-iqn $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) xe-toolstack-restart $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) xe-xentrace $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) xe-edit-bootloader $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) static-vdis $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) xe-scsi-dev-map $(DESTDIR)$(BINDIR)
+ $(IPROG) xe-mount-iso-sr $(DESTDIR)$(BINDIR)
+ $(IPROG) xe-reset-networking $(DESTDIR)$(BINDIR)
+ $(IPROG) xe-set-iscsi-iqn $(DESTDIR)$(BINDIR)
+ $(IPROG) xe-toolstack-restart $(DESTDIR)$(BINDIR)
+ $(IPROG) xe-xentrace $(DESTDIR)$(BINDIR)
+ $(IPROG) xe-edit-bootloader $(DESTDIR)$(BINDIR)
+ $(IPROG) static-vdis $(DESTDIR)$(BINDIR)
$(IPROG) with-vdi $(DESTDIR)$(OPTDIR)/debug
mkdir -p $(DESTDIR)/etc/udev/rules.d ### FHS_FIXME
sh -c \
@@ -87,8 +87,8 @@ install:
$(IPROG) set-hostname $(DESTDIR)$(LIBEXECDIR)
$(IPROG) update-mh-info $(DESTDIR)$(LIBEXECDIR)
$(IPROG) host-bugreport-upload $(DESTDIR)$(LIBEXECDIR)/host-bugreport-upload
- $(IPROG) xe-backup-metadata $(DESTDIR)$(OPTDIR)/bin
- $(IPROG) xe-restore-metadata $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) xe-backup-metadata $(DESTDIR)$(BINDIR)
+ $(IPROG) xe-restore-metadata $(DESTDIR)$(BINDIR)
$(IPROG) link-vms-by-sr.py $(DESTDIR)$(LIBEXECDIR)
$(IPROG) print-custom-templates $(DESTDIR)$(LIBEXECDIR)
$(IPROG) backup-sr-metadata.py $(DESTDIR)$(LIBEXECDIR)
@@ -99,7 +99,7 @@ install:
$(IPROG) init.d-perfmon $(DESTDIR)/etc/rc.d/init.d/perfmon
mkdir -p $(DESTDIR)/etc/sysconfig
$(IPROG) sysconfig-perfmon $(DESTDIR)/etc/sysconfig/perfmon
- $(IPROG) perfmon $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) perfmon $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(PLUGINDIR)
$(IPROG) plugins/perfmon $(DESTDIR)$(PLUGINDIR)
$(IPROG) plugins/extauth-hook $(DESTDIR)$(PLUGINDIR)
View
6 scripts/backup-metadata-cron
@@ -1,8 +1,8 @@
#!/bin/bash
-if [ -e /etc/xensource/pool.conf ]; then
- if [ "$(cat /etc/xensource/pool.conf)" = "master" ]; then
- "@OPTDIR@/bin/xe-backup-metadata" -c >/dev/null 2>&1
+if [ -e @ETCDIR@/pool.conf ]; then
+ if [ "$(cat @ETCDIR@/pool.conf)" = "master" ]; then
+ "@BINDIR@/xe-backup-metadata" -c >/dev/null 2>&1
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t backup-metadata "ALERT exited abnormally with [$EXITVALUE]"
View
4 scripts/bugtool-plugin/xapi/stuff.xml
@@ -1,4 +1,4 @@
<collect>
-<command label="sm_diagnostics">/opt/xensource/libexec/sm_diagnostics</command>
-<command label="thread_diagnostics">/opt/xensource/libexec/thread_diagnostics</command>
+<command label="sm_diagnostics">@LIBEXECDIR@/sm_diagnostics</command>
+<command label="thread_diagnostics">@LIBEXECDIR@/thread_diagnostics</command>
</collect>
View
2  scripts/db.conf.skel
@@ -1,4 +1,4 @@
-[/var/xapi/state.db]
+[@VARDIR@/state.db]
mode:no_limit
format:xml
available_this_boot:true
View
4 scripts/examples/bash-cli/install-debian
@@ -30,8 +30,8 @@ fi
# Source the inventory file, which tells us amongst other thing the name of
# the management interface
-if [ -e /etc/xensource-inventory ]; then
- . /etc/xensource-inventory
+if [ -e @INVENTORY@ ]; then
+ . @INVENTORY@
fi
if [ -z "${MANAGEMENT_INTERFACE}" ]; then
echo No MANAGEMENT_INTERFACE environment varible set: assuming xenbr0
View
4 scripts/examples/bash-cli/install-debian.html
@@ -41,8 +41,8 @@
<I><FONT COLOR="#B22222"># Source the inventory file, which tells us amongst other thing the name of
</FONT></I><I><FONT COLOR="#B22222"># the management interface
-</FONT></I><B><FONT COLOR="#A020F0">if</FONT></B> [ -e /etc/xensource-inventory ]; <B><FONT COLOR="#A020F0">then</FONT></B>
- . /etc/xensource-inventory
+</FONT></I><B><FONT COLOR="#A020F0">if</FONT></B> [ -e @INVENTORY@ ]; <B><FONT COLOR="#A020F0">then</FONT></B>
+ . @INVENTORY@
<B><FONT COLOR="#A020F0">fi</FONT></B>
<B><FONT COLOR="#A020F0">if</FONT></B> [ -z <B><FONT COLOR="#BC8F8F">&quot;${MANAGEMENT_INTERFACE}&quot;</FONT></B> ]; <B><FONT COLOR="#A020F0">then</FONT></B>
<B><FONT COLOR="#DA70D6">echo</FONT></B> No MANAGEMENT_INTERFACE environment varible <B><FONT COLOR="#DA70D6">set</FONT></B>: assuming xenbr0
View
2  scripts/examples/python/inventory.py
@@ -1,6 +1,6 @@
# Simple functions to read the constants from the xensource-inventory file
-INVENTORY="/etc/xensource-inventory"
+INVENTORY="@INVENTORY@"
INSTALLATION_UUID="INSTALLATION_UUID"
def read_kvpairs(filename):
View
2  scripts/examples/python/monitor-unwanted-domains.py
@@ -9,7 +9,7 @@
# Return a list of (domid, uuid) tuples, one per paused domain on this host
def list_paused_domains():
results = []
- all = subprocess.Popen(["@OPTDIR@/bin/list_domains"], stdout=subprocess.PIPE).communicate()[0]
+ all = subprocess.Popen(["@BINDIR@/list_domains"], stdout=subprocess.PIPE).communicate()[0]
lines = all.split("\n")
for domain in lines[1:]:
bits = domain.split()
View
2  scripts/fake-pv-drivers.sh
@@ -25,7 +25,7 @@ if [ $? -ne 0 ]; then
fi
# use the PRODUCT_VERSION from here:
-. /etc/xensource-inventory
+. @INVENTORY@
major=$(echo ${PRODUCT_VERSION} | cut -f 1 -d .)
minor=$(echo ${PRODUCT_VERSION} | cut -f 2 -d .)
View
2  scripts/fence
@@ -3,4 +3,4 @@
# Do not use the ocaml XIU stuff for this -- we want the real
# hypervisor to fence this domain.
unset XIU
-@OPTDIR@/libexec/fence.bin $*
+@LIBEXECDIR@/fence.bin $*
View
2  scripts/host-backup-restore/host-restore
@@ -7,7 +7,7 @@ set -e
set -x
# Restore a backup to the other partition
-. /etc/xensource-inventory
+. @INVENTORY@
DEVICE=$BACKUP_PARTITION
if [ -z "$DEVICE" ]
View
2  scripts/host-bugreport-upload
@@ -19,7 +19,7 @@ BASE_URL=$(echo ${INPUT_URL} | sed -ne 's,\(^[^:]*://[^/]*\)\(/\([^/]*/\)*\)*[^/
if [ -z "$FILENAME" ]; then
# Build the remote filename
now=$(date --utc +"%Y:%m:%dT%H:%M:%SZ")
- . /etc/xensource-inventory
+ . @INVENTORY@
FILENAME=${INSTALLATION_UUID}-${now}
fi
[ ! -z "${BASE_URL}" ] || BASE_URL="${DEFAULT_BASE_URL}"
View
4 scripts/init.d-genptoken
@@ -8,9 +8,9 @@
. /etc/init.d/functions
start() {
- if [ ! -f /etc/xensource/ptoken ]; then
+ if [ ! -f @ETCDIR@/ptoken ]; then
echo -n $"Creating pool secret (this may take some time)"
- "@OPTDIR@/libexec/genptoken" -f -o /etc/xensource/ptoken
+ "@LIBEXECDIR@/genptoken" -f -o @ETCDIR@/ptoken
[ $? -eq 0 ] && success $"Done" || failure
echo
fi
View
4 scripts/init.d-management-interface
@@ -7,8 +7,8 @@
. /etc/init.d/functions
-export XENSOURCE_INVENTORY=/etc/xensource-inventory
-export INTERFACE_RECONFIGURE="@OPTDIR@/libexec/interface-reconfigure"
+export XENSOURCE_INVENTORY=@INVENTORY@
+export INTERFACE_RECONFIGURE="@LIBEXECDIR@/interface-reconfigure"
[ -r ${XENSOURCE_INVENTORY} ] || exit 0
. ${XENSOURCE_INVENTORY}
View
4 scripts/init.d-perfmon
@@ -5,13 +5,13 @@
# chkconfig: 2345 95 05
# description: Performance monitoring/alarm generation daemon
# processname: perfmon
-# config: /etc/xensource/perfmon.conf
+# config: @ETCDIR@/perfmon.conf
# pidfile: /var/run/perfmon.pid
# Source function library.
. /etc/init.d/functions
-PERFMON="@OPTDIR@/bin/perfmon"
+PERFMON="@BINDIR@/perfmon"
PERFMON_FLAGS=
if [ -f /etc/sysconfig/perfmon ]; then
View
8 scripts/init.d-sdkinit
@@ -11,12 +11,12 @@
case "$1" in
start)
# This is a run-once script!
- if [ -e /etc/xensource-inventory ]; then
+ if [ -e @INVENTORY@ ]; then
exit 0
fi
echo -n "Starting sdkinit: "
- cat /proc/cpuinfo > /etc/xensource/boot_time_cpu
- touch /etc/xensource/boot_time_info_updated
+ cat /proc/cpuinfo > @ETCDIR@/boot_time_cpu
+ touch @ETCDIR@/boot_time_info_updated
if [ -d /proc/xen ]; then
# Set the domain0 uuid to the real uuid of this SDK VM
@@ -31,7 +31,7 @@ case "$1" in
HOSTUUID=`uuidgen`
INSTALLDATE=`date "+%Y-%m-%d %H:%M:%S.000000"`
- (cat /etc/xensource-inventory.skel; cat << EOF) > /etc/xensource-inventory
+ (cat @INVENTORY@.skel; cat << EOF) > @INVENTORY@
KERNEL_VERSION='2.6.18-92.1.6.el5.xs4.1.920.367.638xen'
XEN_VERSION='3.2.1'
INSTALLATION_DATE='${INSTALLDATE}'
View
2  scripts/init.d-squeezed
@@ -13,7 +13,7 @@
# Memory ballooning daemon
# location of the executable:
-SQUEEZED="@OPTDIR@/libexec/squeezed"
+SQUEEZED="@LIBEXECDIR@/squeezed"
# pidfile:
PID_FILE="/var/run/squeezed.pid"
View
2  scripts/init.d-v6d
@@ -13,7 +13,7 @@
# v6 licensing daemon
# location of the executable:
-V6D="@OPTDIR@/libexec/v6d"
+V6D="@LIBEXECDIR@/v6d"
# pidfile:
PID_FILE="/var/run/v6d.pid"
View
8 scripts/init.d-xapi
@@ -22,8 +22,8 @@ fi
XAPI_STARTUP_COOKIE=/var/run/xapi_startup.cookie
XAPI_INIT_COMPLETE_COOKIE=/var/run/xapi_init_complete.cookie
-XAPI_BLOCK_STARTUP_COOKIE=/etc/xensource/xapi_block_startup
-XAPI_BOOT_TIME_INFO_UPDATED=/etc/xensource/boot_time_info_updated
+XAPI_BLOCK_STARTUP_COOKIE=@ETCDIR@/xapi_block_startup
+XAPI_BOOT_TIME_INFO_UPDATED=@ETCDIR@/boot_time_info_updated
# Enable core dumping for xapi
ulimit -c unlimited
@@ -68,12 +68,12 @@ start() {
if [ -e ${XAPI_BOOT_TIME_INFO_UPDATED} ]; then
# clear out qemu coredumps/chroot dirs on system boot:
rm -rf /var/xen/qemu/*
- "@OPTDIR@/bin/xapi" -daemon ${xapiflags} \
+ "@BINDIR@/xapi" -daemon ${xapiflags} \
-writereadyfile ${XAPI_STARTUP_COOKIE} -writeinitcomplete ${XAPI_INIT_COMPLETE_COOKIE} -onsystemboot
RETVAL=$?
rm -f ${XAPI_BOOT_TIME_INFO_UPDATED}
else
- "@OPTDIR@/bin/xapi" -daemon ${xapiflags} \
+ "@BINDIR@/xapi" -daemon ${xapiflags} \
-writereadyfile ${XAPI_STARTUP_COOKIE} -writeinitcomplete ${XAPI_INIT_COMPLETE_COOKIE}
RETVAL=$?
fi
View
8 scripts/init.d-xapi-domains
@@ -6,16 +6,16 @@
# chkconfig: 345 99 00
# description: Start/stop XE VMs
-SHUTDOWN="@OPTDIR@/libexec/shutdown"
+SHUTDOWN="@LIBEXECDIR@/shutdown"
if [ ! -e /proc/xen/privcmd ] || \
- [ ! -e /etc/xensource-inventory ] || \
+ [ ! -e @INVENTORY@ ] || \
[ ! -e ${SHUTDOWN} ] ; then
exit 0
fi
. /etc/init.d/functions
-. /etc/xensource-inventory
+. @INVENTORY@
if [ "x${INSTALLATION_UUID}" = "x" ] ; then
exit 1
@@ -27,7 +27,7 @@ case "$1" in
touch /var/lock/subsys/xapi-domains
# Fork background thread to wait for xapi to complete initialisation
# and then try and start vms with auto_poweron=true in other-config
- /opt/xensource/bin/xapi-autostart-vms &
+ @BINDIR@/xapi-autostart-vms &
;;
stop)
action $"Shutting down Virtual Machines: " \
View
12 scripts/init.d-xapissl
@@ -13,15 +13,15 @@
# chkconfig: 2345 91 01
# description: XenAPI server SSL proxy
# processname: stunnel
-# config: /etc/xensource/stunnel.conf
+# config: @ETCDIR@/stunnel.conf
# pidfile: /var/run/xapissl.pid
# Source function library.
. /lib/lsb/init-functions
-PEMFILE="/etc/xensource/xapi-ssl.pem"
+PEMFILE="@ETCDIR@/xapi-ssl.pem"
SSLPIDFILE="/var/run/xapissl.pid"
-SSLCONFFILE="/etc/xensource/xapi-ssl.conf"
+SSLCONFFILE="@ETCDIR@/xapi-ssl.conf"
XAPISSL_LOCK="/var/lock/xapissl"
# If stunnel4 exists, use it. Otherwise use stunnel.
@@ -29,7 +29,7 @@ XAPISSL_LOCK="/var/lock/xapissl"
[ -z ${STUNNEL} ] && STUNNEL=$(which stunnel)
mgmt_ip() {
- . /etc/xensource-inventory
+ . @INVENTORY@
if [ -n "${MANAGEMENT_INTERFACE}" ] &&
[ "${MANAGEMENT_INTERFACE}" != "lo" ];
then
@@ -58,7 +58,7 @@ cert = ${PEMFILE}
ciphers = !SSLv2:RSA+AES256-SHA:RSA+AES128-SHA:RSA+RC4-SHA:RSA+RC4-MD5:RSA+DES-CBC3-SHA
EOF
- . /etc/xensource-inventory
+ . @INVENTORY@
# Only if the management interface is set ask stunnel to bind to it
if [ -n "${MANAGEMENT_INTERFACE}" ] &&
[ "${MANAGEMENT_INTERFACE}" != "lo" ];