Compare commits
68 Commits
Author | SHA1 | Date | |
---|---|---|---|
1ff835deb7
|
|||
6ad8cc9d6b
|
|||
07e18601f2
|
|||
040964998d
|
|||
f6b0061f10
|
|||
150c498bfc
|
|||
29061f2bb2
|
|||
e441e3c932
|
|||
a7c087b489
|
|||
fc99d07737
|
|||
29b04e3a54
|
|||
02e78b0ad5
|
|||
e307e6d3e3
|
|||
9d8f4924ac
|
|||
356887629b
|
|||
5f5236b72e
|
|||
9e98df75cb
|
|||
355292d9fc
|
|||
11c304fbf0
|
|||
d92f5c932c
|
|||
aa4b79ee9a
|
|||
1a03ca7dfe
|
|||
847dfa0436
|
|||
dbc422e723
|
|||
50b356cac0
|
|||
1eaeeaf615
|
|||
ac3a602e26
|
|||
5959eaf1ef
|
|||
4c3c8fc71f
|
|||
0ef81f03f0
|
|||
0bd99c3fcc
|
|||
ef4209b09f
|
|||
9b6dc3c486
|
|||
3463d69782
|
|||
93adbb5173
|
|||
bcb6681440
|
|||
5d232f934f
|
|||
c79df400cb
|
|||
9fba8fd2e2
|
|||
cacb1c0254
|
|||
8afcfef5e8
|
|||
f798ef400d
|
|||
a17ef7b6ec
|
|||
104be55bdf
|
|||
19eb9325ca
|
|||
5a34c3079f
|
|||
e4177eeb27
|
|||
c78c93db8a
|
|||
4119765a87
|
|||
e5f9d3e3c8
|
|||
6f2966800b
|
|||
c0f1bddf29
|
|||
f96aa7c798
|
|||
314b9a421d
|
|||
6cf3b46f76
|
|||
7cf68d5d55
|
|||
8817c3fa12
|
|||
f90c1c2dbb
|
|||
c6fcce2d41
|
|||
828dffd523
|
|||
053927e329
|
|||
b555c9a37f
|
|||
1adf5fa9d0
|
|||
73567d3230
|
|||
f24cdbac1c
|
|||
535af64d1a
|
|||
29fd3a5234
|
|||
8637dc0f57
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -6,5 +6,6 @@ cube/pubsubc.a
|
|||||||
test
|
test
|
||||||
.bash_history
|
.bash_history
|
||||||
.vscode
|
.vscode
|
||||||
|
.dccache
|
||||||
|
sink/.dccache
|
||||||
|
|
||||||
|
@ -1,36 +1,55 @@
|
|||||||
stages:
|
stages:
|
||||||
- check
|
|
||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
include:
|
variables:
|
||||||
- project: dockerized/commons
|
IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH
|
||||||
ref: master
|
HUB_IMAGE_NAME: wollud1969/sinkserver
|
||||||
file: gitlab-ci-template.yml
|
|
||||||
|
|
||||||
deploy:
|
build:
|
||||||
image: registry.hottis.de/dockerized/docker-bash:latest
|
image: registry.hottis.de/dockerized/docker-bash:latest
|
||||||
stage: deploy
|
stage: build
|
||||||
tags:
|
tags:
|
||||||
- hottis
|
- hottis
|
||||||
- linux
|
- linux
|
||||||
- docker
|
- docker
|
||||||
only:
|
script:
|
||||||
- tags
|
- docker build --build-arg="VERSION=${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TAG}" --tag $IMAGE_NAME:${CI_COMMIT_SHORT_SHA} .
|
||||||
variables:
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY;
|
||||||
GIT_STRATEGY: none
|
- docker push $IMAGE_NAME:${CI_COMMIT_SHORT_SHA}
|
||||||
CONTAINER_NAME: sink
|
- if [ "$CI_COMMIT_TAG" != "" ]; then
|
||||||
script:
|
docker tag $IMAGE_NAME:${CI_COMMIT_SHORT_SHA} $IMAGE_NAME:${CI_COMMIT_TAG};
|
||||||
- docker stop $CONTAINER_NAME || echo "container not running, never mind"
|
docker push $IMAGE_NAME:${CI_COMMIT_TAG};
|
||||||
- docker rm $CONTAINER_NAME || echo "container not existing, never mind"
|
fi
|
||||||
- docker run
|
- docker login -u $DOCKER_HUB_LOGIN -p $DOCKER_HUB_PASSWORD
|
||||||
-d
|
- docker tag $IMAGE_NAME:${CI_COMMIT_SHORT_SHA} ${HUB_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}
|
||||||
--network docker-server
|
- docker push ${HUB_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}
|
||||||
--ip 172.16.10.42
|
|
||||||
-v sink_config:/etc/sink
|
|
||||||
--name $CONTAINER_NAME
|
# deploy:
|
||||||
--restart always
|
# image: registry.hottis.de/dockerized/docker-bash:latest
|
||||||
$IMAGE_NAME:$CI_COMMIT_TAG
|
# stage: deploy
|
||||||
environment:
|
# tags:
|
||||||
name: production
|
# - hottis
|
||||||
|
# - linux
|
||||||
|
# - docker
|
||||||
|
# only:
|
||||||
|
# - tags
|
||||||
|
# variables:
|
||||||
|
# GIT_STRATEGY: none
|
||||||
|
# CONTAINER_NAME: sink
|
||||||
|
# script:
|
||||||
|
# - docker stop $CONTAINER_NAME || echo "container not running, never mind"
|
||||||
|
# - docker rm $CONTAINER_NAME || echo "container not existing, never mind"
|
||||||
|
# - docker run
|
||||||
|
# -d
|
||||||
|
# --network docker-server
|
||||||
|
# --ip 172.16.10.42
|
||||||
|
# -v sink_config:/etc/sink
|
||||||
|
# --name $CONTAINER_NAME
|
||||||
|
# --restart always
|
||||||
|
# $IMAGE_NAME:$CI_COMMIT_TAG
|
||||||
|
# environment:
|
||||||
|
# name: production
|
||||||
|
|
||||||
|
|
||||||
|
28
.woodpecker.yml
Normal file
28
.woodpecker.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
steps:
|
||||||
|
build:
|
||||||
|
image: plugins/kaniko
|
||||||
|
settings:
|
||||||
|
repo: gitea.hottis.de/${CI_REPO}
|
||||||
|
registry: https://gitea.hottis.de/v2/
|
||||||
|
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
|
||||||
|
username:
|
||||||
|
from_secret: system_container_registry_username
|
||||||
|
password:
|
||||||
|
from_secret: system_container_registry_password
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
when:
|
||||||
|
- event: [push, tag]
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
image: portainer/kubectl-shell:latest
|
||||||
|
secrets:
|
||||||
|
- source: kube_config
|
||||||
|
target: KUBE_CONFIG_CONTENT
|
||||||
|
commands:
|
||||||
|
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
||||||
|
- export KUBECONFIG=/tmp/kubeconfig
|
||||||
|
- cd ${CI_WORKSPACE}
|
||||||
|
- cat deploy-yml.tmpl | sed -e 's,%IMAGE%,gitea.hottis.de/'${CI_REPO}':'${CI_COMMIT_TAG}',' > deploy.yml
|
||||||
|
- cat deploy.yml
|
||||||
|
when:
|
||||||
|
- event: tag
|
22
Dockerfile
22
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.13 AS builder
|
FROM alpine:3.18.3 AS builder
|
||||||
|
|
||||||
ARG VERSION="dockerized"
|
ARG VERSION="dockerized"
|
||||||
|
|
||||||
@ -7,26 +7,30 @@ COPY sink/ /tmp/sink
|
|||||||
RUN \
|
RUN \
|
||||||
apk update && \
|
apk update && \
|
||||||
apk add alpine-sdk && \
|
apk add alpine-sdk && \
|
||||||
apk add libconfig-dev && \
|
|
||||||
apk add postgresql-dev && \
|
apk add postgresql-dev && \
|
||||||
cd /tmp/sink && \
|
cd /tmp/sink && \
|
||||||
make VERSION=${VERSION}
|
make VERSION=${VERSION}
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:3.13
|
FROM alpine:3.18.3
|
||||||
|
|
||||||
|
ENV PGHOST=""
|
||||||
|
ENV PGDATABASE="mainscnt"
|
||||||
|
ENV PGUSER="sink"
|
||||||
|
ENV PGPASSWORD=""
|
||||||
|
ENV PGSSLMODE="require"
|
||||||
|
ENV LOWER_BOUND="44000"
|
||||||
|
ENV UPPER_BOUND="56000"
|
||||||
|
|
||||||
COPY --from=builder /tmp/sink/build/sink20169 /usr/local/bin/
|
COPY --from=builder /tmp/sink/build/sink20169 /usr/local/bin/
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk add --no-cache libpq && \
|
apk add --no-cache libpq
|
||||||
apk add --no-cache libconfig && \
|
|
||||||
mkdir /etc/sink
|
|
||||||
|
|
||||||
EXPOSE 20169/udp
|
EXPOSE 20169/udp
|
||||||
|
USER nobody
|
||||||
|
|
||||||
VOLUME /etc/sink
|
CMD [ "/usr/local/bin/sink20169", "-v", "-d" ]
|
||||||
|
|
||||||
CMD [ "/usr/local/bin/sink20169", "-f", "/etc/sink/sink20169.cfg", "-n", "nobody", "-v" ]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,3 +32,4 @@ Measurement is visualized at https://grafana.mainscnt.eu.
|
|||||||
The projects of the three current variants are at [RPi](https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-rpi), [STM32](https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-stm32) and [ESP32](https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-esp32).
|
The projects of the three current variants are at [RPi](https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-rpi), [STM32](https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-stm32) and [ESP32](https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-esp32).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
30
schema/create.sql
Normal file
30
schema/create.sql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
create sequence device_s;
|
||||||
|
|
||||||
|
CREATE TABLE device_t (
|
||||||
|
id integer DEFAULT nextval('device_s') NOT NULL,
|
||||||
|
deviceid character varying(64) NOT NULL,
|
||||||
|
sharedsecret character varying(31) NOT NULL,
|
||||||
|
location character varying(128) NOT NULL,
|
||||||
|
active boolean DEFAULT false NOT NULL,
|
||||||
|
contact character varying(128),
|
||||||
|
flaky boolean DEFAULT false NOT NULL,
|
||||||
|
CONSTRAINT device_t_sharedsecret_check CHECK ((char_length((sharedsecret)::text) = 31))
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE ONLY device_t
|
||||||
|
ADD CONSTRAINT device_t_deviceid_key UNIQUE (deviceid);
|
||||||
|
|
||||||
|
ALTER TABLE ONLY device_t
|
||||||
|
ADD CONSTRAINT device_t_pkey PRIMARY KEY (id);
|
||||||
|
|
||||||
|
CREATE TABLE mainsfrequency (
|
||||||
|
"time" timestamp without time zone NOT NULL,
|
||||||
|
host text,
|
||||||
|
location text,
|
||||||
|
freq double precision,
|
||||||
|
valid smallint DEFAULT 1 NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
select create_hypertable('mainsfrequency', 'time');
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
CREATE SEQUENCE device_s START WITH 1 INCREMENT BY 1;
|
|
||||||
|
|
||||||
CREATE TABLE device_t (
|
|
||||||
id integer PRIMARY KEY DEFAULT NEXTVAL('device_s'),
|
|
||||||
deviceid varchar(16) UNIQUE NOT NULL,
|
|
||||||
sharedsecret varchar(31) NOT NULL CHECK(char_length(sharedSecret) = 31),
|
|
||||||
location varchar(128) NOT NULL,
|
|
||||||
active boolean NOT NULL DEFAULT false
|
|
||||||
);
|
|
@ -9,10 +9,10 @@ VERSION ?= $(shell git rev-parse --short=8 HEAD)
|
|||||||
UNAME_S := $(shell uname -s)
|
UNAME_S := $(shell uname -s)
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = $(shell pkg-config --cflags libpq libconfig) -I. \
|
CFLAGS = $(shell pkg-config --cflags libpq) -I. \
|
||||||
-Wall -Werror -std=c99 \
|
-Wall -Werror -std=c99 \
|
||||||
-D$(UNAME_S)=1 -DVERSION="\"$(VERSION)\""
|
-D$(UNAME_S)=1 -DVERSION="\"$(VERSION)\""
|
||||||
LDFLAGS = $(shell pkg-config --libs libpq libconfig)
|
LDFLAGS = $(shell pkg-config --libs libpq)
|
||||||
TARGET = sink20169
|
TARGET = sink20169
|
||||||
|
|
||||||
all: $(BUILD_DIR)/$(TARGET)
|
all: $(BUILD_DIR)/$(TARGET)
|
||||||
|
@ -17,14 +17,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <libconfig.h>
|
|
||||||
#include <libpq-fe.h>
|
#include <libpq-fe.h>
|
||||||
#include <sinkStruct.h>
|
#include <sinkStruct.h>
|
||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <sha256.h>
|
#include <sha256.h>
|
||||||
|
|
||||||
|
|
||||||
const char DEFAULT_CONFIG_FILENAME[] = "./sink20169.cfg";
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *deviceId;
|
const char *deviceId;
|
||||||
@ -34,20 +32,12 @@ typedef struct {
|
|||||||
PGresult *deviceResult;
|
PGresult *deviceResult;
|
||||||
} t_device;
|
} t_device;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
config_t cfg;
|
|
||||||
uint16_t numOfDevices;
|
|
||||||
t_device *devices;
|
|
||||||
} t_configHandle;
|
|
||||||
|
|
||||||
#define NUM_OF_STMT_PARAMS 4
|
#define NUM_OF_STMT_PARAMS 4
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
t_configHandle *configHandle;
|
|
||||||
int receiveSockFd;
|
int receiveSockFd;
|
||||||
int32_t lowerBound;
|
int32_t lowerBound;
|
||||||
int32_t upperBound;
|
int32_t upperBound;
|
||||||
const char *postgresqlConnInfo;
|
|
||||||
PGconn *conn;
|
PGconn *conn;
|
||||||
t_device foundDevice;
|
t_device foundDevice;
|
||||||
} t_commonHandle;
|
} t_commonHandle;
|
||||||
@ -61,7 +51,7 @@ int openDatabaseConnection(t_commonHandle *handle) {
|
|||||||
|
|
||||||
if (! handle->conn) {
|
if (! handle->conn) {
|
||||||
logmsg(LOG_DEBUG, "Opening connection to database");
|
logmsg(LOG_DEBUG, "Opening connection to database");
|
||||||
handle->conn = PQconnectdb(handle->postgresqlConnInfo);
|
handle->conn = PQconnectdb("");
|
||||||
} else if (PQstatus(handle->conn) != CONNECTION_OK) {
|
} else if (PQstatus(handle->conn) != CONNECTION_OK) {
|
||||||
logmsg(LOG_DEBUG, "Resetting connection to database");
|
logmsg(LOG_DEBUG, "Resetting connection to database");
|
||||||
PQreset(handle->conn);
|
PQreset(handle->conn);
|
||||||
@ -75,22 +65,6 @@ int openDatabaseConnection(t_commonHandle *handle) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int initConfig(const char *configFilename, t_configHandle *configHandle) {
|
|
||||||
config_init(&(configHandle->cfg));
|
|
||||||
if (! config_read_file(&(configHandle->cfg), configFilename)) {
|
|
||||||
logmsg(LOG_ERR, "failed to read config file: %s:%d - %s\n",
|
|
||||||
config_error_file(&(configHandle->cfg)), config_error_line(&(configHandle->cfg)),
|
|
||||||
config_error_text(&(configHandle->cfg)));
|
|
||||||
config_destroy(&(configHandle->cfg));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void deinitConfig(t_configHandle *configHandle) {
|
|
||||||
config_destroy(&(configHandle->cfg));
|
|
||||||
}
|
|
||||||
|
|
||||||
// When you got a result here, remember to free it using freeDevice
|
// When you got a result here, remember to free it using freeDevice
|
||||||
int findDevice(t_commonHandle *handle, char *deviceId) {
|
int findDevice(t_commonHandle *handle, char *deviceId) {
|
||||||
@ -154,9 +128,7 @@ void freeDevice(t_commonHandle *handle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int initReceiver(t_configHandle *configHandle, t_commonHandle *handle) {
|
int initReceiver(t_commonHandle *handle) {
|
||||||
handle->configHandle = configHandle;
|
|
||||||
|
|
||||||
struct sockaddr_in servaddr;
|
struct sockaddr_in servaddr;
|
||||||
|
|
||||||
handle->receiveSockFd = socket(AF_INET, SOCK_DGRAM, 0);
|
handle->receiveSockFd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
@ -166,11 +138,6 @@ int initReceiver(t_configHandle *configHandle, t_commonHandle *handle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int receivePort = 20169;
|
int receivePort = 20169;
|
||||||
config_lookup_int(&(configHandle->cfg), "receivePort", &receivePort);
|
|
||||||
if (receivePort < 1 || receivePort > 65535) {
|
|
||||||
logmsg(LOG_ERR, "illegal receive port configured");
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&servaddr, 0, sizeof(servaddr));
|
memset(&servaddr, 0, sizeof(servaddr));
|
||||||
servaddr.sin_family = AF_INET;
|
servaddr.sin_family = AF_INET;
|
||||||
@ -231,22 +198,13 @@ int receiveAndVerifyMinuteBuffer(t_commonHandle *handle, t_minuteBuffer *buf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int initForwarder(t_configHandle *configHandle, t_commonHandle *handle) {
|
int initForwarder(t_commonHandle *handle) {
|
||||||
handle->configHandle = configHandle;
|
|
||||||
|
|
||||||
handle->postgresqlConnInfo = NULL;
|
|
||||||
config_lookup_string(&(configHandle->cfg), "postgresqlConnInfo", &(handle->postgresqlConnInfo));
|
|
||||||
if (! handle->postgresqlConnInfo) {
|
|
||||||
logmsg(LOG_ERR, "no postgresql connInfo configured");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
handle->conn = NULL;
|
handle->conn = NULL;
|
||||||
|
|
||||||
handle->lowerBound = 45000;
|
char *lowerBoundStr = getenv("LOWER_BOUND");
|
||||||
config_lookup_int(&(configHandle->cfg), "lowerBound", &(handle->lowerBound));
|
handle->lowerBound = lowerBoundStr ? strtol(lowerBoundStr, NULL, 10) : 45000;
|
||||||
handle->upperBound = 55000;
|
char *upperBoundStr = getenv("UPPER_BOUND");
|
||||||
config_lookup_int(&(configHandle->cfg), "upperBound", &(handle->upperBound));
|
handle->upperBound = upperBoundStr ? strtol(upperBoundStr, NULL, 10) : 55000;
|
||||||
logmsg(LOG_INFO, "lowerBound: %u, upperBound: %u", handle->lowerBound, handle->upperBound);
|
logmsg(LOG_INFO, "lowerBound: %u, upperBound: %u", handle->lowerBound, handle->upperBound);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -357,21 +315,16 @@ void usage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
t_configHandle configHandle;
|
|
||||||
t_commonHandle commonHandle;
|
t_commonHandle commonHandle;
|
||||||
commonHandle.foundDevice.deviceResult = NULL;
|
commonHandle.foundDevice.deviceResult = NULL;
|
||||||
|
|
||||||
|
|
||||||
const char *configFilename = DEFAULT_CONFIG_FILENAME;
|
|
||||||
const char *dropPrivilegesToUser = NULL;
|
const char *dropPrivilegesToUser = NULL;
|
||||||
bool doFork = false;
|
bool doFork = false;
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt(argc, argv, "f:vds:hn:b")) != -1) {
|
while ((c = getopt(argc, argv, "vds:hn:b")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'f':
|
|
||||||
configFilename = strdup(optarg);
|
|
||||||
break;
|
|
||||||
case 'v':
|
case 'v':
|
||||||
verbose = true;
|
verbose = true;
|
||||||
break;
|
break;
|
||||||
@ -410,11 +363,6 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
logmsg(LOG_INFO, "Version: " VERSION);
|
logmsg(LOG_INFO, "Version: " VERSION);
|
||||||
|
|
||||||
if (0 != initConfig(configFilename, &configHandle)) {
|
|
||||||
logmsg(LOG_ERR, "error when reading configuration");
|
|
||||||
exit(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doFork) {
|
if (doFork) {
|
||||||
int pid = fork();
|
int pid = fork();
|
||||||
if (pid == -1) {
|
if (pid == -1) {
|
||||||
@ -427,12 +375,12 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 != initReceiver(&configHandle, &commonHandle)) {
|
if (0 != initReceiver(&commonHandle)) {
|
||||||
logmsg(LOG_ERR, "error when initializing receiver");
|
logmsg(LOG_ERR, "error when initializing receiver");
|
||||||
exit(5);
|
exit(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 != initForwarder(&configHandle, &commonHandle)) {
|
if (0 != initForwarder(&commonHandle)) {
|
||||||
logmsg(LOG_ERR, "error when initializing forwarder");
|
logmsg(LOG_ERR, "error when initializing forwarder");
|
||||||
exit(6);
|
exit(6);
|
||||||
}
|
}
|
||||||
@ -458,5 +406,4 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
deinitForwarder(&commonHandle);
|
deinitForwarder(&commonHandle);
|
||||||
deinitReceiver(&commonHandle);
|
deinitReceiver(&commonHandle);
|
||||||
deinitConfig(&configHandle);
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
postgresqlConnInfo = "host=172.16.3.32 dbname=mainscnt user=sink password=test123";
|
|
||||||
|
|
||||||
lowerBound = 45000;
|
|
||||||
upperBound = 55000;
|
|
||||||
|
|
||||||
receivePort = 20169;
|
|
||||||
|
|
Reference in New Issue
Block a user