Commit 7afab50a authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Replace buggy libtar with libarchive

parent 6236e1fe
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ before_script:
        protobuf-c-compiler
        protobuf-c-compiler
        libyaml-cpp-dev
        libyaml-cpp-dev
        libyaml-dev
        libyaml-dev
        libtar-dev
        libarchive-dev
        cmake
        cmake


    - pushd . &&
    - pushd . &&
@@ -155,7 +155,7 @@ test:coverage:
            protobuf-c-compiler
            protobuf-c-compiler
            libyaml-cpp-dev
            libyaml-cpp-dev
            libyaml-dev
            libyaml-dev
            libtar-dev
            libarchive-dev
            libcap2-bin
            libcap2-bin
            valgrind
            valgrind
            cmake
            cmake
@@ -275,7 +275,7 @@ test:optimized:
            protobuf-c-compiler
            protobuf-c-compiler
            libyaml-cpp-dev
            libyaml-cpp-dev
            libyaml-dev
            libyaml-dev
            libtar-dev
            libarchive-dev
            libcap2-bin
            libcap2-bin
            valgrind
            valgrind
            cmake
            cmake
+1 −1
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@ $ apt-get install -y libboost-system-dev libboost-filesystem-dev \
                     libboost-program-options-dev libboost-thread-dev \
                     libboost-program-options-dev libboost-thread-dev \
                     libboost-regex-dev libprotobuf-dev protobuf-compiler \
                     libboost-regex-dev libprotobuf-dev protobuf-compiler \
                     libprotobuf-c-dev protobuf-c-compiler \
                     libprotobuf-c-dev protobuf-c-compiler \
                     libyaml-cpp-dev libyaml-dev libtar-dev
                     libyaml-cpp-dev libyaml-dev libarchive-dev


# Building and installing libfabric (required for Mercury's OFI/libfabric plugin)
# Building and installing libfabric (required for Mercury's OFI/libfabric plugin)
$ git clone https://github.com/ofiwg/libfabric.git &&
$ git clone https://github.com/ofiwg/libfabric.git &&
+2 −5
Original line number Original line Diff line number Diff line
@@ -149,11 +149,8 @@ AC_SEARCH_LIBS([yaml_parser_initialize], [yaml],
                AC_SUBST(YAML_LIBS)], 
                AC_SUBST(YAML_LIBS)], 
               [AC_MSG_ERROR([This software requires libyaml >= 0.1.4])])
               [AC_MSG_ERROR([This software requires libyaml >= 0.1.4])])


# check for libtar manually (since it doesn't provide a pkgconfig file)
# check for libarchive
AC_SEARCH_LIBS([tar_open], [tar],
PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.1.2])
               [TAR_LIBS="-ltar"
                AC_SUBST(TAR_LIBS)],
               [AC_MSG_ERROR([This software requires libtar >= 1.2.0])])


# Checks for header files.
# Checks for header files.


+2 −3
Original line number Original line Diff line number Diff line
@@ -90,7 +90,7 @@ liburd_resources_la_LDFLAGS = \
    @BOOST_THREAD_LIB@ \
    @BOOST_THREAD_LIB@ \
    @MERCURY_LIBS@ \
    @MERCURY_LIBS@ \
	@PROTOBUF_LIBS@ \
	@PROTOBUF_LIBS@ \
	@TAR_LIBS@ \
	@LIBARCHIVE_LIBS@ \
	-pthread
	-pthread




@@ -227,7 +227,7 @@ liburd_aux_la_LDFLAGS = \
    @MERCURY_LIBS@ \
    @MERCURY_LIBS@ \
	@PROTOBUF_LIBS@ \
	@PROTOBUF_LIBS@ \
	@YAMLCPP_LIBS@ \
	@YAMLCPP_LIBS@ \
	@TAR_LIBS@ \
	@LIBARCHIVE_LIBS@ \
	liburd_resources.la \
	liburd_resources.la \
	-pthread
	-pthread


@@ -304,7 +304,6 @@ urd_LDFLAGS = \
    @BOOST_THREAD_LIB@ \
    @BOOST_THREAD_LIB@ \
    @MERCURY_LIBS@ \
    @MERCURY_LIBS@ \
	@PROTOBUF_LIBS@ \
	@PROTOBUF_LIBS@ \
	@TAR_LIBS@ \
	liburd_aux.la
	liburd_aux.la


# we also need to include it as an additional dependency, since automake
# we also need to include it as an additional dependency, since automake
+11 −0
Original line number Original line Diff line number Diff line
@@ -42,6 +42,10 @@
#include <string.h>
#include <string.h>
#include <ctime>
#include <ctime>


#ifdef __LOGGER_ENABLE_DEBUG__
#include <sys/prctl.h>
#endif

#include <boost/optional.hpp>
#include <boost/optional.hpp>
#include <boost/optional/optional_io.hpp>
#include <boost/optional/optional_io.hpp>
#include <boost/atomic.hpp>
#include <boost/atomic.hpp>
@@ -1528,6 +1532,13 @@ int urd::run() {
    // validate settings
    // validate settings
    check_configuration();
    check_configuration();


#ifdef __LOGGER_ENABLE_DEBUG__
    if(::prctl(PR_SET_DUMPABLE, 1) != 0) {
        LOGGER_WARN("Failed to set PR_SET_DUMPABLE flag for process. "
                    "Daemon will not produce core dumps.");
    }
#endif

    // daemonize if needed
    // daemonize if needed
    if(m_settings->daemonize() && daemonize() != 0) {
    if(m_settings->daemonize() && daemonize() != 0) {
        /* parent clean ups and exits, child continues */
        /* parent clean ups and exits, child continues */
Loading