lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Announcing the beta release of sema, a Lua-scripted SErvice MAnager.

Sema is similar to projects like sysvinit, systemd, upstart, and
daemontools. Like systemd and upstart, it centralizes daemon supervision
under a central server that can take complex, user-defined commands;
like sysvinit and daemontools, it tries to keep its methods of operation
as transparent as possible.

Particularly like daemontools, each service has its execution managed by
a run script. SSHD's script looks like:

> #!/usr/bin/env sema
> -- The above shabang line is useful if you mark your control scripts
> executable
>
> -- define a custom command
> function command.reloadConfig()
>     signal(nil, SIGHUP)
> end
>
> while true do
>     runIfUp{"/usr/sbin/sshd", "-D"}
> end

And getty spawning can look like:

> function tty(num) parallel(function()
>     while true do
>         runIfUp {"/sbin/agetty", "-8", "-s", "38400", num, "linux"}
>     end
> end) end
>
> tty "tty1"
> tty "tty2"
> tty "tty3"
> tty "tty4"
> tty "tty5"
> tty "tty6"
>
> waitEvent "quit"

Sema's source and some documentation can be found at
https://github.com/Tangent128/sema/tree/beta ; it was developed on
Linux, but any reports on success or failure at compiling for similar
systems would be appreciated.

~Joseph "Tangent" Wallace