Verified Commit 4d4ee186 authored by Marc Vef's avatar Marc Vef
Browse files

Reintroducing daemon pid file, migrating util code to util

parent a5613987
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -40,7 +40,5 @@ void init_rpc_server(const std::string& protocol);

void register_server_rpcs(margo_instance_id mid);

void populate_hosts_file();
void destroy_hosts_file();

#endif // GKFS_DAEMON_MAIN_HPP
+36 −0
Original line number Diff line number Diff line
/*
  Copyright 2018-2019, Barcelona Supercomputing Center (BSC), Spain
  Copyright 2015-2019, Johannes Gutenberg Universitaet Mainz, Germany

  This software was partially supported by the
  EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).

  This software was partially supported by the
  ADA-FS project under the SPPEXA project funded by the DFG.

  SPDX-License-Identifier: MIT
*/

#ifndef GEKKOFS_UTIL_HPP
#define GEKKOFS_UTIL_HPP

#include <string>
#include <vector>

namespace gkfs {
    namespace util {
        void populate_hosts_file();

        void destroy_hosts_file();

        void create_pid_file();

        void remove_pid_file();

        std::vector<std::pair<std::string, std::string>> get_interf_ips();

        std::string get_pid_file_path();
    }
}

#endif //GEKKOFS_UTIL_HPP
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@
#define DAEMON_ENV_PREFIX "GKFS_"

// Log
#define DEFAULT_DAEMON_PID_PATH "/tmp/gkfs_daemon"
#define DEFAULT_CLIENT_LOG_PATH "/tmp/gkfs_client.log"
#define DEFAULT_DAEMON_LOG_PATH "/tmp/gkfs_daemon.log"

+29 −0
Original line number Diff line number Diff line
/*
  Copyright 2018-2019, Barcelona Supercomputing Center (BSC), Spain
  Copyright 2015-2019, Johannes Gutenberg Universitaet Mainz, Germany

  This software was partially supported by the
  EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).

  This software was partially supported by the
  ADA-FS project under the SPPEXA project funded by the DFG.

  SPDX-License-Identifier: MIT
*/

#include <string>
#include <stdexcept>

#ifndef GEKKOFS_EXCEPTIONS_HPP
#define GEKKOFS_EXCEPTIONS_HPP

namespace gkfs {
    namespace error {
        class NetworkAddrException: public std::runtime_error {
        public:
            NetworkAddrException(const std::string & s) : std::runtime_error(s) {};
        };
    }
}

#endif //GEKKOFS_EXCEPTIONS_HPP
+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ set(DAEMON_SRC
    ../global/rpc/rpc_utils.cpp
    ../global/path_util.cpp
    main.cpp
    util.cpp
    ops/metadentry.cpp
    classes/fs_data.cpp
    classes/rpc_data.cpp
@@ -15,11 +16,13 @@ set(DAEMON_SRC
set(DAEMON_HEADERS
    ../../include/version.hpp
    ../../include/global/configure.hpp
    ../../include/global/exceptions.hpp
    ../../include/global/global_defs.hpp
    ../../include/global/rpc/rpc_types.hpp
    ../../include/global/rpc/rpc_utils.hpp
    ../../include/global/path_util.hpp
    ../../include/daemon/main.hpp
    ../../include/daemon/util.hpp
    ../../include/daemon/ops/metadentry.hpp
    ../../include/daemon/classes/fs_data.hpp
    ../../include/daemon/classes/rpc_data.hpp
Loading