summaryrefslogtreecommitdiffstats
path: root/lib/modelfunctions.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-10-11 12:57:42 +0000
committerTed Trask <ttrask01@yahoo.com>2008-10-11 12:57:42 +0000
commit040350eced7897f52402c466d14378ca62cf00b1 (patch)
tree5e62bfed641d1ee9551a114b869cd419019a6796 /lib/modelfunctions.lua
parent5ff7837be35aab168c05a6efc0e5945e2f664b63 (diff)
downloadacf-core-040350eced7897f52402c466d14378ca62cf00b1.tar.bz2
acf-core-040350eced7897f52402c466d14378ca62cf00b1.tar.xz
Added rc controller to alpine-baselayout and rc functionality to processinfo library. Changed status Enabled/Disabled to Running/Stopped. Added links to status pages to install package and schedule autostart.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1552 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/modelfunctions.lua')
-rw-r--r--lib/modelfunctions.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/modelfunctions.lua b/lib/modelfunctions.lua
index 1448588..d94db78 100644
--- a/lib/modelfunctions.lua
+++ b/lib/modelfunctions.lua
@@ -6,23 +6,23 @@ require("format")
require("processinfo")
function getenabled(processname)
- local result = cfe({ label = "Program status" })
+ local result = cfe({ label = "Program status", name=processname })
local t = processinfo.pidof(processname)
if (t) and (#t > 0) then
- result.value = "Enabled"
+ result.value = "Running"
else
- result.value = "Disabled"
+ result.value = "Stopped"
end
return result
end
-function startstop_service(initname, action)
+function startstop_service(servicename, action)
-- action is validated in daemoncontrol
- local cmdmessage,cmderror = processinfo.daemoncontrol(initname, action)
+ local cmdmessage,cmderror = processinfo.daemoncontrol(servicename, action)
return cfe({ value=cmdmessage or "", errtxt=cmderror, label="Start/Stop result" })
end
-function getstatus(processname, packagename, label, initname)
+function getstatus(processname, packagename, label, servicename)
local status = {}
local value, errtxt = processinfo.package_version(packagename)
@@ -30,15 +30,17 @@ function getstatus(processname, packagename, label, initname)
label="Program version",
value=value,
errtxt=errtxt,
+ name=packagename
})
status.status = getenabled(processname)
- local autostart_sequence, autostart_errtxt = processinfo.process_botsequence(initname or processname)
+ local autostart_sequence, autostart_errtxt = processinfo.process_startupsequence(servicename or processname)
status.autostart = cfe({
label="Autostart sequence",
value=autostart_sequence,
errtxt=autostart_errtxt,
+ name=servicename or processname
})
return cfe({ type="group", value=status, label=label })