[ANN] Sema (beta) - Lua-scripted Service Manager

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] Sema (beta) - Lua-scripted Service Manager

Tangent 128

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

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Sema (beta) - Lua-scripted Service Manager

Rena
On Sat, Aug 3, 2013 at 1:31 AM, Tangent 128 <[hidden email]> wrote:

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


Very interesting. When I look at the innards of a Linux OS I see a lot of scripts and text-based config files in all manner of different formats and languages. Many are shell scripts, some are preprocessed shell scripts or DSLs interpreted by a particular application, and practically every config file has its own unique format. Some are even Perl and Python. I've long thought it'd be quite interesting to try to replace all of them with Lua.


--
Sent from my Game Boy.
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Sema (beta) - Lua-scripted Service Manager

Justin Cormack
On Sun, Aug 4, 2013 at 1:46 AM, Rena <[hidden email]> wrote:

> Very interesting. When I look at the innards of a Linux OS I see a lot of
> scripts and text-based config files in all manner of different formats and
> languages. Many are shell scripts, some are preprocessed shell scripts or
> DSLs interpreted by a particular application, and practically every config
> file has its own unique format. Some are even Perl and Python. I've long
> thought it'd be quite interesting to try to replace all of them with Lua.

I have been working towards this, see
https://github.com/justincormack/ljsyscall - its currently LuaJIT only
but there will be a standard Lua port later. It is a work in progress
but there is just about enough to boot a system in Lua only.

Justin