summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile5
-rwxr-xr-xsrc/nopcollectd2
-rw-r--r--src/nopsyncd.c2
-rwxr-xr-xsrc/nopsysstated2
-rw-r--r--src/qlistener.lua2
-rw-r--r--src/tcpserver.lua2
6 files changed, 8 insertions, 7 deletions
diff --git a/src/Makefile b/src/Makefile
index d9d7506..5dce506 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -76,10 +76,10 @@ install-bin: $(EXECUTABLE)
$(INSTALL) -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 755 noprml $(DESTDIR)$(BINDIR)
$(INSTALL) -m 755 nopcollectd $(DESTDIR)$(BINDIR)
- $(SED) -e 's#^conffile = "nopcollectd#conffile = "$(ETCDIR)/rhnop/nopcollectd#' -i $(DESTDIR)$(BINDIR)/nopcollectd
+ $(SED) -e 's#_rhnopescdir_#$(ETCDIR)/rhnop#' -i $(DESTDIR)$(BINDIR)/nopcollectd
$(SED) -e 's#_rhnoplibdir_/?.lua#$(DATAROOTDIR)/rhnop/?.lua#' -i $(DESTDIR)$(BINDIR)/nopcollectd
$(INSTALL) -m 755 nopsysstated $(DESTDIR)$(BINDIR)
- $(SED) -e 's#^conffile = "nopsysstated#conffile = "$(ETCDIR)/rhnop/nopsysstated#' -i $(DESTDIR)$(BINDIR)/nopsysstated
+ $(SED) -e 's#_rhnopescdir_#$(ETCDIR)/rhnop#' -i $(DESTDIR)$(BINDIR)/nopsysstated
$(SED) -e 's#_rhnoplibdir_/?.lua#$(DATAROOTDIR)/rhnop/?.lua#' -i $(DESTDIR)$(BINDIR)/nopsysstated
install-lib:
@@ -89,7 +89,6 @@ install-lib:
$(INSTALL) -m 644 playlog.lua $(DESTDIR)$(DATAROOTDIR)/rhnop
$(INSTALL) -m 644 rddb.lua $(DESTDIR)$(DATAROOTDIR)/rhnop
$(INSTALL) -m 644 qlistener.lua $(DESTDIR)$(DATAROOTDIR)/rhnop
- $(SED) -e 's#^conffile = "nopsyncd#conffile = "$(ETCDIR)/rhnop/nopsyncd#' -i $(DESTDIR)$(DATAROOTDIR)/rhnop/qlistener.lua
$(INSTALL) -m 644 tcpserver.lua $(DESTDIR)$(DATAROOTDIR)/rhnop
install-etc:
diff --git a/src/nopcollectd b/src/nopcollectd
index 933fb81..d2d635c 100755
--- a/src/nopcollectd
+++ b/src/nopcollectd
@@ -36,7 +36,7 @@ if #arg < 1 then
os.exit(1)
end
-local cnf = conf.load("nopcollectd." .. arg[1] .. ".conf")
+local cnf = conf.load("_rhnopescdir_/nopcollectd." .. arg[1] .. ".conf")
src_db = assert(db.init(cnf.src_db, cnf.src_user, cnf.src_pwd, cnf.src_host, cnf.src_port, cnf.src_table))
dst_db = assert(db.init(cnf.dst_db, cnf.dst_user, cnf.dst_pwd, cnf.dst_host, cnf.dst_port, cnf.dst_table))
diff --git a/src/nopsyncd.c b/src/nopsyncd.c
index f3fcc22..3479ad5 100644
--- a/src/nopsyncd.c
+++ b/src/nopsyncd.c
@@ -94,6 +94,8 @@ int init_main_loop(lua_State *L, const char* filename)
lua_pushstring(L, DATAROOTDIR);
lua_setglobal(L, "rhnoplibdir");
+ lua_pushstring(L, ETCDIR);
+ lua_setglobal(L, "rhnopescdir");
ret = lua_pcall(L, 0, 0, 0);
if(ret) {
diff --git a/src/nopsysstated b/src/nopsysstated
index dc43c99..36992f5 100755
--- a/src/nopsysstated
+++ b/src/nopsysstated
@@ -31,7 +31,7 @@ package.path = package.path .. ";_rhnoplibdir_/?.lua"
db = require "db"
conf = require "conf"
-local cnf = conf.load("nopsysstated.conf")
+local cnf = conf.load("_rhnopescdir_/nopsysstated.conf")
db = assert(db.init(cnf.db_db, cnf.db_user, cnf.db_pwd, cnf.db_host, cnf.db_port, cnf.db_table))
diff --git a/src/qlistener.lua b/src/qlistener.lua
index e111ac7..044f635 100644
--- a/src/qlistener.lua
+++ b/src/qlistener.lua
@@ -75,7 +75,7 @@ function handle_message(msg)
end
function main_loop()
- init("nopsyncd.conf")
+ init(rhnopescdir .. "nopsyncd.conf")
posix.umask("rwxrwxr-x")
local q, err = mq.create(cnf.queue_name, "ro", "rw-rw----")
diff --git a/src/tcpserver.lua b/src/tcpserver.lua
index 8fa6d0b..34d01aa 100644
--- a/src/tcpserver.lua
+++ b/src/tcpserver.lua
@@ -27,7 +27,7 @@ conf = require "conf"
function init_server()
local server = assert(socket.tcp())
- cnf = conf.load("nopsyncd.conf")
+ cnf = conf.load(rhnopescdir .. "nopsyncd.conf")
assert(server:setoption('reuseaddr', true))
assert(server:bind(cnf.tcp_host, cnf.tcp_port))
assert(server:listen(5))