diff options
| author | pjotrp | 2026-03-22 16:15:15 +0100 |
|---|---|---|
| committer | pjotrp | 2026-03-22 16:15:15 +0100 |
| commit | 62391730651b78e7793ea4e675b0c1ae8977a631 (patch) | |
| tree | c415f7bda486b8ee230cff602be9deafb730afaf | |
| parent | 5eb399a553d64a26731e5bd1a2d864951adc55b7 (diff) | |
| download | guix-bioinformatics-62391730651b78e7793ea4e675b0c1ae8977a631.tar.gz | |
Drop unused GN and lizardfs packages
| -rw-r--r-- | gn/packages/file-systems.scm | 157 | ||||
| -rw-r--r-- | gn/packages/genenetwork.scm | 71 | ||||
| -rw-r--r-- | gn/packages/patches/lizardfs-issues-found-on-Fedora-34-using-GCC-11.patch | 111 | ||||
| -rw-r--r-- | gn/services/file-systems.scm | 653 |
4 files changed, 0 insertions, 992 deletions
diff --git a/gn/packages/file-systems.scm b/gn/packages/file-systems.scm index f9e107d..9c5cd04 100644 --- a/gn/packages/file-systems.scm +++ b/gn/packages/file-systems.scm @@ -1,21 +1,11 @@ (define-module (gn packages file-systems) #:use-module ((guix licenses) #:prefix license:) - #:use-module (gnu packages) #:use-module (guix packages) #:use-module (guix git-download) - #:use-module (guix utils) - #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) - #:use-module (gnu packages admin) #:use-module (gnu packages autotools) - #:use-module (gnu packages base) - #:use-module (gnu packages boost) - #:use-module (gnu packages check) #:use-module (gnu packages compression) - #:use-module (gnu packages dbm) - #:use-module (gnu packages documentation) #:use-module (gnu packages linux) - #:use-module (gnu packages logging) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python)) @@ -45,150 +35,3 @@ "MooseFS is a Petabyte Open Source Network Distributed File System. It is easy to deploy and maintain, highly reliable, fault tolerant, highly performing, easily scalable and POSIX compliant.") (license (list license:asl2.0 ; external/crcutil license:gpl2+)))) - -(define-public lizardfs - (package - (name "lizardfs") - (version "3.12.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/lizardfs/lizardfs") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0zk73wmx82ari3m2mv0zx04x1ggsdmwcwn7k6bkl5c0jnxffc4ax")) -)) - (build-system cmake-build-system) - (arguments - `(#:configure-flags - (list "-DENABLE_CLIENT_LIB=YES" - "-DENABLE_TESTS=YES" - "-DENABLE_STATIC=NO" - "-DENABLE_VERBOSE_ASCIIDOC=YES" - "-DENABLE_TCMALLOC=NO" - ;"-DLIB_SUBDIR=lib" ; no 64 suffix - ;; Some directories need to be changed - ;"-DRUN_SUBDIR=/var/run/lizardfs" - ;"-DDATA_SUBDIR=/var/lib/lizardfs" - ;"-DETC_SUBDIR=/etc/lizardfs" - "-DENABLE_UTILS=YES") - ;; Tests involve setting up a lizardfs instance and run as root. - ;; We will make do with just building the tests. - #:tests? #f - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'configure-through-cmakelists.txt - (lambda _ - ;; For some reason some configure flags don't work. - (substitute* "CMakeLists.txt" - (("\"64\"") "\"\"") - (("var/run/mfs") "/var/run/lizardfs") - (("var/lib/mfs") "/var/lib/lizardfs") - (("etc/mfs") "/etc/lizardfs")) - ;; Then adjust the install instructions. - (substitute* "src/data/CMakeLists.txt" - (("^install.*") "")))) - (add-after 'unpack 'use-system-libraries - (lambda* (#:key inputs #:allow-other-keys) - (let ((gtest (assoc-ref inputs "googletest")) - (spdlog (assoc-ref inputs "spdlog"))) - ;; Don't attempt to download any sources. - (substitute* "cmake/Libraries.cmake" - (("ENABLE_TESTS") "DOWNLOAD_GTEST") - (("# Find GoogleTest" all) - (string-append "set(GTEST_NAME gtest)\n" all)) - (("GTEST_INCLUDE_DIRS.*") - (string-append "GTEST_INCLUDE_DIRS " gtest "/include)\n")) - (("download_external\\(SPDLOG" all) - (string-append "if(DOWNLOAD_SPDLOG)\n" all)) - (("\"spdlog-1\")") - (string-append "\"spdlog-1\")\n" - "endif()\n" - "find_package(spdlog CONFIG REQUIRED)")) - (("include_directories(external/spdlog-0.14.0/include)") "")) - - ;; Configure the location of the googletest sources. - (copy-recursively gtest "external/googletest") - (substitute* "external/CMakeLists.txt" - (("add_subdirectory.*") "add_subdirectory(googletest)\n")) - - ;; Compatability with spdlog1.2.0+ - ;; https://github.com/lizardfs/lizardfs/issues/774 - (substitute* "src/common/slogger.h" - (("spdlog/spdlog.h\"") - (string-append "spdlog/spdlog.h\"\n" - "#include \"spdlog/sinks/rotating_file_sink.h\"\n" - "#include \"spdlog/sinks/syslog_sink.h\"\n" - "#include \"spdlog/sinks/stdout_color_sinks.h\""))) - (substitute* "src/common/slogger.cc" - (("spdlog::syslog_logger\\(\"syslog\"\\);") - "spdlog::syslog_logger_mt(\"syslog\");")) - - ;; fix FTBFS with glibc-2.28; for makedev - ;; https://github.com/lizardfs/lizardfs/issues/655 - (substitute* "src/chunkserver/iostat.h" - (("sys/stat.h>") "sys/stat.h>\n#include <sys/sysmacros.h>"))))) - (add-after 'install 'install-extras - ;; This got broken by changing the directories above. - (lambda* (#:key outputs #:allow-other-keys) - (with-directory-excursion "../source" - (let* ((out (assoc-ref outputs "out")) - (etc (string-append out "/etc")) - (var (string-append out "/var/lib/lizardfs")) - (data "src/data")) - (mkdir-p (string-append etc "/bash_completion.d")) - (mkdir-p var) - (copy-file (string-append data "/lizardfs.completion") - (string-append etc "/bash_completion.d/lizardfs")) - (copy-file (string-append data "/metadata.mfs") - (string-append var "/metadata.mfs.empty")) - (for-each - (lambda (file) - (copy-file file - (string-append etc "/" (basename file) ".dist"))) - (find-files data "\\.cfg(\\.in)?$"))))))))) - (inputs - (list bdb - boost - fuse-2 - linux-pam - python-2 - spdlog - zlib)) - (native-inputs - `(("asciidoc" ,asciidoc) - ("googletest" ,(package-source googletest-1.7)) - ("pkg-config" ,pkg-config))) - (home-page "https://lizardfs.com/") - (synopsis "Distributed, scalable, fault-tolerant, highly available file system") - (description - "LizardFS makes files secure by keeping all the data in many replicas -spread over all available servers. It can be used also to build affordable -storage because it runs without any problems on commodity hardware. Disk and -server failures are handled transparently and most of all without any downtime -or loss of data. If storage requirements grow, it's possible to scale an -existing LizardFS installation just by adding new servers at any time, without -any downtime. The system will automatically move data across to the newly -added servers, as it continuously takes care of balancing disk usage across all -connected nodes.") - (license (list license:asl2.0 ; external/crcutil - license:gpl3)))) - -(define-public googletest-1.7 - ;; Source only package - (hidden-package - (package - (inherit googletest) - (version "1.7.0") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/google/googletest") - (commit (string-append "release-" version)))) - (file-name (git-file-name "googletest" version)) - (sha256 - (base32 - "1yqnzrr7bgnnnwq02c5gy559mmb52pap7m1h7zd6w58dj9yvg72n"))))))) diff --git a/gn/packages/genenetwork.scm b/gn/packages/genenetwork.scm index ff2e1d4..b1f83c7 100644 --- a/gn/packages/genenetwork.scm +++ b/gn/packages/genenetwork.scm @@ -618,77 +618,6 @@ storage.") GeneNetwork projects.") (license license:agpl3+)))) -;; ./pre-inst-env guix download http://files.genenetwork.org/raw_database/db_webqtl_s.zip -;; 0sscjh0wml2lx0mb43vf4chg9gpbfi7abpjxb34n3kyny9ll557x - -(define-public genenetwork2-files-small - (let ((pfff "xx")) - (package - (name "genenetwork2-files-small") - (version "1.0") - (source - (origin - (method url-fetch) - (uri "http://files.genenetwork.org/data_files/gn2_data_s-20160303-C9E672ECED1F51B915DE419B5B2C524E.tar.lz4") - (file-name (string-append name "-" pfff)) - (sha256 - (base32 "058ymx3af6abdhdxyxj0i9qfvb6v7j091frjpp6jh4ahks7r23lj")))) - (build-system trivial-build-system) - (native-inputs `(("lz4" ,lz4) - ("tar" ,tar) - ("source" ,source))) - - (arguments - `(#:modules ((guix build utils)) - #:builder - (let* ((out (assoc-ref %outputs "out")) - (name "gn2_data_s") - (tarfn (string-append name ".tar")) - (targetdir (string-append out "/share/genenetwork2/"))) - (begin - (use-modules (guix build utils)) - (let ((source (assoc-ref %build-inputs "source")) - (lz4unpack (string-append (assoc-ref %build-inputs "lz4") "/bin/lz4")) - (tar (string-append (assoc-ref %build-inputs "tar") "/bin/tar"))) - (and - (zero? (system* lz4unpack source "-d" tarfn)) - (zero? (system* tar "xf" tarfn)) - (mkdir-p targetdir) - (copy-recursively name targetdir))))))) - (home-page "http://genenetwork.org/") - (synopsis "Small file archive to run on genenetwork") - (description "Genenetwork genotype and mapping files.") - (license license:agpl3+)))) - -(define-public genenetwork2-database-small - (let ((md5 "93e745e9c")) - (package - (name "genenetwork2-database-small") - (version "1.0") - (source - (origin - (method url-fetch) - (uri "http://files.genenetwork.org/raw_database/db_webqtl_s.zip") - (file-name (string-append name "-" md5)) - (sha256 - (base32 "0sscjh0wml2lx0mb43vf4chg9gpbfi7abpjxb34n3kyny9ll557x")))) - (build-system trivial-build-system) - (native-inputs `(("unzip" ,unzip) - ("source" ,source))) - - (arguments - `(#:modules ((guix build utils)) - #:builder (begin - (use-modules (guix build utils)) - (let ((source (assoc-ref %build-inputs "source")) - (unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip"))) - (and (mkdir "db") - (zero? (system* unzip source "-d" "db")) - (chdir "db")))))) - (home-page "http://genenetwork.org/") - (synopsis "Small database to run on genenetwork") - (description "Genenetwork installation + database.") - (license license:agpl3+)))) diff --git a/gn/packages/patches/lizardfs-issues-found-on-Fedora-34-using-GCC-11.patch b/gn/packages/patches/lizardfs-issues-found-on-Fedora-34-using-GCC-11.patch deleted file mode 100644 index 55036a7..0000000 --- a/gn/packages/patches/lizardfs-issues-found-on-Fedora-34-using-GCC-11.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 1da538a07974b8b1afd2580af2828418cbdad42b Mon Sep 17 00:00:00 2001 -Message-ID: <1da538a07974b8b1afd2580af2828418cbdad42b.1699426938.git.efraim@flashner.co.il> -From: Marcin Konarski <marcin.konarski@lizardfs.com> -Date: Fri, 21 May 2021 12:36:56 +0200 -Subject: [PATCH] all: Fix build issues found on Fedora 34 using GCC 11.1.1 - -Change-Id: I1c20e914d249d367d0a058de1102ae62dcaf6054 ---- - src/common/ec_read_plan.h | 2 +- - src/common/flat_set_unittest.cc | 4 ++-- - src/common/vector_range.h | 1 + - src/data/CMakeLists.txt | 25 +++++++++++++++++++++++ - src/master/goal_config_loader_unittest.cc | 4 ++-- - 5 files changed, 31 insertions(+), 5 deletions(-) - -diff --git a/src/common/ec_read_plan.h b/src/common/ec_read_plan.h -index c96413cb..bda10cb5 100644 ---- a/src/common/ec_read_plan.h -+++ b/src/common/ec_read_plan.h -@@ -132,7 +132,7 @@ protected: - } - } - -- for (const auto op : read_operations) { -+ for (auto const& op : read_operations) { - data_parts[op.first.getSlicePart()] = buffer + op.second.buffer_offset; - } - -diff --git a/src/common/flat_set_unittest.cc b/src/common/flat_set_unittest.cc -index 9ad760c4..e50308eb 100644 ---- a/src/common/flat_set_unittest.cc -+++ b/src/common/flat_set_unittest.cc -@@ -62,9 +62,9 @@ TEST(FlatSet, RedundantInsert) { - // const & - std::initializer_list<std::string> elems2 = {"0", "1", "2", "3", "4"}; - flat_set<std::string> cs2(elems2); -- for (const std::string &i : {"2", "4"}) { -+ for (char const* s : {"2", "4"}) { - EXPECT_EQ(cs2.size(), elems2.size()); -- cs2.insert(i); -+ cs2.insert(s); - EXPECT_EQ(cs2.size(), elems2.size()); - } - } -diff --git a/src/common/vector_range.h b/src/common/vector_range.h -index f336e1ec..57bba8dd 100644 ---- a/src/common/vector_range.h -+++ b/src/common/vector_range.h -@@ -22,6 +22,7 @@ - - #include <algorithm> - #include <cassert> -+#include <limits> - #include <stdexcept> - - /*! \brief Class providing std::vector like interface to subrange of vector. */ -diff --git a/src/data/CMakeLists.txt b/src/data/CMakeLists.txt -index 88c20d5d..bf69a5e2 100644 ---- a/src/data/CMakeLists.txt -+++ b/src/data/CMakeLists.txt -@@ -16,3 +16,28 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mfschunkserver.cfg DESTINATION ${ETC_S - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mfsmetalogger.cfg DESTINATION ${ETC_SUBDIR} RENAME mfsmetalogger.cfg.dist) - - install(FILES lizardfs.completion DESTINATION etc/bash_completion.d RENAME lizardfs) -+ -+if(BUILD_TESTS) -+ # Create a mock include dir. -+ # We do this because we want to preserve the proper include directives in the example code -+ # and still build this example program in the build step before the needed headers are installed. -+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/lizardfs) -+ add_custom_command( -+ OUTPUT -+ ${CMAKE_CURRENT_BINARY_DIR}/include/lizardfs/lizardfs_c_api.h -+ ${CMAKE_CURRENT_BINARY_DIR}/include/lizardfs/lizardfs_error_codes.h -+ COMMAND ${CMAKE_COMMAND} -E create_symlink -+ ${CMAKE_SOURCE_DIR}/src/mount/client/lizardfs_c_api.h -+ ${CMAKE_CURRENT_BINARY_DIR}/include/lizardfs/lizardfs_c_api.h -+ COMMAND ${CMAKE_COMMAND} -E create_symlink -+ ${CMAKE_SOURCE_DIR}/src/common/lizardfs_error_codes.h -+ ${CMAKE_CURRENT_BINARY_DIR}/include/lizardfs/lizardfs_error_codes.h -+ ) -+ add_executable(c-client-example -+ liblizardfs-client-example.c -+ ${CMAKE_CURRENT_BINARY_DIR}/include/lizardfs/lizardfs_c_api.h -+ ${CMAKE_CURRENT_BINARY_DIR}/include/lizardfs/lizardfs_error_codes.h) -+ target_include_directories(c-client-example PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include) -+ target_link_libraries(c-client-example lizardfs-client stdc++) -+ install(TARGETS c-client-example RUNTIME DESTINATION ${BIN_SUBDIR}) -+endif() -diff --git a/src/master/goal_config_loader_unittest.cc b/src/master/goal_config_loader_unittest.cc -index 050e8a52..a236dba9 100644 ---- a/src/master/goal_config_loader_unittest.cc -+++ b/src/master/goal_config_loader_unittest.cc -@@ -41,8 +41,8 @@ Goal::Slice createSlice(int type, - std::vector<std::map<std::string, int>> part_list) { - Goal::Slice slice{Goal::Slice::Type(type)}; - int part_index = 0; -- for (const auto &part : part_list) { -- for (const auto label : part) { -+ for (auto const& part : part_list) { -+ for (auto const& label : part) { - slice[part_index][MediaLabel(label.first)] += label.second; - } - ++part_index; - -base-commit: 6f6fd530f8fa286fbfb6a050cacbba73e928bd26 --- -Efraim Flashner <efraim@flashner.co.il> רנשלפ םירפא -GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 -Confidentiality cannot be guaranteed on emails sent or received unencrypted - diff --git a/gn/services/file-systems.scm b/gn/services/file-systems.scm deleted file mode 100644 index 386f2ac..0000000 --- a/gn/services/file-systems.scm +++ /dev/null @@ -1,653 +0,0 @@ -(define-module (gn services file-systems) - #:use-module (guix gexp) - #:use-module (guix records) - #:use-module (gnu services) - #:use-module (gnu services shepherd) - #:use-module (gnu system accounts) - #:use-module (gnu system shadow) - #:use-module (gnu packages admin) - #:use-module (gnu packages linux) - #:use-module (gn packages file-systems) - #:use-module (ice-9 match) - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-9) - - #:export (lizardfs-configuration - lizardfs-configuration? - lizardfs-service-type - - lizardfs-mfschunkserver-config-file - lizardfs-mfschunkserver-config-file? - lizardfs-mfshdd-config-file - lizardfs-mfshdd-config-file? - lizardfs-mfsmaster-config-file - lizardfs-mfsmaster-config-file? - lizardfs-mfsmetalogger-config-file - lizardfs-mfsmetalogger-config-file?)) - - -(define %lizardfs-accounts - (list (user-group - (name "lizardfs") - (system? #t)) - (user-account - (name "lizardfs") - (group "lizardfs") - (system? #t) - (comment "Lizardfs User") - (home-directory "/var/lib/lizardfs") - (shell (file-append shadow "/sbin/nologin"))))) - -(define-record-type* <lizardfs-mfsmetalogger-config-file> - lizardfs-mfsmetalogger-config-file - make-lizardfs-mfsmetalogger-config-file - lizardfs-mfsmetalogger-config-file? - (working-user lizardfs-mfsmetalogger-config-file-working-user - (default "lizardfs")) - (working-group lizardfs-mfsmetalogger-config-file-working-group - (default "lizardfs")) - (syslog-identifier lizardfs-mfsmetalogger-config-file-syslog-identifier - (default "mfsmetalogger")) - (lock-memory lizardfs-mfsmetalogger-config-file-lock-memory - (default #f)) ; 0 or 1 - (nice-level lizardfs-mfsmetalogger-config-file-nice-level - (default -19)) - (data-path lizardfs-mfsmetalogger-config-file-data-path - (default "/var/lib/lizardfs")) - (back-logs lizardfs-mfsmetalogger-config-file-back-logs - (default 50)) - (back-meta-keep-previous lizardfs-mfsmetalogger-config-file-back-meta-keep-previous - (default 3)) - (meta-download-frequency lizardfs-mfsmetalogger-config-file-meta-download-frequency - (default 24)) - (master-reconnection-delay lizardfs-mfsmetalogger-config-file-master-reconnection-delay - (default 5)) - (master-host lizardfs-mfsmetalogger-config-file-master-host - (default "mfsmaster")) - (master-port lizardfs-mfsmetalogger-config-file-master-port - (default 9419)) - (master-timeout lizardfs-mfsmetalogger-config-file-master-timeout - (default 60))) - -(define-gexp-compiler (lizardfs-mfsmetalogger-config-file-compiler - (file <lizardfs-mfsmetalogger-config-file>) system target) - (match file - (($ <lizardfs-mfsmetalogger-config-file> working-user working-group syslog-identifier lock-memory nice-level data-path back-logs back-meta-keep-previous meta-download-frequency master-reconnection-delay master-host master-port master-timeout) - (gexp->derivation - "mfsmetalogger.cfg" - #~(call-with-output-file #$output - (lambda (port) - (display - (string-append - "# This file generated by GNU Guix\n\n" - (ungexp-splicing - `(,@`("WORKING_USER = " ,working-user "\n") - ,@`("WORKING_GROUP = " ,working-group "\n") - ,@`("SYSLOG_IDENT = " ,syslog-identifier "\n") - ,@(if lock-memory - `("LOCK_MEMORY = 1\n") - `("LOCK_MEMORY = 0\n")) - ,@`("NICE_LEVEL = " ,(number->string nice-level) "\n") - ,@`("DATA_PATH = " ,data-path "\n") - ,@`("BACK_LOGS = " ,(number->string back-logs) "\n") - ,@`("BACK_META_KEEP_PREVIOUS = " ,(number->string back-meta-keep-previous) "\n") - ,@`("META_DOWNLOAD_FREQ = " ,(number->string meta-download-frequency) "\n") - ,@`("MASTER_RECONNECTION_DELAY = " ,(number->string master-reconnection-delay) "\n") - ,@`("MASTER_HOST = " ,master-host "\n") - ,@`("MASTER_PORT = " ,(number->string master-port) "\n") - ,@`("MASTER_TIMEOUT = " ,(number->string master-timeout) "\n")))) - port))) - #:local-build? #t)))) - -(define-record-type* <lizardfs-mfschunkserver-config-file> - lizardfs-mfschunkserver-config-file - make-lizardfs-mfschunkserver-config-file - lizardfs-mfschunkserver-config-file? - (label lizardfs-mfschunkserver-label - (default "_")) - (working-user lizardfs-mfschunkserver-config-file-working-user - (default "lizardfs")) - (working-group lizardfs-mfschunkserver-config-file-working-group - (default "lizardfs")) - (syslog-identifier lizardfs-mfschunkserver-config-file-syslog-identifier - (default "mfschunkserver")) - (lock-memory lizardfs-mfschunkserver-config-file-lock-memory - (default #f)) ; 0 or 1 - (nice-level lizardfs-mfschunkserver-config-file-nice-level - (default -19)) - (data-path lizardfs-mfschunkserver-config-file-data-path - (default "/var/lib/lizardfs")) - (master-reconnection-delay lizardfs-mfschunkserver-config-file-master-reconnection-delay - (default 5)) - (bind-host lizardfs-mfschunkserver-bind-host - (default "*")) - (master-host lizardfs-mfschunkserver-config-file-master-host - (default "mfsmaster")) - (master-port lizardfs-mfschunkserver-config-file-master-port - (default 9420)) - (master-timeout lizardfs-mfschunkserver-config-file-master-timeout - (default 60)) - (csserv-listen-host lizardfs-mfschunkserver-config-csserv-listen-host - (default "*")) - (csserv-listen-port lizardfs-mfschunkserver-config-csserv-listen-port - (default 9422)) - (hdd-conf-filename lizardfs-mfschunkserver-config-hdd-conf-filename - (default "/etc/lizardfs/mfshdd.cfg")) ; This should be our generated one - (hdd-leave-space-default lizardfs-mfschunkserver-config-hdd-leave-space-default - (default "4GiB")) - (hdd-test-freq lizardfs-mfschunkserver-config-hdd-test-freq - (default 10)) - (hdd-advise-no-cache lizardfs-mfschunkserver-config-hdd-advise-no-cache - (default #t)) ; 0 or 1 - (hdd-punch-holes lizardfs-mfschunkserver-config-hdd-punch-holes - (default #t)) ; 0 or 1 - (enable-load-factor lizardfrs-mfschunkserver-config-enable-load-factor - (default #f)) ; 0 or 1 - (replication-bandwidth-limit-kbps - lizardfs-mfschunkserver-config-replication-bandwidth-limit-kbps - (default 8192)) - (nr-of-network-workers lizardfs-mfschunkserver-config-nr-of-network-workers - (default 1)) - (nr-of-hdd-workers-per-network-worker - lizardfs-mfschunkerver-config-nr-of-hdd-workers-per-network-pworker - (default 20)) - (read-ahead-kb lizardfs-mfschunkserver-config-read-ahead-kb - (default 0)) - (max-read-behind-kb lizardfs-mfschunkserver-config-max-read-behind-kb - (default 0)) - (create-new-chunks-in-moosefs-format - lizardfs-mfschunkserver-config-crate-new-chunks-in-moosefs-format - (default #t)) ; 0 or 1 - (perform-fsync lizardfs-mfschunkserver-config-perform-fsync - (default #t)) ; 0 or 1 - ) - -(define-gexp-compiler (lizardfs-mfschunkserver-config-file-compiler - (file <lizardfs-mfschunkserver-config-file>) system target) - (match file - (($ <lizardfs-mfschunkserver-config-file> label working-user working-group syslog-identifier lock-memory nice-level data-path master-reconnection-delay bind-host master-host master-port master-timeout csserv-listen-host csserv-listen-port hdd-conf-filename hdd-leave-space-default hdd-test-freq hdd-advise-no-cache hdd-punch-holes enable-load-factor replication-bandwidth-limit-kbps nr-of-network-workers nr-of-hdd-workers-per-network-worker read-ahead-kb max-read-behind-kb create-new-chunks-in-moosefs-format perform-fsync) - (gexp->derivation - "mfschunkserver.cfg" - #~(call-with-output-file #$output - (lambda (port) - (display - (string-append - "# This file generated by GNU Guix\n\n" - (ungexp-splicing - `(,@`("LABEL = " ,label "\n") - ,@`("WORKING_USER = " ,working-user "\n") - ,@`("WORKING_GROUP = " ,working-group "\n") - ,@`("SYSLOG_IDENT = " ,syslog-identifier "\n") - ,@(if lock-memory - `("LOCK_MEMORY = 1\n") - `("LOCK_MEMORY = 0\n")) - ,@`("NICE_LEVEL = " ,(number->string nice-level) "\n") - ,@`("DATA_PATH = " ,data-path "\n") - ,@`("MASTER_RECONNECTION_DELAY = " ,(number->string master-reconnection-delay) "\n") - ,@`("MASTER_HOST = " ,master-host "\n") - ,@`("MASTER_PORT = " ,(number->string master-port) "\n") - ,@`("MASTER_TIMEOUT = " ,(number->string master-timeout) "\n") - ,@`("CSSERV_LISTEN_HOST = " ,csserv-listen-host "\n") - ,@`("CSSERV_LISTEN_PORT = " ,(number->string csserv-listen-port) "\n") - ,@`("HDD_CONF_FILENAME = " ,hdd-conf-filename "\n") - ,@`("HDD_LEAVE_SPACE_DEFAULT = " ,hdd-leave-space-default "\n") - ,@`("HDD_TEST_FREQ = " ,(number->string hdd-test-freq) "\n") - ,@(if hdd-advise-no-cache - `("HDD_ADVISE_NO_CACHE = 1\n") - `("HDD_ADVISE_NO_CACHE = 0\n")) - ,@(if hdd-punch-holes - `("HDD_PUNCH_HOLES = 1\n") - `("HDD_PUNCH_HOLES = 0\n")) - ,@(if enable-load-factor - `("ENABLE_LOAD_FACTOR = 1\n") - `("ENABLE_LOAD_FACTOR = 0\n")) - ,@`("REPLICATION_BANDWIDTH_LIMIT_KBPS = " ,(number->string replication-bandwidth-limit-kbps) "\n") - ,@`("NR_OF_NETWORK_WORKERS = " ,(number->string nr-of-network-workers) "\n") - ,@`("NR_OF_HDD_WORKERS_PER_NETWORK_WORKER = " ,(number->string nr-of-hdd-workers-per-network-worker) "\n") - ,@`("READ_AHEAD_KB = " ,(number->string read-ahead-kb) "\n") - ,@`("MAX_READ_BEHIND_KB = " ,(number->string max-read-behind-kb) "\n") - ,@(if create-new-chunks-in-moosefs-format - `("CREATE_NEW_CHUNKS_IN_MOOSEFS_FORMAT = 1\n") - `("CREATE_NEW_CHUNKS_IN_MOOSEFS_FORMAT = 0\n")) - ,@(if perform-fsync - `("PERFORM_FSYNC = 1\n") - `("PERFORM_FSYNC = 0\n"))))) - port))) - #:local-build? #t)))) - -(define-record-type* <lizardfs-mfshdd-config-file> - lizardfs-mfshdd-config-file - make-lizardfs-mfshdd-config-file - lizardfs-mfshdd-config-file? - (disks-to-use lizardfs-mfshdd-config-file-disks-to-use - (default '())) - (disks-to-remove lizardfs-mfshdd-config-file-disks-to-remove - (default '()))) - -(define-gexp-compiler (lizardfs-mfshdd-config-file-compiler - (file <lizardfs-mfshdd-config-file>) system target) - (match file - (($ <lizardfs-mfshdd-config-file> disks-to-use disks-to-remove) - (gexp->derivation - "mfshdd.cfg" - #~(call-with-output-file #$output - (lambda (port) - (display - (string-append - "# This file generated by GNU Guix\n\n" - (ungexp-splicing - `(,@(append-map - (lambda (disk) - `(,disk "\n")) - disks-to-use) - ,@(append-map - (lambda (disk) - `("*" ,disk "\n")) - disks-to-remove)))) - port))) - #:local-build? #t)))) - -(define-record-type* <lizardfs-mfsmaster-config-file> - lizardfs-mfsmaster-config-file - make-lizardfs-mfsmaster-config-file - lizardfs-mfsmaster-config-file? - (personality lizardsf-mfsmaster-config-personality - (default "")) - (admin-password lizardfs-mfsmaster-config-admin-password - (default "")) - (working-user lizardfs-mfsmaster-config-working-user - (default "lizardfs")) - (working-group lizardfs-mfsmaster-config-working-group - (default "lizardfs")) - (syslog-ident lizardfs-mfsmaster-config-syslog-ident - (default "mfsmaster")) - (lock-memory lizardfs-mfsmaster-config-lock-memory - (default #f)) ; 0 or 1 - (nice-level lizardfs-mfsmaster-config-nice-level - (default -19)) - (exports-filename lizardfs-mfsmaster-config-exports-filename - (default "/etc/lizardfs/mfsexports.cfg")) ; our created one? - (topology-filename lizardfs-mfsmaster-config-topology-filename - (default "/etc/lizardfs/mfstopology.cfg")) ; our created one? - (custom-goals-filename lizardfs-mfsmaster-config-custom-goals-filename - (default "/etc/lizardfs/mfsgoals.cfg")) ; our created one? - (data-path lizardfs-mfsmaster-config-data-path - (default "/var/lib/lizardfs")) - (prefer-local-chunkserver lizardfs-mfsmaster-prefer-local-chunkserver - (default #t)) ; 0 or 1 - (auto-recovery lizardfs-mfsmaster-config-auto-recovery - (default #f)) ; 0 or 1 - (back-logs lizardfs-mfsmaster-config-back-logs - (default 50)) - (back-meta-keep-previous lizardfs-mfsmaster-config-back-meta-keep-previous - (default 1)) - (operations-delay-init lizardfs-mfsmaster-config-operations-delay-init - (default 300)) - (operations-delay-disconnect lizardfs-mfsmaster-config-operations-delay-disconnect - (default 3600)) - (matoml-listen-host lizardfs-mfsmaster-config-matoml-listen-host - (default "*")) - (matoml-listen-port lizardfs-mfsmaster-config-matoml-listen-port - (default 9419)) - (matoml-log-preserve-seconds lizardfs-mfsmaster-config-matoml-log-preserve-seconds - (default 600)) - (matocs-listen-host lizardfs-mfsmaster-config-matocs-listen-host - (default "*")) - (matocs-listen-port lizardfs-mfsmaster-config-matocs-listen-port - (default 9420)) - (matocl-listen-host lizardfs-mfsmaster-config-matocl-listen-host - (default "*")) - (matocl-listen-port lizardfs-mfsmaster-config-matocl-listen-port - (default 9421)) - (matots-listen-host lizardfs-mfsmaster-config-matots-listen-host - (default "*")) - (matots-listen-port lizardfs-mfsmaster-config-matots-listen-port - (default 9424)) - (chunks-loop-max-cps lizardfs-mfsmaster-config-chunks-loop-max-cps - (default 100000)) - (chunks-loop-min-time lizardfs-mfsmaster-config-chunks-loop-min-time - (default 300)) - (chunks-loop-peroid lizardfs-mfsmaster-config-chunks-loop-period - (default 1000)) - (chunks-loop-max-cpu lizardfs-mfsmaster-config-chunks-loop-max-cpu - (default 60)) - (chunks-soft-del-limit lizardfs-mfsmaster-config-chunks-soft-del-limit - (default 10)) - (chunks-hard-del-limit lizardfs-mfsmaster-config-chunks-hard-del-limit - (default 25)) - (chunks-write-rep-limit lizardfs-mfsmaster-config-chunks-write-rep-limit - (default 2)) - (chunks-read-rep-limit lizardfs-mfsmaster-config-chunks-read-rep-limit - (default 10)) - (endangered-chunks-priority lizardfs-mfsmaster-config-endangered-chunks-priority - (default 0)) - (endangered-chunks-max-capacity lizardfs-mfsmaster-config-endangered-chunks-max-capacity - (default "1Mi")) - (acceptable-difference lizardfs-mfsmaster-config-acceptable-difference - (default 0.1)) - (chunks-rebalancing-between-labels lizardfs-mfsmaster-config-chunks-rebalancing-between-labels - (default 0)) - (free-inodes-period lizardfs-mfsmaster-config-free-inodes-period - (default 60)) - (no-atime lizardfs-mfsmaster-config-no-atime - (default #f)) ; 0 or 1 - (session-sustain-time lizardfs-mfsmaster-config-session-sustain-time - (default 86400)) - (reject-old-client lizardfs-mfsmaster-config-reject-old-clients - (default #f)) ; 0 or 1 - (globaliolimits-filename lizardfs-mfsmaster-config-globaliolimits-filename - (default "/etc/lizardfs/globaliolimits.cfg")) ; our generated one? - (globaliolimits-renegotiation-period-settings - lizardfs-mfsmaster-config-globaliolmits-renegotiation-period-settings - (default 0.1)) - (globaliolimits-accumulate-ms lizardfs-mfsmaster-config-globaliolimits-accumulate-ms - (default 250)) - (mfsmetarestore-path lizardfs-mfsmaster-config-mfsmeaterestore-path - (default (file-append lizardfs "/sbin/mfsmetarestore"))) - (master-reconnection-delay lizardfs-mfsmaster-config-master-reconnection-delay - (default 5)) - (master-host lizardfs-mfsmaster-config-master-host - (default "mfsmaster")) - (master-port lizardfs-mfsmaster-config-master-port - (default 9419)) - (master-timeout lizardfs-mfsmaster-config-master-timeout - (default 60)) - (metadata-checksum-interval lizardfs-mfsmaster-config-metadata-checksum-interval - (default 50)) - (metadata-checksum-recalculation-speed lizardfs-mfsmaster-config-metadata-recalculation-speed - (default 100)) - (disable-metadata-checksum-verification lizardfs-mfsmaster-config-disable-metadata-checksum-verification - (default #f)) ; 0 or 1 - (metadata-save-request-min-period lizardfs-mfsmaster-config-metadata-save-request-min-period - (default 1800)) - (use-bdb-for-name-storage lizardfs-mfsmaster-config-use-bdb-for-name-storage - (default #t)) ; 0 or 1 - (bdb-name-storage-cache lizardfs-mfsmaster-config-bdb-name-storage-cache - (default 10)) - (avoid-same-ip-chunkservers lizardfs-mfsmaster-config-avoid-same-ip-chunkservers - (default #f)) ; 0 or 1 - (load-factor-penalty lizardfs-mfsmaster-config-load-factor-penalty - (default 0)) ; between 0, 0.5, inclusive - (redundancy-level lizardfs-mfsmaster-config-redundancy-level - (default 0)) - (snapshot-initial-batch-size-limit lizardfs-mfsmaster-config-snapshot-initial-batch-size-limit - (default 10000)) - (file-test-loop-min-time lizardfs-mfsmaster-config-file-test-loop-min-time - (default 3600))) - - -(define-gexp-compiler (lizardfs-mfsmaster-config-file-compiler - (file <lizardfs-mfsmaster-config-file>) system target) - (match file - (($ <lizardfs-mfsmaster-config-file> personality admin-password working-user working-group syslog-ident lock-memory nice-level exports-filename topology-filename custom-goals-filename data-path prefer-local-chunkserver auto-recovery back-logs back-meta-keep-previous operations-delay-init operations-delay-disconnect matoml-listen-host matoml-listen-port matoml-log-preserve-seconds matocs-listen-host matocs-listen-port matocl-listen-host matocl-listen-port matots-listen-host matots-listen-port chunks-loop-max-cps chunks-loop-min-time chunks-loop-period chunks-loop-max-cpu chunks-soft-del-limit chunks-hard-del-limit chunks-write-rep-limit chunks-read-rep-limit endangered-chunks-priority endangered-chunks-max-capacity acceptable-difference chunks-rebalancing-between-labels free-inodes-period no-atime session-sustain-time reject-old-client globaliolimits-filename globaliolimits-renegotiation-period-settings globaliolimits-accumulate-ms mfsmetarestore-path master-reconnection-delay master-host master-port master-timeout metadata-checksum-interval metadata-checksum-recalculation-speed disable-metadata-checksum-verification metadata-save-request-min-period use-bdb-for-name-storage bdb-name-storage-cache avoid-same-ip-chunkservers load-factor-penalty redundancy-level snapshot-initial-batch-size-limit file-test-loop-min-time) - (gexp->derivation - "mfsmaster.cfg" - #~(call-with-output-file #$output - (lambda (port) - (display - (string-append - "# This file generated by GNU Guix\n\n" - (ungexp-splicing - `(,@`("PERSONALITY = " ,personality "\n") - ,@`("ADMIN_PASSWORD = \"" ,admin-password "\"\n") - ,@`("WORKING_USER = " ,working-user "\n") - ,@`("WORKING_GROUP = " ,working-group "\n") - ,@`("SYSLOG_IDENT = " ,syslog-ident "\n") - ,@(if lock-memory - `("LOCK_MEMORY = 1\n") - `("LOCK_MEMORY = 0\n")) - ,@`("NICE_LEVEL = " ,(number->string nice-level) "\n") - ,@`("EXPORTS_FILENAME = " ,exports-filename "\n") - ,@`("TOPOLOGY_FILENAME = " ,topology-filename "\n") - ,@`("CUSTOM_GOALS_FILENAME = " ,custom-goals-filename "\n") - ,@`("DATA_PATH = " ,data-path "\n") - ,@(if prefer-local-chunkserver - `("PREFER_LOCAL_CHUNKSERVER = 1\n") - `("PREFER_LOCAL_CHUNKSERVER = 0\n")) - ,@(if auto-recovery - `("AUTO_RECOVERY = 1\n") - `("AUTO_RECOVERY = 0\n")) - ,@`("BACK_LOGS = " ,(number->string back-logs) "\n") - ,@`("BACK_META_KEEP_PREVIOUS = " ,(number->string back-meta-keep-previous) "\n") - ,@`("OPERATIONS_DELAY_INIT = " ,(number->string operations-delay-init) "\n") - ,@`("OPERATIONS_DELAY_DISCONNECT = " ,(number->string operations-delay-disconnect) "\n") - ,@`("MATOML_LISTEN_HOST = " ,matoml-listen-host "\n") - ,@`("MATOML_LISTEN_PORT = " ,(number->string matoml-listen-port) "\n") - ,@`("MATOML_LOG_PRESERVE_SECONDS = " ,(number->string matoml-log-preserve-seconds) "\n") - ,@`("MATOCS_LISTEN_HOST = " ,matocs-listen-host "\n") - ,@`("MATOCS_LISTEN_PORT = " ,(number->string matocs-listen-port) "\n") - ,@`("MATOCL_LISTEN_HOST = " ,matocl-listen-host "\n") - ,@`("MATOCL_LISTEN_PORT = " ,(number->string matocl-listen-port) "\n") - ,@`("MATOTS_LISTEN_HOST = " ,matots-listen-host "\n") - ,@`("MATOTS_LISTEN_PORT = " ,(number->string matots-listen-port) "\n") - ,@`("CHUNKS_LOOP_MAX_CPS = " ,(number->string chunks-loop-max-cps) "\n") - ,@`("CHUNKS_LOOP_MIN_TIME = " ,(number->string chunks-loop-min-time) "\n") - ,@`("CHUNKS_LOOP_PERIOD = " ,(number->string chunks-loop-period) "\n") - ,@`("CHUNKS_LOOP_MAX_CPU = " ,(number->string chunks-loop-max-cpu) "\n") - ,@`("CHUNKS_SOFT_DEL_LIMIT = " ,(number->string chunks-soft-del-limit) "\n") - ,@`("CHUNKS_HARD_DEL_LIMIT = " ,(number->string chunks-hard-del-limit) "\n") - ,@`("CHUNKS_WRITE_REP_LIMIT = " ,(number->string chunks-write-rep-limit) "\n") - ,@`("CHUNKS_READ_REP_LIMIT = " ,(number->string chunks-read-rep-limit) "\n") - ,@`("ENDANGERED_CHUNKS_PRIORITY = " ,(number->string endangered-chunks-priority) "\n") - ,@`("ENDANGERED_CHUNKS_MAX_CAPACITY = " ,endangered-chunks-max-capacity "\n") - ,@`("ACCEPTABLE_DIFFERENCE = " ,(number->string acceptable-difference) "\n") - ,@`("CHUNKS_REBALANCING_BETWEEN_LABELS = " ,(number->string chunks-rebalancing-between-labels) "\n") - ,@`("FREE_INODES_PERIOD = " ,(number->string free-inodes-period) "\n") - ,@(if no-atime - `("NO_ATIME = 1\n") - `("NO_ATIME = 0\n")) - ,@`("SESSION_SUSTAIN_TIME = " ,(number->string session-sustain-time) "\n") - ,@(if reject-old-client - `("REJECT_OLD_CLIENT = 1\n") - `("REJECT_OLD_CLIENT = 0\n")) - ,@`("GLOBALIOLIMITS_FILENAME = " ,globaliolimits-filename "\n") - ,@`("GLOBALIOLIMITS_RENEGOTIATION_PERIOD_SETTINGS = " ,(number->string globaliolimits-renegotiation-period-settings) "\n") - ,@`("GLOBALIOLIMITS_ACCUMULATE_MS = " ,(number->string globaliolimits-accumulate-ms) "\n") - ,@`("MFSMETARESTORE_PATH = " ,mfsmetarestore-path "\n") - ,@`("MASTER_RECONNECTION_DELAY = " ,(number->string master-reconnection-delay) "\n") - ,@`("MASTER_HOST = " ,master-host "\n") - ,@`("MASTER_PORT = " ,(number->string master-port) "\n") - ,@`("MASTER_TIMEOUT = " ,(number->string master-timeout) "\n") - ,@`("METADATA_CHECKSUM_INTERVAL = " ,(number->string metadata-checksum-interval) "\n") - ,@`("METADATA_CHECKSUM_RECALCULATION_SPEED = " ,(number->string metadata-checksum-recalculation-speed) "\n") - ,@(if disable-metadata-checksum-verification - `("DISABLE_METADATA_CHECKSUM_VERIFICATION = 1\n") - `("DISABLE_METADATA_CHECKSUM_VERIFICATION = 0\n")) - ,@`("METADATA_SAVE_REQUEST_MIN_PERIOD = " ,(number->string metadata-save-request-min-period) "\n") - ,@(if use-bdb-for-name-storage - `("USE_BDB_FOR_NAME_STORAGE = 1\n") - `("USE_BDB_FOR_NAME_STORAGE = 0\n")) - ,@`("BDB_NAME_STORAGE_CACHE = " ,(number->string bdb-name-storage-cache) "\n") - ,@(if avoid-same-ip-chunkservers - `("AVOID_SAME_IP_CHUNKSERVERS = 1\n") - `("AVOID_SAME_IP_CHUNKSERVERS = 0\n")) - ,@`("LOAD_FACTOR_PENALTY = " ,(number->string load-factor-penalty) "\n") - ,@`("REDUNDANCY_LEVEL = " ,(number->string redundancy-level) "\n") - ,@`("SNAPSHOT_INITIAL_BATCH_SIZE_LIMIT = " ,(number->string snapshot-initial-batch-size-limit) "\n") - ,@`("FILE_TEST_LOOP_MIN_TIME = " ,(number->string file-test-loop-min-time) "\n")))) - port))) - #:local-build? #t)))) - -(define-record-type* <lizardfs-configuration> - lizardfs-configuration - make-lizardfs-configuration - lizardfs-configuration? - (package lizardfs-configuration-package - (default lizardfs)) - (mfsmetalogger-config lizardfs-configuration-mfsmetalogger-config - (default (lizardfs-mfsmetalogger-config-file))) - (mfschunkserver-config lizardfs-configuration-mfschunkserver-config - (default (lizardfs-mfschunkserver-config-file))) - (mfshdd-config lizardfs-configuration-mfshdd-config - (default (lizardfs-mfshdd-config-file))) - (mfsmaster-config lizardfs-configuration-mfsmaster-config - (default (lizardfs-mfsmaster-config-file))) - (run-mfsmetalogger-service? lizardfs-configuration-run-mfsmetalogger-service - (default #f)) - (mfsgoals-config lizardfs-configuration-mfsgoals-config - (default (plain-file "mfsgoals.cfg" - (string-append - "1 1_copy : _\n" - "2 2_copies : _ _\n" - "3 3_copies : _ _ _\n")))) - (mfsmount-config lizardfs-configuration-mfsmount-config - (default (plain-file "mfsmount.cfg" - ""))) - (mfsexports-config lizardfs-configuration-mfsexports-config - (default (plain-file "mfsexports.cfg" - ""))) - (mfstopology-config lizardfs-configuration-mfstopology-config - (default (plain-file "mfstopology.cfg" - ""))) - (globaliolimits-config lizardfs-configuration-globaliolimits-config - (default (plain-file "globaliolimits.cfg" - ""))) - (iolimits-config lizardfs-configuration-iolimits-config - (default (plain-file "iolimits.cfg" - "")))) - -(define lizardfs-shepherd-service - (match-lambda - (($ <lizardfs-configuration> package) - (list - (shepherd-service - (documentation "Lizardfs mfsmaster server") - (provision '(lizardfs)) - (requirement '(loopback)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/mfsmaster") - "-c" "/etc/lizardfs/mfsmaster.cfg" - "-d" "start") - #:log-file "/var/log/mfsmaster.log")) - (stop #~(make-system-destructor - #$(file-append package "/sbin/mfsmaster") - " -c /etc/lizardfs/mfsmaster.cfg" - " stop")) - (respawn? #f) - (auto-start? #f) - ))))) - -(define lizardfs-mfsmetalogger-shepherd-service - (match-lambda - (($ <lizardfs-configuration> package) - (list - (shepherd-service - (documentation "Lizardfs mfsmetalogger server") - (provision '(lizardfs-mfsmetalogger)) - (requirement '(loopback lizardfs)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/mfsmetalogger") - "-c" "/etc/lizardfs/mfsmetalogger.cfg" - "-d" "start") - #:log-file "/var/log/mfsmetalogger.log")) - (stop #~(make-system-destructor - #$(file-append package "/sbin/mfsmetalogger") - " -c /etc/lizardfs/mfsmetalogger.cfg" - " stop")) - (auto-start? #f) - ))))) - -(define lizardfs-mfschunkserver-shepherd-service - (match-lambda - (($ <lizardfs-configuration> package) - (list - (shepherd-service - (documentation "Lizardfs mfschunkserver server") - (provision '(lizardfs-mfschunkserver)) - (requirement '(loopback lizardfs)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/mfschunkserver") - "-c" "/etc/lizardfs/mfschunkserver.cfg" - "-d" "start") - #:log-file "/var/log/mfschunkserver.log")) - (stop #~(make-system-destructor - #$(file-append package "/sbin/mfschunkserver") - " -c /etc/lizardfs/mfschunkserver.cfg" - " stop")) - (auto-start? #f) - ))))) - -(define lizardfs-mfsmount-shepherd-service - (match-lambda - (($ <lizardfs-configuration> package) - (list - (shepherd-service - (documentation "Mount Lizardfs filesystems") - (provision '(lizardfs-mounts)) - (requirement '(loopback)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/bin/mfsmount") - ;#$mountpoint - "-o" "mfsdelayedinit") - )) - ;(stop #~(make-system-destructor #$(file-append fuse "/bin/fusermount") " -u " #$mountpoint)) - (stop #~(make-kill-destructor)) - (auto-start? #f) - ))))) - -(define (lizardfs-etc-service config) - `(("lizardfs/globaliolimits.cfg" - ,(lizardfs-configuration-globaliolimits-config config)) - ("lizardfs/iolimits.cfg" - ,(lizardfs-configuration-iolimits-config config)) - ("lizardfs/mfschunkserver.cfg" - ,(lizardfs-configuration-mfschunkserver-config config)) - ("lizardfs/mfsexports.cfg" - ,(lizardfs-configuration-mfsexports-config config)) - ("lizardfs/mfsgoals.cfg" - ,(lizardfs-configuration-mfsgoals-config config)) - ("lizardfs/mfshdd.cfg" - ,(lizardfs-configuration-mfshdd-config config)) - ("lizardfs/mfsmaster.cfg" - ,(lizardfs-configuration-mfsmaster-config config)) - ("lizardfs/mfsmetalogger.cfg" - ,(lizardfs-configuration-mfsmetalogger-config config)) - ("lizardfs/mfsmount.cfg" - ,(lizardfs-configuration-mfsmount-config config)) - ("lizardfs/mfstopology.cfg" - ,(lizardfs-configuration-mfstopology-config config)))) - -(define (lizardfs-activation config) - #~(begin - (unless (and (file-exists? "/var/lib/lizardfs/metadata.mfs") - (lizardfs-configuration-run-mfsmetalogger-service config)) - ;; First run "service". - (with-output-to-file "/var/lib/lizardfs/metadata.mfs" - (lambda () - (format #t "MFSM NEW")))) - #$(plain-file? (lizardfs-configuration-globaliolimits-config config)) - #$(plain-file? (lizardfs-configuration-iolimits-config config)) - #$(plain-file? (lizardfs-configuration-mfschunkserver-config config)) - #$(plain-file? (lizardfs-configuration-mfsexports-config config)) - #$(plain-file? (lizardfs-configuration-mfsgoals-config config)) - #$(plain-file? (lizardfs-configuration-mfshdd-config config)) - #$(plain-file? (lizardfs-configuration-mfsmaster-config config)) - #$(plain-file? (lizardfs-configuration-mfsmetalogger-config config)) - #$(plain-file? (lizardfs-configuration-mfsmount-config config)) - #$(plain-file? (lizardfs-configuration-mfstopology-config config)) - #t)) - -(define (lizardfs-services-to-run config) - (append (lizardfs-shepherd-service config) - (lizardfs-mfschunkserver-shepherd-service config) - (if (lizardfs-configuration-run-mfsmetalogger-service config) - (lizardfs-mfsmetalogger-shepherd-service config) - '()))) - -(define lizardfs-service-type - (service-type - (name 'lizardfs) - (extensions - (list - (service-extension shepherd-root-service-type - lizardfs-services-to-run) - (service-extension activation-service-type - lizardfs-activation) - (service-extension etc-service-type - lizardfs-etc-service) - (service-extension account-service-type - (const %lizardfs-accounts)) - (service-extension profile-service-type - (compose list lizardfs-configuration-package)))) - (default-value (lizardfs-configuration)) - (description ""))) |
