* Systemd unit parser and s6 generator
@ 2023-02-27 16:25 Oliver Schad
2023-02-28 2:02 ` Laurent Bercot
0 siblings, 1 reply; 2+ messages in thread
From: Oliver Schad @ 2023-02-27 16:25 UTC (permalink / raw)
To: supervision
[-- Attachment #1: Type: text/plain, Size: 961 bytes --]
Hi everybody
I don't know, if somebody has tried that ever. However we want to
continue to use Ubuntu on s6 and packages today our s6 "units" manually.
We've build a generator for that, that creates a base of service. But
the call of this generator is once by a human being which manually
decides which options make sense. Later he/she modifies maybe the
generated result.
We've discussed internally if we change that process and try to write a
systemd unit parser, because all units are there in Ubuntu.
If we could catch 90% of all cases, we need, we would be happy.
If it would take 2 weeks of work, that would be fine.
Did somebody of you try to implement something? What are your thoughts?
Best Regards
Oli
--
Automatic-Server AG •••••
Oliver Schad
Geschäftsführer
Hardstr. 46
9434 Au | Schweiz
www.automatic-server.com | oliver.schad@automatic-server.com
Tel: +41 71 511 31 11 | Mobile: +41 76 330 03 47
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Systemd unit parser and s6 generator
2023-02-27 16:25 Systemd unit parser and s6 generator Oliver Schad
@ 2023-02-28 2:02 ` Laurent Bercot
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Bercot @ 2023-02-28 2:02 UTC (permalink / raw)
To: Oliver Schad, supervision
>We've discussed internally if we change that process and try to write a
>systemd unit parser, because all units are there in Ubuntu.
>
>If we could catch 90% of all cases, we need, we would be happy.
>If it would take 2 weeks of work, that would be fine.
>
>Did somebody of you try to implement something? What are your thoughts?
Hi Oli,
This is a subject that comes up regularly in the #s6 IRC channel. And
I always answer something like this:
The difficulty of converting systemd services to s6 services is not a
syntax problem. The unit file syntax is mostly fine.
The difficulty is the difference of world modelization between systemd
and s6. systemd's view is very holistic, every component can depend on
another one or rely on a systemd-only feature, and the unit file syntax
reflects that; while s6's view is more local, every service is its own
independent thing.
But more importantly, the way systemd maps the system into concepts is
pretty different from the way s6 maps the system into concepts, and
these
two views are not 1-to-1 compatible. Translating a setup between systemd
and s6 requires intelligence; it is not possible to write an automated
tool that does it accurately and idiomatically without going *deep* into
things.
In practice, yes, it is possible to write a converter that will take
systemd.service files and turn them into s6 service directories, and
that will work "most" of the time, depending on how your service files
look. Most directives in systemd.service are directly translatable to
s6 features. However, as soon as you start using esoteric systemd
directives, the complexity explodes, and it's all a balancing act on
what you want to support vs. how difficult it is. And only
systemd.service files are automatically convertible; other unit files
such as systemd.socket, systemd.path and systemd.target are all
dependent
on the systemd-centric system view and it is impossible to treat them
without analyzing the entire system.
I still owe you a couple hours of work, so what I can do, if it is of
interest to you, is list all the directives in a service file and
rate their conversion difficulty, so you can then evaluate your own
service files and assess the feasability of an automated conversion
tool.
90% coverage is doable if your services are super simple and don't rely
on systemd-specific features, but it's very easy to get lost in the
weeds.
--
Laurent
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-28 2:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 16:25 Systemd unit parser and s6 generator Oliver Schad
2023-02-28 2:02 ` Laurent Bercot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).