summaryrefslogtreecommitdiffstats
path: root/postfix-model.lua
diff options
context:
space:
mode:
authorroot <root@trask19.(none)>2009-06-04 16:02:21 +0000
committerroot <root@trask19.(none)>2009-06-04 16:02:21 +0000
commitfa9fd27d3c09519aca6a3ad35f17008d211f24b1 (patch)
treefb6db6e37d91b954489fcafea78fd40f0dfbb0da /postfix-model.lua
parenteb4c1b95e17e9e5bbde6cd057e6bd91355ad993b (diff)
downloadacf-postfix-fa9fd27d3c09519aca6a3ad35f17008d211f24b1.tar.bz2
acf-postfix-fa9fd27d3c09519aca6a3ad35f17008d211f24b1.tar.xz
Updated for startstop in core 0.5.0
Diffstat (limited to 'postfix-model.lua')
-rw-r--r--postfix-model.lua30
1 files changed, 2 insertions, 28 deletions
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()