Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileIngester #51

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fdafc0f
Added fileIngester tree
brian-m-rapp Feb 27, 2016
f8df63d
deleted goesr_lib.h
brian-m-rapp Feb 27, 2016
1311b0f
Migrated fileIngester to new LDM logging system for ldmProductQueue.c.
brian-m-rapp Feb 27, 2016
a7ee031
More logging updates.
brian-m-rapp Feb 27, 2016
39798d2
Added satellite center position to GOES-R WMO header functions.
brian-m-rapp Feb 28, 2016
348d6fd
Merge https://github.com/Unidata/LDM
brian-m-rapp Mar 10, 2016
43d64a1
Code clean up.
brian-m-rapp Mar 12, 2016
4da1b3a
More code clean up.
brian-m-rapp Mar 12, 2016
bd64b94
Fixed coding problems identified by Coverity.
brian-m-rapp Mar 16, 2016
3aebb8c
DR-18765 - Increase size of retransmission tables to allow for
brian-m-rapp Mar 18, 2016
4f71db1
Replaced 'gets' with 'fgets'.
brian-m-rapp Mar 18, 2016
6daea0f
Added build rule for .hin files to fileIngest/Makefile.am and fixed
brian-m-rapp Mar 18, 2016
cc4dd82
Updated fileIngest/.gitignore
brian-m-rapp Mar 18, 2016
bf4514a
Fixed problems from coverity scan.
brian-m-rapp Mar 21, 2016
af53393
Fixed issues reported by coverity scan.
brian-m-rapp Mar 21, 2016
e3143ce
Fixed bugs reported by Coverity scan.
brian-m-rapp Mar 23, 2016
20a9a73
Merge remote-tracking branch 'upstream/master'
brian-m-rapp Mar 24, 2016
17a3f7f
Fixed bug in fileIngest/Makefile.am
brian-m-rapp Mar 24, 2016
091977c
Add option to pqact to allow WMO header to be stripped from a product.
brian-m-rapp Aug 13, 2016
a7d2d31
Fixed compiler warnings in filel.c
brian-m-rapp Aug 14, 2016
2d97859
Additional changes for header stripping in pqact.
Aug 15, 2016
e3f653d
Added debug message to filel.c.
Aug 15, 2016
970120b
Added additional boundary check to getWmoOffset and restricted WMO
brian-m-rapp Aug 15, 2016
da37f36
Cleanup to skipWMO.
brian-m-rapp Aug 15, 2016
91a08f6
Revised placement of skipWMO to allow ftruncate to properly size files.
Aug 16, 2016
bbf6151
Replaced numeric values with named constants in skipWMO().
brian-m-rapp Aug 17, 2016
210b6e7
Additional comments in filel.c
Aug 18, 2016
80d49e3
Added check in stripHeaders() for small product size.
brian-m-rapp Aug 19, 2016
7b00312
Fix uninitialized variable in pipe_prodput.
brian-m-rapp Aug 23, 2016
a0bb98e
Merge remote-tracking branch 'upstream/master'
Aug 23, 2016
fb507a2
Merge branch 'pqact_strip_wmo'
brian-m-rapp Aug 23, 2016
f7c6474
Fixed bad function prototype in productMaker.c
brian-m-rapp Aug 23, 2016
832f830
Fixed Coverity-reported bug in productMaker.c
brian-m-rapp Aug 23, 2016
28fdde3
Removed #define RETRANS_SUPPORT from line 6 of productMaker.c.
brian-m-rapp Sep 13, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = --enable-debug \
--disable-root-actions \
--with-noaaport \
--with-retrans \
--with-ingester \
--with-gribinsert \
LDMHOME=`cd ../_inst && pwd`
# @DISTCHECK_CONFIGURE_FLAGS_WITH_MULTICAST@
Expand Down Expand Up @@ -65,6 +66,9 @@ SUBDIRS += lib
if WANT_NOAAPORT
SUBDIRS += noaaport
endif
if WANT_INGESTER
SUBDIRS += fileIngest
endif
SUBDIRS += regutil \
feedme \
hupsyslog \
Expand Down Expand Up @@ -196,6 +200,10 @@ install_setuids:
chown root $(DESTDIR)$(bindir)/noaaportIngester; \
chmod 4755 $(DESTDIR)$(bindir)/noaaportIngester; \
fi
-if test -f $(DESTDIR)$(bindir)/fileIngester; then \
chown root $(DESTDIR)$(bindir)/fileIngester; \
chmod 4755 $(DESTDIR)$(bindir)/fileIngester; \
fi
-if test -f $(DESTDIR)$(bindir)/dvbs_multicast; then \
chown root $(DESTDIR)$(bindir)/dvbs_multicast; \
chmod 4755 $(DESTDIR)$(bindir)/dvbs_multicast; \
Expand All @@ -211,8 +219,8 @@ install_setuids:
echo " \
ERROR: One or more of the following programs in the \"bin/\" installation \
directory is not owned by \"root\" or does not have the setuid bit enabled: \
ldmd, hupsyslog, noaaportIngester, dvbs_multicast. The superuser will have to \
set these attributes manually."; \
ldmd, hupsyslog, noaaportIngester, fileIngester, dvbs_multicast. The superuser \
will have to set these attributes manually."; \
echo; \
exit 1; \
fi
Expand Down
18 changes: 18 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ AC_ARG_WITH([noaaport],
[with_noaaport=no])
AM_CONDITIONAL([WANT_NOAAPORT], [test "x$with_noaaport" != xno])

AC_ARG_WITH([ingester],
AS_HELP_STRING([--with-ingester],
[enable support for ingesting files into product queue
[default=without]]),
[],
[with_ingester=no])
AM_CONDITIONAL([WANT_INGESTER], [test "x$with_ingester" != xno])

AC_ARG_WITH([retrans],
AS_HELP_STRING([--with-retrans],
[enable support for retransmission from a NOAAPORT receiver
Expand Down Expand Up @@ -625,6 +633,15 @@ AM_COND_IF([WANT_NOAAPORT], [
[AC_MSG_ERROR([Library not found])])
])

AM_COND_IF([WANT_INGESTER],[
AC_SEARCH_LIBS([clock_gettime], [rt],,[AC_MSG_ERROR([Could not find required function clock_gettime],[1])])
AC_SEARCH_LIBS([timer_create], [rt],,[AC_MSG_ERROR([Could not find required function timer_create],[1])])
AC_SEARCH_LIBS([timer_settime], [rt],,[AC_MSG_ERROR([Could not find required function timer_settime],[1])])
libs=$LIBS
])



# Ensure references to the XML2 package, which is used by the LDM registry
# module.
AC_CHECK_HEADER([libxml/parser.h], ,
Expand Down Expand Up @@ -665,6 +682,7 @@ AC_PROG_LIBTOOL
AC_CONFIG_FILES([
fauxPq/Makefile
feedme/Makefile
fileIngest/Makefile
gempak/Makefile
gempak/tables/Makefile
grib2/Makefile
Expand Down
10 changes: 10 additions & 0 deletions fileIngest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/test
/fileIngester
/test.c
/log_tester
/Makefile.in
/stdclib.h
/mlogger.h
/datelib.h
/goesr_lib.h

141 changes: 141 additions & 0 deletions fileIngest/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Copyright 2011 University Corporation for Atmospheric Research
#
# This file is part of the Unidata LDM package. See the file COPYRIGHT in the
# top-level source-directory of the package for copying and redistribution
# conditions.
#
## Process this file with automake(1) to produce file Makefile.in

################################################################################

LDMHOME = @LDMHOME@
LDMSRC = $(top_srcdir)
SUDO = @SUDO@
SU = @SU@

CLEANFILES = $(BUILT_SOURCES)

CPPFLAGS = \
-DLDM_SUPPORT \
-I$(top_srcdir) \
-I$(top_srcdir)/noaaport \
-I$(top_srcdir)/protocol \
-I$(top_srcdir)/protocol2 \
-I$(top_srcdir)/pq \
-I$(top_srcdir)/ulog \
-I$(top_srcdir)/log \
-I$(top_srcdir)/misc \
-I$(top_srcdir)/registry \
@CPPFLAGS@

bin_PROGRAMS = fileIngester

EXTRA_DIST = \
datelib.hin \
stdclib.hin \
goesr_lib.hin \
mlogger.hin

BUILT_SOURCES = \
datelib.h \
stdclib.h \
goesr_lib.h \
mlogger.h

COMMON_SOURCES = \
stdclib.c stdclib.h \
goesr_lib.c goesr_lib.h \
mlogger.c mlogger.h \
datelib.c datelib.h \
ldmProductQueue.c ldmProductQueue.h

fileIngester_SOURCES = fileIngester.c $(COMMON_SOURCES)

LDADD = $(top_builddir)/lib/libldm.la

TAGS_FILES = \
*.c *.h

.c.i:
$(COMPILE) -E $< >$@

.hin.h:
./extractDecls $*.hin $*.c >[email protected]
mv -f [email protected] $@

#installcheck-local:
# pqcreate -c -s 2m /tmp/readnoaaport-test.pq
# $(DESTDIR)$(bindir)/readnoaaport -l- -q /tmp/readnoaaport-test.pq \
# $(srcdir)/nwstgdump.data
# rm /tmp/readnoaaport-test.pq

#check-local: check-readnoaaport
#check-readnoaaport: readnoaaport
# pqcreate -c -s 2m /tmp/readnoaaport-test.pq
# ./readnoaaport -nl- -q /tmp/readnoaaport-test.pq \
# $(srcdir)/nwstgdump.data
# rm /tmp/readnoaaport-test.pq

#root-ni-ck:
# ./noaaportIngester -b 3 -q /tmp/noaaportIngester-test.pq \
# <$(srcdir)/nwstgdump.data

#valgrind: valgrind-readnoaaport

#valgrind-readnoaaport: readnoaaport
# pqcreate -c -s 2m /tmp/readnoaaport-test.pq
# $(LIBTOOL) --mode=execute valgrind --leak-check=yes \
# readnoaaport -l- -q /tmp/readnoaaport-test.pq nwstgdump.data
# rm /tmp/readnoaaport-test.pq

sudo:
if HAVE_SUDO
$(SUDO) $(MAKE) $(AM_MAKEFLAGS) $(TARGET) 2>/dev/tty
else
if HAVE_SU
@printf "Enter root's password (or don't): " >/dev/tty
@$(SU) root -c 'PATH='$$PATH' $(MAKE) $(AM_MAKEFLAGS) $(TARGET)' \
</dev/tty 2>/dev/tty
@echo >/dev/tty
endif
endif

#valgrind-noaaportIngester: noaaportIngester
# pqcreate -c -s 2m /tmp/noaaportIngester-test.pq
# $(MAKE) $(AM_MAKEFLAGS) sudo TARGET=root-ni-vg
# rm /tmp/noaaportIngester-test.pq

#root-ni-vg:
# $(LIBTOOL) --mode=execute valgrind --leak-check=yes \
# noaaportIngester -n -q /tmp/noaaportIngester-test.pq \
# <$(srcdir)/nwstgdump.data

#debug-readnoaaport: readnoaaport
# pqcreate -c -s 2m /tmp/readnoaaport-test.pq
# echo 'handle SIGCONT pass noprint nostop' >/tmp/readnoaaport.gdb
# echo 'b 617' >>/tmp/readnoaaport.gdb
# echo 'run -l- -q /tmp/readnoaaport-test.pq nwstgdump.data' \
# >>/tmp/readnoaaport.gdb
# $(LIBTOOL) --mode=execute gdb -x /tmp/readnoaaport.gdb readnoaaport
# rm /tmp/readnoaaport-test.pq /tmp/readnoaaport.gdb

#debug-noaaportIngester: noaaportIngester
# pqcreate -c -s 2m /tmp/noaaportIngester-test.pq
# echo 'handle SIGCONT pass noprint nostop' >/tmp/noaaportIngester.gdb
# echo 'handle SIGTERM pass nostop' >>/tmp/noaaportIngester.gdb
# echo 'run -q /tmp/noaaportIngester-test.pq -n -m 224.0.1.1' \
# >>/tmp/noaaportIngester.gdb
# $(MAKE) $(AM_MAKEFLAGS) sudo TARGET=root-ni-db
# rm /tmp/noaaportIngester-test.pq /tmp/noaaportIngester.gdb

#root-ni-db:
# $(LIBTOOL) --mode=execute gdb -x /tmp/noaaportIngester.gdb \
# noaaportIngester

.PHONY: \
sudo
# install-html \
# root-ni-ck \
# root-ni-db \
# root-ni-vg \
# sudo
38 changes: 38 additions & 0 deletions fileIngest/Makefile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

COPTS = -g -Wall

BUILT_HEADERS = datelib.h goesr_lib.h mlogger.h stdclib.h
BUILT_PROGS = fileIngester test read_acq_pipe log_tester
INGEST_OBJS = fileIngester.o stdclib.o goesr_lib.o mlogger.o

all :: fileIngester test log_tester read_acq_pipe

clean ::
rm -f $(INGEST_OBJS) $(BUILT_PROGS) read_acq_pipe.o log_tester.o

%.h : %.hin %.c extractDecls
./extractDecls $*.hin $*.c > $@

%.o : %.c
cc $(COPTS) -o $@ -c $<

goesr_lib.o : stdclib.h mlogger.h goesr_lib.h
stdclib.o : stdclib.h
fileIngester.o : stdclib.h mlogger.h goesr_lib.h
log_tester.o : stdclib.h mlogger.h

fileIngester : $(INGEST_OBJS)
cc -g -lrt -o $@ $^

read_acq_pipe : read_acq_pipe.o stdclib.o
cc -g -lrt -o $@ $^

acq_ftp_send : $(INGEST_OBJS)
cc -g -lrt -o $@ $^

test : test.o
cc -g -o $@ $^

log_tester : log_tester.o mlogger.o stdclib.o
cc -g -lrt -o $@ $^

Loading