local event = require("event") -- the init signal is fired by the boot process, means the system is ready event.listen("init", function() local thread = require("thread") thread.create(function() --[[ your custom service code as a background thread ]]-- end):detach() end)