diff --git a/postgresql-controller.lua b/postgresql-controller.lua index 91ce5f8e3defdd8f171ca88f6a894fd1ba08d3e5..e7c6d137e1009b6b0d4ff1f48d13daf9220df715 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 5efa635f81ff9cacba40e01ef29b00644e0c253e..dc73d9067e4ad66299e4fa55a83ff147a9383c14 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