summaryrefslogtreecommitdiffstats
path: root/postfix-model.lua
diff options
context:
space:
mode:
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()