From 2e021ff6d5606f5ee85d8957dc98c4d4964b8f0f Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Fri, 4 Aug 2023 20:29:09 +1000 Subject: [PATCH] remove old rc.load implementation --- lib/rc.lua | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lib/rc.lua b/lib/rc.lua index b5ea311..191d0ec 100644 --- a/lib/rc.lua +++ b/lib/rc.lua @@ -5,7 +5,7 @@ rc.paths = "/boot/service\n/pkg/service" rc.pids = {} local service = {} local cfg = {} -cfg.enabled = {"getty","minitel"} +cfg.enabled = {"getty","minitel","fsmanager"} local function loadConfig() local f = io.open("/boot/cfg/rc.cfg","rb") @@ -37,26 +37,6 @@ function rc.load(name,force) -- string boolean -- table -- Attempts to load serv return false, "unable to load service "..name end ---[[ -function rc.load(name,force) -- string boolean -- table -- Attempts to load service *name*, and if *force* is true, replaces the current instance. - if force then - rc.stop(name) - service[name] = nil - end - if service[name] then return true end - service[name] = setmetatable({},{__index=_G}) - local f - f = io.open("/boot/service/"..name..".lua","rb") - if not f then - pcall(require,"pkgfs") - f = io.open("/pkg/service/"..name..".lua","rb") - end - local res = load(f:read("*a"),name,"t",service[name])() - f:close() - return res -end -]] - function rc.stop(name,...) -- string -- boolean string -- Stops service *name*, supplying *...* to the stop function. Returns false and a reason if this fails. if not service[name] then return false, "service not found" end if service[name].stop then