summaryrefslogtreecommitdiffstats
path: root/postgresql-model.lua
diff options
context:
space:
mode:
authorroot <root@trask19.(none)>2009-06-04 16:03:33 +0000
committerroot <root@trask19.(none)>2009-06-04 16:03:33 +0000
commitbfe1568cf01ccaf7ce18702263835313e39d111c (patch)
treefe3573ddff94103350f4166cbaf4506e090a7dbf /postgresql-model.lua
parente5a0bba3ff581e9b6c0bb964f267a6d8367d0b16 (diff)
downloadacf-postgresql-bfe1568cf01ccaf7ce18702263835313e39d111c.tar.bz2
acf-postgresql-bfe1568cf01ccaf7ce18702263835313e39d111c.tar.xz
Updated for startstop in core 0.5.0
Diffstat (limited to 'postgresql-model.lua')
-rw-r--r--postgresql-model.lua21
1 files changed, 2 insertions, 19 deletions
diff --git a/postgresql-model.lua b/postgresql-model.lua
index 2479796..90aa30c 100644
--- a/postgresql-model.lua
+++ b/postgresql-model.lua
@@ -22,28 +22,11 @@ local filelist = fs.find_files_as_array(".*\.conf", datadirectory)
-- PUBLIC FUNCTIONS
function startstop_service(action)
- return modelfunctions.startstop_service(processname, action, {"start", "stop", "restart", "setup"})
+ return modelfunctions.startstop_service(processname, action, {"Setup", "Start", "Stop", "Restart"})
end
function getstatus()
- local status = modelfunctions.getstatus(processname, packagename, "Postgresql Status")
-
- -- Enabled status is unique for postgresql
- -- Look for pid file stored in data_directory .. /postmaster.pid
- local file = datadirectory .. pidfile
- -- 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
- filetime = posix.stat(file, "ctime")
- dirtime = posix.stat(dir, "ctime")
- if dirtime and (tonumber(dirtime) - tonumber(filetime) < 100) then
- status.value.status.value = "Running"
- end
- end
-
- return status
+ return modelfunctions.getstatus(processname, packagename, "Postgresql Status")
end
function getstatusdetails()