Skip to content
Snippets Groups Projects
Commit 7f095416 authored by Alexander Mueller's avatar Alexander Mueller
Browse files

BugID: 163

All .conf and .log_prop files will be installed in sysconf_DATA (which means 'etc' beside of the 'bin' directory).
The GCFTask::init method sets this 'etc' as default path for all *.conf files, which will be adopted to the same (singleton) instance of the ParameterSet.
parent 0d116795
No related branches found
No related tags found
No related merge requests found
Showing
with 105 additions and 93 deletions
......@@ -32,8 +32,7 @@ VirtualBackend_CPPFLAGS = \
-fdiagnostics-show-location=once \
-DUSE_TCPPORT_INSTEADOF_PVSSPORT
configfilesdir=$(bindir)
configfiles_DATA= \
sysconf_DATA= \
VirtualBackend.conf \
CEPAppDefault.param
......
......@@ -32,11 +32,9 @@ MACInformationServer_CPPFLAGS =
BUILT_SOURCES = \
MIS_Protocol.ph
EXTRA_DIST = \
MIS_Protocol.ph
EXTRA_DIST = $(BUILT_SOURCES)
configfilesdir=$(bindir)
configfiles_DATA= \
sysconf_DATA= \
MACInformationServer.conf
%.conf: %.conf.in
......
......@@ -47,11 +47,9 @@ NodeManager_CPPFLAGS =
BUILT_SOURCES = \
NM_Protocol.ph
EXTRA_DIST = \
NM_Protocol.ph
EXTRA_DIST = $(BUILT_SOURCES)
configfilesdir=$(bindir)
configfiles_DATA= \
sysconf_DATA= \
NodeManager.conf
%.conf: %.conf.in
......
......@@ -25,8 +25,11 @@ CodeLoggingProcessor_DEPENDENCIES = libclp.la $(LOFAR_DEPEND) \
CodeLoggingProcessor_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"CLP\" \
-I$(top_srcdir)/include
configfilesdir=$(bindir)
configfiles_DATA= \
BUILT_SOURCES =
EXTRA_DIST = $(BUILT_SOURCES)
sysconf_DATA= \
CodeLoggingProcessor.conf \
CodeLoggingProcessor.log_prop
......
......@@ -60,11 +60,9 @@ KeyValueLoggerMaster_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"KVLM\"
BUILT_SOURCES = \
KVL_Protocol.ph
EXTRA_DIST = \
KVL_Protocol.ph
EXTRA_DIST = $(BUILT_SOURCES)
configfilesdir=$(bindir)
configfiles_DATA= \
sysconf_DATA= \
KeyValueLoggerDaemon.conf \
KeyValueLoggerMaster.conf \
KeyValueLoggerDaemon.log_prop \
......
......@@ -71,16 +71,33 @@ void GCFTask::init(int argc, char** argv)
_argc = argc;
_argv = argv;
string appName(argv[0]);
string procName(argv[0]);
ifstream logPropFile;
// Try to open the log_prop file
string logPropFileName = appName + ".log_prop";
// Construct the etc path for config files
string etcPath(procName);
// Find last '/'
string::size_type pos = etcPath.rfind('/');
if (pos == string::npos) pos = 0; // not found: so erase whole filename
else pos++; // found : increase pos to avoid erasing the '/' too
if (pos == 0 || pos == 1) etcPath = "/etc/"; // no '/' or only one '/' (at the 0 position)
else
{
etcPath.erase(pos);
etcPath += "../etc/"; // becomes e.g. /opt/lofar/bin/../etc/
}
procName.erase(0, pos); // erase path
// Try to open the log_prop file, if process has its own log_prop file then use it in
// the INIT_LOGGER otherwise use the default mac.log_prop
string logPropFileName = etcPath + procName + ".log_prop";
logPropFile.open(logPropFileName.c_str(), ifstream::in);
if (!logPropFile)
{
logPropFileName = "./mac.log_prop";
logPropFileName = etcPath + "mac.log_prop";
}
else
{
......@@ -90,7 +107,8 @@ void GCFTask::init(int argc, char** argv)
INIT_LOGGER(logPropFileName.c_str());
ParameterSet* pParamSet = ParameterSet::instance();
pParamSet->adoptFile(appName + ".conf");
pParamSet->setSearchPath(etcPath);
pParamSet->adoptFile(procName + ".conf");
if (_doExit)
exit(-1);
......
......@@ -62,14 +62,14 @@ libgcftm_la_CPPFLAGS=-I$(top_srcdir)/include \
libgcftm_la_CXXFLAGS=-fmessage-length=0
BUILT_SOURCES = \
SB_Protocol.ph \
mac.log_prop
BUILT_SOURCES = \
SB_Protocol.ph
EXTRA_DIST = \
SB_Protocol.ph \
mac.log_prop
EXTRA_DIST = $(BUILT_SOURCES)
sysconf_DATA = \
mac.log_prop
%.log_prop: %.log_prop.in
cp $< $@
......
......@@ -22,19 +22,16 @@ ServiceBroker_DEPENDENCIES = libsb.la $(LOFAR_DEPEND) \
ServiceBroker_CPPFLAGS= -I$(top_srcdir)/include
ServiceBroker_CXXFLAGS=-fmessage-length=0
BUILT_SOURCES = \
ServiceBroker.conf
BUILT_SOURCES =
EXTRA_DIST = \
ServiceBroker.conf
EXTRA_DIST = $(BUILT_SOURCES)
configfilesdir=$(bindir)
configfiles_DATA= \
sysconf_DATA= \
ServiceBroker.conf
install-data-local:
echo "mac.gcf.sb.host=`hostname -s`" >> $(bindir)/ServiceBroker.conf
echo "mac.gcf.sb.range1.host=`hostname`" >> $(bindir)/ServiceBroker.conf
echo "mac.gcf.sb.host=`hostname -s`" >> $(sysconfdir)/ServiceBroker.conf
echo "mac.gcf.sb.range1.host=`hostname`" >> $(sysconfdir)/ServiceBroker.conf
%.conf: gcf-sb.conf.in
cp $< $@
......
check_PROGRAMS = echoapp ping
bin_PROGRAMS = tmEcho tmPing
TESTS = #echoapp ping
tmEcho_SOURCES = Echo.cc Echo_Protocol.cc
tmEcho_LDADD = ../src/libgcftm.la
tmEcho_DEPENDENCIES = ../src/libgcftm.la $(LOFAR_DEPEND)
tmEcho_CPPFLAGS=-I$(top_srcdir)/include
echoapp_SOURCES = Echo.cc Echo_Protocol.cc
echoapp_LDADD = ../src/libgcftm.la
echoapp_DEPENDENCIES = ../src/libgcftm.la $(LOFAR_DEPEND)
echoapp_CPPFLAGS=-I$(top_srcdir)/include
ping_SOURCES = Ping.cc Echo_Protocol.cc
ping_LDADD = ../src/libgcftm.la
ping_DEPENDENCIES = ../src/libgcftm.la $(LOFAR_DEPEND)
ping_CPPFLAGS=-I$(top_srcdir)/include
tmPing_SOURCES = Ping.cc Echo_Protocol.cc
tmPing_LDADD = ../src/libgcftm.la
tmPing_DEPENDENCIES = ../src/libgcftm.la $(LOFAR_DEPEND)
tmPing_CPPFLAGS=-I$(top_srcdir)/include
AUTOGEN = autogen
SUFFIXES = .ph
......@@ -18,23 +16,18 @@ SUFFIXES = .ph
$(AUTOGEN) --writable -L $(top_srcdir)/autogen $<
BUILT_SOURCES = \
Echo_Protocol.ph \
echoapp.conf \
ping.conf \
ServiceBroker.conf
Echo_Protocol.ph
EXTRA_DIST = \
Echo_Protocol.ph \
echoapp.conf \
ping.conf \
ServiceBroker.conf
Echo_Protocol.ph
sysconf_DATA=\
tmEcho.conf \
tmPing.conf
%.conf: tm-test.conf.in
ln -sf $< $@
ServiceBroker.conf: $(bindir)/ServiceBroker.conf
cp $< $@
clean-local:
rm -f *.ph
......
......@@ -34,7 +34,13 @@ AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PA\"
configfilesdir=$(bindir)
configfiles_DATA= \
loadAPC \
preparePVSS-DB \
preparePVSS-DB
BUILT_SOURCES =
EXTRA_DIST = $(BUILT_SOURCES)
sysconf_DATA= \
PropertyAgent.conf
install-data-local:
......
......@@ -36,8 +36,11 @@ PropertyInterface_DEPENDENCIES = libpi.la \
AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PI\"
configfilesdir=$(bindir)
configfiles_DATA= \
BUILT_SOURCES =
EXTRA_DIST = $(BUILT_SOURCES)
sysconf_DATA= \
PropertyInterface.conf
%.conf: gcf-pi.conf.in
......
......@@ -43,8 +43,11 @@ libpml_la_CPPFLAGS= -I$(top_srcdir)/include \
AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PML\"
configfilesdir=$(bindir)
configfiles_DATA= \
BUILT_SOURCES =
EXTRA_DIST = $(BUILT_SOURCES)
sysconf_DATA= \
gcf-pml.conf
%.conf: %.conf.in
......
cppflags = -I$(top_srcdir)/SAL/src \
-I$(top_srcdir)/include
check_PROGRAMS = echoapp ping
check_PROGRAMS = salEcho salPing
TESTS = #echoapp ping
TESTS = #salEcho salPing
echoapp_SOURCES = Echo.cc Service.cc Echo_Protocol.cc
echoapp_LDADD = ../src/libsal.la $(LOFAR_DEPEND)
echoapp_DEPENDENCIES = ../src/libsal.la $(LOFAR_DEPEND)
echoapp_CPPFLAGS = $(cppflags)
salEcho_SOURCES = Echo.cc Service.cc Echo_Protocol.cc
salEcho_LDADD = ../src/libsal.la $(LOFAR_DEPEND)
salEcho_DEPENDENCIES = ../src/libsal.la $(LOFAR_DEPEND)
salEcho_CPPFLAGS = $(cppflags)
ping_SOURCES = Ping.cc Echo_Protocol.cc
ping_LDADD = ../src/libsal.la $(LOFAR_DEPEND)
ping_DEPENDENCIES = ../src/libsal.la $(LOFAR_DEPEND)
ping_CPPFLAGS= $(cppflags)
salPing_SOURCES = Ping.cc Echo_Protocol.cc
salPing_LDADD = ../src/libsal.la $(LOFAR_DEPEND)
salPing_DEPENDENCIES = ../src/libsal.la $(LOFAR_DEPEND)
salPing_CPPFLAGS= $(cppflags)
AUTOGEN = autogen
SUFFIXES = .ph
......@@ -21,22 +21,17 @@ SUFFIXES = .ph
$(AUTOGEN) --writable -L $(datadir)/GCF/TM $<
BUILT_SOURCES = \
Echo_Protocol.ph \
echoapp.conf \
ping.conf \
ServiceBroker.conf
Echo_Protocol.ph
EXTRA_DIST = \
Echo_Protocol.ph \
echoapp.conf \
ping.conf
EXTRA_DIST = $(BUILT_SOURCES)
sysconf_DATA= \
salEcho.conf \
salPing.conf
%.conf: sal-test.conf.in
ln -sf $< $@
ServiceBroker.conf: $(bindir)/ServiceBroker.conf
cp $< $@
clean-local:
rm -f *.ph
......
......@@ -27,9 +27,11 @@ libgcfpallight_la_DEPENDENCIES= libpmllight.la $(LOFAR_DEPEND)
AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"RTC\"
sysconf_DATA= \
gcf-pmllight.conf
configfilesdir=$(bindir)
configfiles_DATA= \
gcf-pmllight.conf \
genTypeInfo
%.conf: %.conf.in
......
......@@ -34,18 +34,19 @@ Application3_DEPENDENCIES = libgcftest.la $(LOFAR_DEPEND)
BUILT_SOURCES = \
TST_Protocol.ph
EXTRA_DIST = \
TST_Protocol.ph
EXTRA_DIST = $(BUILT_SOURCES)
AM_CXXFLAGS=-fmessage-length=0
#in case of make install these files will be copied to the bindir beside the test apps
configfilesdir=$(bindir)
configfiles_DATA= \
customPrepPVSSDB.ctl
sysconf_DATA= \
Application1.conf \
Application2.conf \
Application3.conf \
customPrepPVSSDB.ctl
Application3.conf
%.conf: gcf-test.conf.in
cp $< $@
......
......@@ -26,14 +26,12 @@ RTPing_DEPENDENCIES = librtc.la $(LOFAR_DEPEND)
BUILT_SOURCES = \
Echo_Protocol.ph
EXTRA_DIST = \
Echo_Protocol.ph
EXTRA_DIST = $(BUILT_SOURCES)
AM_CXXFLAGS=-fmessage-length=0
#in case of make install these files will be copied to the bindir beside the test apps
configfilesdir=$(bindir)
configfiles_DATA= \
sysconf_DATA= \
RTEcho.conf \
RTPing.conf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment