On Sat, May 4, 2013 at 6:42 AM, Luca Barbato <lu_z...@gentoo.org> wrote:
> Hopefully we might have a gsoc student volunteering to make a
> runscript/lsb-script/systemd-unit compiler and a small abstraction so we
> write a single init.d script and generate what's needed.
> Probably we might even support pure-runit that way with minimal effort.
>

I'm skeptical that this will ever make sense - both init systems have
features that it would make sense for units/scripts to make use of in
a more tailored fashion.

That said, if you really wanted to inter-convert, my gut feeling is
that it would be easier to go from a systemd unit to an init.d script,
and not the other way around.  A systemd unit is more like a
specification - it describes the end result of what systemd should do.
 An init.d script is an executable program - it can do virtually
anything even if they usually start out with a common skeleton.  I
guess you could run the thing in a sandbox and carefully capture what
happens, and look in particular for calls to start-stop-daemon and
such, but it would be tricky.

The reality is that systemd units are floating around all over the
place - when I installed it on a Gentoo box I ended up just Googling
for already-written units for daemons that lacked them in Gentoo and
tweaked them.  All that really need to happen is for those who use
systemd to submit them as bug attachments and maintainers should
commit them.  Maybe a quick guide should be tossed together suggesting
the best way to install them (they're just text files in the proper
directory, but perhaps an eclass exists to take care of this).
Systemd units are much easier to write (typically) than init.d scripts
so this could be an area where end-users could contribute.

Rich

Reply via email to