Can t install IDAS through provided RPMs on CentOS 7 VM

0 votes

I tried installing IDAS GE in a CentOS 7 VM on my system through UL2.0 RPMs available on this catalogue page and I followed the instructions in a repo from this github page. But on getting to section 3, i.e, the deployment section in its list of instructions that talks of starting the IoT, on executing the init_iotagent.sh, where my VM's local IP had to be inserted, I get the following error:

log4cplus:ERROR No appenders could be found for logger (main).
log4cplus:ERROR Please initialize the log4cplus system properly.
HTTPFilter DESTRUCTOR 0
HTTPFilter DESTRUCTOR 0

And, if you look at the instructions to Start IoTAgent as a Service, it says:

After installing iot-agent-base RPM an init.d script can be found in this folder /usr/local/iot/init.d .

But, I just can't seem to find this file anywhere at all, which makes me wonder if the IoTAgent was properly installed from those RPMs provided or not? Plus, log files regarding the IoTAgent are also nowhere to be found. All I found was only the MongoDB's log file at this location: /usr/local/iot/mongodb-linux-x86_64-2.6.9/log/mongoc.log. That's all.

So, can anybody tell me what could be going wrong? Any help at all would be cool. Thanks!

Nov 20, 2018 in IoT (Internet of Things) by Bharani
• 4,660 points
872 views

1 answer to this question.

0 votes

You should get that GitHub repository and build RPMs from the source. And, only then you'd be able to install it in your CentOS. At least, that's what it tries to explain in the documentation I think. Here(Note: I've changed BUILD_TYPE to Release, so I created Release dir. GIT_VERSION and GIT_COMMIT are not latest ones.):

git clone https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus.git
cd fiware....
mkdir -p build/Release
cd build/Release
cmake -DGIT_VERSION=20527 -DGIT_COMMIT=217023407f25ed258043cfc00a46b6c05fb0b52c -DMQTT=ON -DCMAKE_BUILD_TYPE=Release ../../
make install
make package

The packages should be in pack/Linux/RPM/

rpm -i iot-agent-base-xxxxxxx (xxxxxxx will be the numbers of the build)
rpm -i iot-agent-ul-xxxxxx (xxxxxxx will be the numbers of the build)

After being installed with RPMs, the init.d file must be in: /usr/local/iot/init.d/iotagent
And, this is how the contents of that file would be like:

#!/bin/bash
# Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U
# 
# This file is part of fiware-IoTagent-Cplusplus (FI-WARE project).
# 
# iotagent         Start/Stop iotagent
#
# chkconfig: 2345 99 60
# description: iotagent

. /etc/rc.d/init.d/functions

PARAM=$1
INSTANCE=$2
USERNAME=iotagent
EXECUTABLE=/usr/local/iot/bin/iotagent
CONFIG_PATH=/usr/local/iot/config

iotagent_start()
{

    local result=0
    local instance=${1}

    if [[ ! -x ${EXECUTABLE} ]]; then
        printf "%s\n" "Fail - missing ${EXECUTABLE} executable"
        exit 1
    fi

    if [[ -z ${instance} ]]; then
        list_instances="${CONFIG_PATH}/iotagent_*.conf"
    else
        list_instances="${CONFIG_PATH}/iotagent_${instance}.conf"
    fi

    for instance_config in ${list_instances}
    do
        local NAME
        NAME=${instance_config%.conf}
        NAME=${NAME#*iotagent_}

        source ${instance_config}

        local IOTAGENT_PID_FILE="/var/run/iot/iotagent_${NAME}.pid"

        printf "Starting iotagent ${NAME}..."

        status -p ${IOTAGENT_PID_FILE} ${EXECUTABLE} &> /dev/null 
        if [[ ${?} -eq 0 ]]; then
            printf "%s\n" " Already running, skipping $(success)"
            continue
        fi

        # Load the environment
        set -a
        source ${instance_config}

        # Mandatory parameters
        IOTAGENT_OPTS="   ${IS_MANAGER}              \
                       -n ${IOTAGENT_SERVER_NAME}    \
                       -v ${IOTAGENT_LOG_LEVEL}      \
                       -i ${IOTAGENT_SERVER_ADDRESS} \
                       -p ${IOTAGENT_SERVER_PORT}    \
                       -d ${IOTAGENT_LIBRARY_DIR}    \
                       -c ${IOTAGENT_CONFIG_FILE}"

        su ${USERNAME} -c "LD_LIBRARY_PATH=\"${IOTAGENT_LIBRARY_DIR}\" \
        ${EXECUTABLE} ${IOTAGENT_OPTS} & echo \$! > ${IOTAGENT_PID_FILE}" &> /dev/null 
        sleep 2 # wait some time to leave iotagent start
        local PID=$(cat ${IOTAGENT_PID_FILE})
        local var_pid=$(ps -ef | grep ${PID} | grep -v grep)
        if [[ -z "${var_pid}" ]]; then
            printf "%s" "pidfile not found"
            printf "%s\n" "$(failure)" 
            exit 1
        else
            printf "%s\n" "$(success)"
        fi
    done

    return ${result}

}

iotagent_stop()
{
    local result=0
    local iotagent_instance=${1}

    if [[ -z ${iotagent_instance} ]]; then
        list_run_instances="/var/run/iot/iotagent_*.pid"
    else
        list_run_instances="/var/run/iot/iotagent_${iotagent_instance}.pid"
    fi

    if [[ $(ls -l ${list_run_instances} 2> /dev/null | wc -l) -eq 0 ]]; then
        printf "%s\n" "There aren't any instance of IoTAgent ${iotagent_instance} running $(success)"
        return 0
    fi

    for run_instance in ${list_run_instances}
    do

        local NAME
        NAME=${run_instance%.pid}
        NAME=${NAME#*iotagent_}

        printf "%s" "Stopping IoTAgent ${NAME}..."

        local RUN_PID=$(cat ${run_instance})
        kill ${RUN_PID}  &> /dev/null
        local KILLED_PID=$(ps -ef | grep ${RUN_PID} | grep -v grep | awk '{print $2}')
        if [[ -z ${KILLED_PID} ]]; then
            printf "%s\n" "$(success)"
        else
            printf "%s\n" "$(failure)"
            result=$((${result}+1))
        fi

        rm -f ${run_instance} &> /dev/null 

    done
    return ${result}
}

iotagent_status()
{
    local result=0
    local iotagent_instance=${1}

    if [[ -z ${iotagent_instance} ]]; then
        list_run_instances="/var/run/iot/iotagent_*.pid"
    else
        list_run_instances="/var/run/iot/iotagent_${iotagent_instance}.pid"
    fi

    if [[ $(ls -l ${list_run_instances} 2> /dev/null | wc -l) -eq 0 ]]; then
        printf "%s\n" "There aren't any instance of IoTAgent ${iotagent_instance} running."
        return 1
    fi

    for run_instance in ${list_run_instances}
    do

        local NAME
        NAME=${run_instance%.pid}
        NAME=${NAME#*iotagent_}

        printf "%s\n" "IoTAgent ${NAME} status..."
        status -p ${run_instance} ${NODE_EXEC}
        result=$((${result}+${?}))

    done

    return ${result}
}

case ${PARAM} in

    'start')
        iotagent_start ${INSTANCE}
        ;;

    'stop')
        iotagent_stop ${INSTANCE}
        ;; 

    'restart')
        iotagent_stop ${INSTANCE}
        iotagent_start ${INSTANCE}
        ;;

    'status')
        iotagent_status ${INSTANCE}
        ;;
esac

Finally, you can find the logs file in /tmp/ :

IoTAgent-IoTPlatform.log    
IoTAgent.log    
IoTAgent-Manager.log

Hope it helps! :)

answered Nov 20, 2018 by nirvana
• 3,130 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

USB Mobile Broadband Modem on Windows 10 IoT

I was looking for a solution too, ...READ MORE

answered Jul 9, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
2,735 views
0 votes
1 answer

Autostart published Application on Windows 10 IoT

It can be done by making changes ...READ MORE

answered Jul 13, 2018 in IoT (Internet of Things) by DataKing99
• 8,250 points
1,794 views
0 votes
1 answer

RPMs for IoT Agents of Backend Device Management GE in FIWARE IoT ecosystem

The RPMs for IDAS component are availaible. ...READ MORE

answered Jul 30, 2018 in IoT (Internet of Things) by DataKing99
• 8,250 points
819 views
0 votes
1 answer

can't reach cygnus instance from orion context broker

In the security rules of Cygnus instance, ...READ MORE

answered Oct 3, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
1,125 views
0 votes
1 answer

Detecting when a sensor is not sending data to Orion CB in FiWARE

Orion in itself has no such mechanism ...READ MORE

answered Nov 22, 2018 in IoT (Internet of Things) by Shubham
• 13,490 points
748 views
0 votes
1 answer

Cygnus : I'm getting this exception "curl/7.29.0 user agent not supported"

Cygnus version <= 0.8.2 controls the HTTP ...READ MORE

answered Nov 23, 2018 in IoT (Internet of Things) by Shubham
• 13,490 points
825 views
0 votes
1 answer

Sending more than 8 byte through UART on Raspberry Pi using Android Things!

So, you can send 234212441325454543595674859764 in ASCII, ...READ MORE

answered Aug 25, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,304 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP