Commit fe7e5ee3 authored by Marc Vef's avatar Marc Vef
Browse files

Daemon now creates a pid file with pid and mountdir info for clients

Previously, clients would look for the daemon by name which was not robust.
If the daemon was started with valgrind for example, clients would not find
the daemon.

Similar to other applications a daemon now creates a pid file with
information about its pid and its started mountdir.

Proper errorhandling on server and client side was added.

Multiple daemons per node are explicitly not allowed for now!
parent 9234c592
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -55,8 +55,6 @@ bool init_rpc_server();

void register_server_rpcs(margo_instance_id mid);

std::string daemon_register_path();

bool register_daemon_proc();

bool deregister_daemon_proc();
+3 −4
Original line number Diff line number Diff line
#include "../../configure_public.hpp"

/**
 * Attention: This whole configfile is not in a final form! This will eventually be a plaintext config file.
 */

#ifndef FS_CONFIGURE_H
#define FS_CONFIGURE_H

#include "../../configure_public.hpp"

// Daemon path to auxiliary files
#define DAEMON_AUX_PATH "/tmp/adafs"
#define DAEMON_AUX_PATH "/tmp"

// If ACM time should be considered
#define ACMtime //unused
+9 −0
Original line number Diff line number Diff line
#ifndef IFS_GLOBAL_FUNC_HPP
#define IFS_GLOBAL_FUNC_HPP

#include <string>
#include <global/configure.hpp>

std::string daemon_pid_path();

#endif //IFS_GLOBAL_FUNC_HPP
+1 −5
Original line number Diff line number Diff line
@@ -116,11 +116,7 @@ int db_val_to_stat(std::string path, std::string db_val, struct stat& attr);

int db_val_to_stat64(std::string path, std::string db_val, struct stat64& attr);

int getProcIdByName(std::string procName);

std::string daemon_register_path(int pid);

bool get_daemon_auxiliaries();
int get_daemon_pid();

bool read_system_hostfile();

+2 −0
Original line number Diff line number Diff line
set(DAEMON_SRC
    ../global/rpc/rpc_utils.cpp
    ../global/global_func.cpp
    adafs_daemon.cpp
    adafs_ops/data.cpp
    adafs_ops/metadentry.cpp
@@ -16,6 +17,7 @@ set(DAEMON_HEADERS
    ../../configure_public.hpp
    ../../include/global/configure.hpp
    ../../include/global/global_defs.hpp
    ../../include/global/global_func.hpp
    ../../include/global/rpc/ipc_types.hpp
    ../../include/global/rpc/rpc_types.hpp
    ../../include/global/rpc/rpc_utils.hpp
Loading