CMakeLists.txt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ################################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2016 HPCC Systems®.
  3. #
  4. # All rights reserved. This program is free software: you can redistribute it
  5. # and/or modify
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and # limitations under the License.
  15. ################################################################################
  16. ## Generate and setup instance service files
  17. set(componentList
  18. hpcc-conf
  19. thor-conf
  20. dafilesrv
  21. eclagent
  22. dali
  23. dfuserver
  24. eclccserver
  25. eclscheduler
  26. esp
  27. roxie
  28. sasha
  29. thor
  30. thorslave
  31. backupnode
  32. toposerver)
  33. set(dafilesrv "dafilesrv" "--logDir=${LOG_PATH} --name=%i --daemon" "")
  34. set(dali "daserver" "--daemon %i" "dafilesrv.service")
  35. set(dfuserver "dfuserver" "--daemon %i" "dafilesrv.service")
  36. set(eclagent "agentexec" "--daemon %i" "dafilesrv.service")
  37. set(eclccserver "eclccserver" "--daemon %i" "dafilesrv.service")
  38. set(eclscheduler "eclscheduler" "--daemon %i" "dafilesrv.service")
  39. set(esp "esp" "--daemon %i" "dafilesrv.service")
  40. set(roxie "roxie" "--topology=RoxieTopology.xml --logfile --restarts=2 --stdlog=0 --daemon %i" "dafilesrv.service")
  41. set(sasha "saserver" "--daemon %i" "dafilesrv.service")
  42. set(thor "thormaster_lcr" "--daemon %i MASTER=\${THORMASTER}:\${THORMASTERPORT}" "dafilesrv.service")
  43. set(thorslave "thorslave_lcr" "--daemon %i --master=\${THORMASTER}:\${THORMASTERPORT} --slave=.:\${SLAVEPORT} --slavenum=\${SLAVENUM} --logDir=${LOG_PATH}/\${THORNAME}" "dafilesrv.service")
  44. set(backupnode "backup.sh" "" "")
  45. set(toposerver "toposerver" "--daemon %i" "dafilesrv.service")
  46. foreach(component ${componentList})
  47. list(GET "${component}" 0 processName)
  48. list(GET "${component}" 1 processArgs)
  49. list(GET "${component}" 2 dependencies)
  50. if("${component}" STREQUAL "thor" OR "${component}" STREQUAL "thorslave" OR "${component}" STREQUAL "hpcc-conf" OR "${component}" STREQUAL "thor-conf" OR "${component}" STREQUAL "backupnode" OR "${component}" STREQUAL "sparkthor")
  51. configure_file(${component}@instance.service.in ${component}@.service @ONLY)
  52. else()
  53. configure_file(component@instance.service.in ${component}@.service @ONLY)
  54. endif()
  55. configure_file(service-unit.install.in ${component}-service.install @ONLY)
  56. configure_file(service-unit.uninstall.in ${component}-service.uninstall @ONLY)
  57. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${component}-service.install DESTINATION etc/init.d/install COMPONENT Systemd)
  58. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${component}-service.uninstall DESTINATION etc/init.d/uninstall COMPONENT Systemd)
  59. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${component}@.service DESTINATION etc/systemd/system COMPONENT Systemd)
  60. endforeach()
  61. ## Generate and setup standalone service files
  62. set(standaloneList
  63. dropzone
  64. configmgr
  65. configmgr-conf)
  66. foreach(component ${standaloneList})
  67. configure_file(${component}.service.in ${component}.service @ONLY)
  68. configure_file(standalone-service-unit.install.in ${component}-standalone-service.install @ONLY)
  69. configure_file(standalone-service-unit.uninstall.in ${component}-standalone-service.uninstall @ONLY)
  70. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${component}.service DESTINATION etc/systemd/system COMPONENT Systemd)
  71. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${component}-standalone-service.install DESTINATION etc/init.d/install COMPONENT Systemd)
  72. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${component}-standalone-service.uninstall DESTINATION etc/init.d/uninstall COMPONENT Systemd)
  73. endforeach()
  74. configure_file(hpcc-environment-monitor.service.in hpcc-environment-monitor.service @ONLY)
  75. configure_file(hpcc-environment-monitor.path.in hpcc-environment-monitor.path @ONLY)
  76. configure_file(hpcc-environment-monitor.install.in hpcc-environment-monitor.install @ONLY)
  77. configure_file(hpcc-environment-monitor.uninstall.in hpcc-environment-monitor.uninstall @ONLY)
  78. configure_file(generate-hpccsystems-target.install.in generate-hpccsystems-target.install @ONLY)
  79. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hpcc-environment-monitor.service ${CMAKE_CURRENT_BINARY_DIR}/hpcc-environment-monitor.path
  80. DESTINATION etc/systemd/system
  81. COMPONENT Systemd)
  82. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hpcc-environment-monitor.install ${CMAKE_CURRENT_BINARY_DIR}/generate-hpccsystems-target.install DESTINATION etc/init.d/install COMPONENT Systemd)
  83. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hpcc-environment-monitor.uninstall DESTINATION etc/init.d/uninstall COMPONENT Systemd)
  84. ## Install helper scripts for thorslaves
  85. configure_file(thorslaves-launch.sh.in thorslaves-launch.sh @ONLY)
  86. configure_file(thorslaves-exec.sh.in thorslaves-exec.sh @ONLY)
  87. configure_file(generate-hpccsystems-target.in generate-hpccsystems-target.sh @ONLY)
  88. install(PROGRAMS
  89. ${CMAKE_CURRENT_BINARY_DIR}/thorslaves-launch.sh
  90. ${CMAKE_CURRENT_BINARY_DIR}/thorslaves-exec.sh
  91. ${CMAKE_CURRENT_BINARY_DIR}/generate-hpccsystems-target.sh
  92. DESTINATION ${ADMIN_PATH} COMPONENT Systemd)