diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02255cbec78cb79ac7089901a60b0afc31440e19..a260711ca1e02a2aedf2acfc3d86e0c8efe00c6e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,6 +51,7 @@ gcc-debug: - compiled/bin/ - compiled/etc/ - compiled/lib/ + - compiled/share/ - build/examples/ - build/tests/ - build/src/scord/scord diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt index bcdd908716ee66832c2e5978784a835e4b4fee98..3b472785bde18815a4292cc8139e85653f6c5aef 100644 --- a/etc/CMakeLists.txt +++ b/etc/CMakeLists.txt @@ -22,8 +22,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ################################################################################ -add_subdirectory(deploy_scripts) - configure_file(scord.conf.in scord.conf) configure_file(scord-ctl.conf.in scord-ctl.conf @ONLY) diff --git a/etc/scord-ctl.conf.in b/etc/scord-ctl.conf.in index 63bb5fda163a17b05b8a14453fc5a59fae2b12b9..c0c12f7cb21355f6ce2e98040ab9271f9e0abc54 100644 --- a/etc/scord-ctl.conf.in +++ b/etc/scord-ctl.conf.in @@ -14,7 +14,7 @@ config: environment: VAR0: value0 VAR1: value1 - # The command that scord-ctl will use to start an adhoc instance of + # The command that `scord-ctl` will use to start an adhoc instance of # this type. The following variables are supported that will be # automatically replaced by scord-ctl if found between curly braces: # * ADHOC_NODES: A comma separated list of valid job hostnames that @@ -24,7 +24,7 @@ config: # `working_directory` and automatically removed after the adhoc # instance has been shut down. # * ADHOC_ID: - A unique ID for the adhoc instance. - command: @CMAKE_INSTALL_FULL_SYSCONFDIR@/@PROJECT_NAME@/gekkofs.sh + command: @CMAKE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/adhoc_services.d/gekkofs.sh start --hosts {ADHOC_NODES} --workdir {ADHOC_DIRECTORY} @@ -32,7 +32,7 @@ config: --mountdir {ADHOC_DIRECTORY}/mnt shutdown: environment: - command: @CMAKE_INSTALL_FULL_SYSCONFDIR@/@PROJECT_NAME@/gekkofs.sh + command: @CMAKE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/adhoc_services.d/gekkofs.sh stop --workdir {ADHOC_DIRECTORY} diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 8f3bc11fe0357eb0f4ee12777d171f1b218ad016..247be4964089426ba011d77dc335f0eb76524de5 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -22,4 +22,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ################################################################################ +add_subdirectory(adhoc_services.d) add_subdirectory(slurm) diff --git a/etc/deploy_scripts/CMakeLists.txt b/plugins/adhoc_services.d/CMakeLists.txt similarity index 88% rename from etc/deploy_scripts/CMakeLists.txt rename to plugins/adhoc_services.d/CMakeLists.txt index a8ee9583431628b2df3de5080532fc66ea3da140..915a03b706e597277d5e7ad9f3c454845d302853 100644 --- a/etc/deploy_scripts/CMakeLists.txt +++ b/plugins/adhoc_services.d/CMakeLists.txt @@ -24,10 +24,13 @@ list(APPEND ADHOC_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/gekkofs.sh") -# install adhoc scripts to `/scord` (normally /etc/scord) +# install adhoc scripts to `/scord/adhoc_services.d/` +# (normally /usr/share/scord/adhoc_services.d/) +get_filename_component(INSTALL_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} NAME) + install( FILES ${ADHOC_SCRIPTS} - DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${PROJECT_NAME} + DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/${INSTALL_DESTINATION} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ diff --git a/etc/deploy_scripts/gekkofs.sh b/plugins/adhoc_services.d/gekkofs.sh similarity index 100% rename from etc/deploy_scripts/gekkofs.sh rename to plugins/adhoc_services.d/gekkofs.sh diff --git a/plugins/slurm/CMakeLists.txt b/plugins/slurm/CMakeLists.txt index 5c7b05b7a4a0b365e4eeba5ffa35b4db2d64fb60..88b5b6c8017bb44453e36b36fc4d96e71fae8b4b 100644 --- a/plugins/slurm/CMakeLists.txt +++ b/plugins/slurm/CMakeLists.txt @@ -63,11 +63,13 @@ configure_file(scord_common.sh.in scord_common.sh @ONLY) configure_file(scord_prolog.sh.in scord_prolog.sh @ONLY) configure_file(scord_epilog.sh.in scord_epilog.sh @ONLY) +get_filename_component(INSTALL_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} NAME) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/scord_common.sh ${CMAKE_CURRENT_BINARY_DIR}/scord_prolog.sh ${CMAKE_CURRENT_BINARY_DIR}/scord_epilog.sh - DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/slurm + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/${INSTALL_DESTINATION} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ diff --git a/scripts/runner.sh b/scripts/runner.sh index 82c766d1002b1f02cf803e6becd32156f9416582..1efbde293d7a169879eed8309ba4444c21596665 100755 --- a/scripts/runner.sh +++ b/scripts/runner.sh @@ -45,7 +45,8 @@ function run() { fi fi - "$@" 2>/dev/null 1>/dev/null 0runner.$$.err 1>runner.$$.out 0"$pidfile" sleep 1 @@ -54,6 +55,11 @@ function run() { echo "Process $pid does not seem to exist." >&2 echo "The program below may not exist or may have crashed while starting:" >&2 echo " $*" >&2 + echo " STDOUT: " >&2 + cat "runner.$$.out" >&2 + echo " STDERR: " >&2 + cat "runner.$$.err" >&2 + rm runner.$$.out runner.$$.err exit 1 fi @@ -80,6 +86,7 @@ function stop() { if pkill "-$signal" --pidfile "$pidfile"; then rm "$pidfile" + rm runner.$$.out runner.$$.err exit 0 fi exit 1