summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--postgresql-controller.lua5
-rw-r--r--postgresql-model.lua5
2 files changed, 10 insertions, 0 deletions
diff --git a/postgresql-controller.lua b/postgresql-controller.lua
index 91ce5f8..e7c6d13 100644
--- a/postgresql-controller.lua
+++ b/postgresql-controller.lua
@@ -3,6 +3,11 @@ module(..., package.seeall)
-- Load libraries
require("controllerfunctions")
+mvc = {}
+mvc.on_load = function(self, parent)
+ self.model.set_processname(string.match(self.conf.prefix, "[^/]+"))
+end
+
default_action = "status"
function status(self)
diff --git a/postgresql-model.lua b/postgresql-model.lua
index 5efa635..dc73d90 100644
--- a/postgresql-model.lua
+++ b/postgresql-model.lua
@@ -15,6 +15,11 @@ local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
local datadirectory
local filelist
+function set_processname(p)
+ processname = p
+ confdfile = "/etc/conf.d/"..processname
+end
+
-- ################################################################################
-- LOCAL FUNCTIONS