diff options
author | root <root@trask19.(none)> | 2009-06-04 16:02:21 +0000 |
---|---|---|
committer | root <root@trask19.(none)> | 2009-06-04 16:02:21 +0000 |
commit | fa9fd27d3c09519aca6a3ad35f17008d211f24b1 (patch) | |
tree | fb6db6e37d91b954489fcafea78fd40f0dfbb0da | |
parent | eb4c1b95e17e9e5bbde6cd057e6bd91355ad993b (diff) | |
download | acf-postfix-fa9fd27d3c09519aca6a3ad35f17008d211f24b1.tar.bz2 acf-postfix-fa9fd27d3c09519aca6a3ad35f17008d211f24b1.tar.xz |
Updated for startstop in core 0.5.0
-rw-r--r-- | postfix-controller.lua | 2 | ||||
-rw-r--r-- | postfix-model.lua | 30 |
2 files changed, 3 insertions, 29 deletions
diff --git a/postfix-controller.lua b/postfix-controller.lua index 0967ddd..4ea0f76 100644 --- a/postfix-controller.lua +++ b/postfix-controller.lua @@ -10,7 +10,7 @@ function status(self) end function startstop(self) - return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.model.getstatus, self.clientdata) + return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata) end function details(self) diff --git a/postfix-model.lua b/postfix-model.lua index 8dd92c6..639ede1 100644 --- a/postfix-model.lua +++ b/postfix-model.lua @@ -37,37 +37,11 @@ end -- PUBLIC FUNCTIONS function startstop_service(action) - return modelfunctions.startstop_service(processname, action, {"start", "stop", "restart", "reload"}) + return modelfunctions.startstop_service(processname, action, {"Start", "Stop", "Restart", "Reload"}) end function getstatus() - local status = modelfunctions.getstatus(processname, packagename, "Postfix Status") - - -- Enabled status is unique for postfix - -- Look for pid file stored in queue_directory .. /pid/ - local config = getconfig() - if config.queue_directory then - local pidfiles = fs.find_files_as_array(".*\.pid", config.queue_directory.."/pid/") - if pidfiles and pidfiles[1] then - local file = pidfiles[1] - -- check to see if there's a matching proc directory and that it was created slightly after the pid file - -- this allows us to avoid the problem with proc numbers wrapping - local tmp = string.match(fs.read_file(file) or "", "%d+") - if tmp then - local dir = "/proc/" .. tmp - -- postfix seems to have a problem with changing times? - --[[ filetime = posix.stat(file, "ctime") - dirtime = posix.stat(dir, "ctime") - if dirtime and (tonumber(dirtime) - tonumber(filetime) < 100) then - --]] - if posix.stat(dir.."/cmdline") and string.find(fs.read_file(dir.."/cmdline"), processname) then - status.value.status.value = "Running" - end - end - end - end - - return status + return modelfunctions.getstatus(processname, packagename, "Postfix Status") end function getstatusdetails() |