* [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did)
@ 2017-09-16 19:56 Vadim A. Misbakh-Soloviov
2017-09-16 20:09 ` Rich Freeman
2017-09-17 9:12 ` Andrew Savchenko
0 siblings, 2 replies; 7+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2017-09-16 19:56 UTC (permalink / raw
To: gentoo-dev
Hi there!
Every time I switch from mastering service on my work (Ubuntu-powered) to my
own server farm (Gentoo powered) I'm going a bit frustrated: Ubuntu (with all
my hate to many other things in it) has nice user-friendly way of managing
services: you can freely call any of `service <servicename> action` irrelevant
to which init-system is currently in use. Will it be systemd, or (whatever
there is alternative there). `service` wrapper will detect it anyway and will
do the proper things (forward it to either systemd or another service
manager).
I'd like to suggest to remove `service` widget from openrc and make it the
part of (which package? baselayout?)? Here is a pseudocode of how I see it:
```
servicename=${1}
action=${2}
if in_systemd; then
systemctl "${action}" "${servicename}"
else
rc-service "${servicename}" "${action}"
fi
```
Well, actually, there may be some more logic (for example, instance units
(`unit@instance` in `systemd` vs `unit.instance` in openrc), "enable" action
(forward it to `rc-update add` for `openrc`, probably) and maybe some more.
But anyway, the conception is something like that.
What do you think about that?
P.S. actually, it also would be nice to add "generators" thing to it too, to
make it possible to manage services that have no systemd's units under SystemD
and services that have only units under OpenRC (well, that one looks much
harder than first variant, but, again, looks like deb/ubuntu guys did that
work already and we can try to use their work as cheatsheet)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did)
2017-09-16 19:56 [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did) Vadim A. Misbakh-Soloviov
@ 2017-09-16 20:09 ` Rich Freeman
2017-09-17 9:12 ` Andrew Savchenko
1 sibling, 0 replies; 7+ messages in thread
From: Rich Freeman @ 2017-09-16 20:09 UTC (permalink / raw
To: gentoo-dev
On Sat, Sep 16, 2017 at 3:56 PM, Vadim A. Misbakh-Soloviov
<gentoo@mva.name> wrote:
>
> I'd like to suggest to remove `service` widget from openrc and make it the
> part of (which package? baselayout?)?
IMO this really should go in its own package. By all means have
openrc and/or systemd pull it in by default, but this gives everybody
a bit more control. This was the approach with functions.sh as well.
>
> P.S. actually, it also would be nice to add "generators" thing to it too, to
> make it possible to manage services that have no systemd's units under SystemD
> and services that have only units under OpenRC (well, that one looks much
> harder than first variant, but, again, looks like deb/ubuntu guys did that
> work already and we can try to use their work as cheatsheet)
>
We don't really have the same situation that they do. IMO this is
best done by having some kind of wrapper that needs to be manually
invoked. I think most people would want to know the first time they
go to start a service that wasn't really tested under their particular
configuration. The service might not work the way they expect, so
they'd want to pay closer attention to it, for a start.
Wrapping systemd units into openrc scripts should be relatively easy,
because they're descriptive. You just need a parser of some kind.
The only issue I see is any code that has to run in global context -
I'm not sure how well openrc behaves when dependency parsing starts
running code.
Going in the other direction will be harder, but probably is possible.
Honestly, though, it isn't like it is that hard to write a unit or
script, so I think most people are going to prefer to hand-write them.
One of the really nice things about Gentoo is that whether you use
openrc or systemd you get a completely native experience without a ton
of duct-tape adapting one system into a completely different one, full
of caveats and stuff that doesn't behave like you'd expect. IMO the
only other distro that delivers a similar experience with systemd is
Arch, and they don't support openrc really.
But, nobody is going to complain if you create a tool that creates
init.d scripts or units automatically for you. People can use it as
they wish, and it might or might not make a good starting point for a
new script/unit.
--
Rich
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did)
2017-09-16 19:56 [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did) Vadim A. Misbakh-Soloviov
2017-09-16 20:09 ` Rich Freeman
@ 2017-09-17 9:12 ` Andrew Savchenko
2017-09-17 10:05 ` Michał Górny
1 sibling, 1 reply; 7+ messages in thread
From: Andrew Savchenko @ 2017-09-17 9:12 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]
On Sun, 17 Sep 2017 02:56:08 +0700 Vadim A. Misbakh-Soloviov wrote:
> Hi there!
>
> Every time I switch from mastering service on my work (Ubuntu-powered) to my
> own server farm (Gentoo powered) I'm going a bit frustrated: Ubuntu (with all
> my hate to many other things in it) has nice user-friendly way of managing
> services: you can freely call any of `service <servicename> action` irrelevant
> to which init-system is currently in use. Will it be systemd, or (whatever
> there is alternative there). `service` wrapper will detect it anyway and will
> do the proper things (forward it to either systemd or another service
> manager).
>
> I'd like to suggest to remove `service` widget from openrc and make it the
> part of (which package? baselayout?)? Here is a pseudocode of how I see it:
>
> ```
> servicename=${1}
> action=${2}
>
> if in_systemd; then
> systemctl "${action}" "${servicename}"
> else
> rc-service "${servicename}" "${action}"
> fi
> ```
>
> Well, actually, there may be some more logic (for example, instance units
> (`unit@instance` in `systemd` vs `unit.instance` in openrc), "enable" action
> (forward it to `rc-update add` for `openrc`, probably) and maybe some more.
> But anyway, the conception is something like that.
>
>
> What do you think about that?
https://xkcd.com/927/
We will create even more confusion for Gentoo users with one more
tool to do the same stuff.
Of course you are free to implement some separate wrapper package,
but it must be completely optional, since some users will have no
use for it including myself.
Really, unifying distributions is futile. We will have either the
same and only distribution (to rule them all) or an attempt will
fail. The same way you can try to unify emerge and apt tools via
some wrapper manager.
If one uses different distros, one needs to learn to switch between
them.
Best regards,
Andrew Savchenko
[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did)
2017-09-17 9:12 ` Andrew Savchenko
@ 2017-09-17 10:05 ` Michał Górny
2017-09-17 15:44 ` Andrew Savchenko
0 siblings, 1 reply; 7+ messages in thread
From: Michał Górny @ 2017-09-17 10:05 UTC (permalink / raw
To: gentoo-dev
W dniu nie, 17.09.2017 o godzinie 12∶12 +0300, użytkownik Andrew
Savchenko napisał:
> On Sun, 17 Sep 2017 02:56:08 +0700 Vadim A. Misbakh-Soloviov wrote:
> > Hi there!
> >
> > Every time I switch from mastering service on my work (Ubuntu-powered) to my
> > own server farm (Gentoo powered) I'm going a bit frustrated: Ubuntu (with all
> > my hate to many other things in it) has nice user-friendly way of managing
> > services: you can freely call any of `service <servicename> action` irrelevant
> > to which init-system is currently in use. Will it be systemd, or (whatever
> > there is alternative there). `service` wrapper will detect it anyway and will
> > do the proper things (forward it to either systemd or another service
> > manager).
> >
> > I'd like to suggest to remove `service` widget from openrc and make it the
> > part of (which package? baselayout?)? Here is a pseudocode of how I see it:
> >
> > ```
> > servicename=${1}
> > action=${2}
> >
> > if in_systemd; then
> > systemctl "${action}" "${servicename}"
> > else
> > rc-service "${servicename}" "${action}"
> > fi
> > ```
> >
> > Well, actually, there may be some more logic (for example, instance units
> > (`unit@instance` in `systemd` vs `unit.instance` in openrc), "enable" action
> > (forward it to `rc-update add` for `openrc`, probably) and maybe some more.
> > But anyway, the conception is something like that.
> >
> >
> > What do you think about that?
>
> https://xkcd.com/927/
>
> We will create even more confusion for Gentoo users with one more
> tool to do the same stuff.
>
> Of course you are free to implement some separate wrapper package,
> but it must be completely optional, since some users will have no
> use for it including myself.
>
> Really, unifying distributions is futile. We will have either the
> same and only distribution (to rule them all) or an attempt will
> fail. The same way you can try to unify emerge and apt tools via
> some wrapper manager.
Fun fact: systemd was created to unify distributions in one init system.
--
Best regards,
Michał Górny
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did)
2017-09-17 10:05 ` Michał Górny
@ 2017-09-17 15:44 ` Andrew Savchenko
2017-09-18 2:22 ` [gentoo-dev] " Duncan
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Savchenko @ 2017-09-17 15:44 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 2381 bytes --]
On Sun, 17 Sep 2017 12:05:07 +0200 Michał Górny wrote:
> W dniu nie, 17.09.2017 o godzinie 12∶12 +0300, użytkownik Andrew
> Savchenko napisał:
> > On Sun, 17 Sep 2017 02:56:08 +0700 Vadim A. Misbakh-Soloviov wrote:
> > > Hi there!
> > >
> > > Every time I switch from mastering service on my work (Ubuntu-powered) to my
> > > own server farm (Gentoo powered) I'm going a bit frustrated: Ubuntu (with all
> > > my hate to many other things in it) has nice user-friendly way of managing
> > > services: you can freely call any of `service <servicename> action` irrelevant
> > > to which init-system is currently in use. Will it be systemd, or (whatever
> > > there is alternative there). `service` wrapper will detect it anyway and will
> > > do the proper things (forward it to either systemd or another service
> > > manager).
> > >
> > > I'd like to suggest to remove `service` widget from openrc and make it the
> > > part of (which package? baselayout?)? Here is a pseudocode of how I see it:
> > >
> > > ```
> > > servicename=${1}
> > > action=${2}
> > >
> > > if in_systemd; then
> > > systemctl "${action}" "${servicename}"
> > > else
> > > rc-service "${servicename}" "${action}"
> > > fi
> > > ```
> > >
> > > Well, actually, there may be some more logic (for example, instance units
> > > (`unit@instance` in `systemd` vs `unit.instance` in openrc), "enable" action
> > > (forward it to `rc-update add` for `openrc`, probably) and maybe some more.
> > > But anyway, the conception is something like that.
> > >
> > >
> > > What do you think about that?
> >
> > https://xkcd.com/927/
> >
> > We will create even more confusion for Gentoo users with one more
> > tool to do the same stuff.
> >
> > Of course you are free to implement some separate wrapper package,
> > but it must be completely optional, since some users will have no
> > use for it including myself.
> >
> > Really, unifying distributions is futile. We will have either the
> > same and only distribution (to rule them all) or an attempt will
> > fail. The same way you can try to unify emerge and apt tools via
> > some wrapper manager.
>
> Fun fact: systemd was created to unify distributions in one init system.
Exactly. This case is perfectly covered by https://xkcd.com/927/ :)
Best regards,
Andrew Savchenko
[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [gentoo-dev] Re: [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did)
2017-09-17 15:44 ` Andrew Savchenko
@ 2017-09-18 2:22 ` Duncan
2017-09-18 9:32 ` Vadim A. Misbakh-Soloviov
0 siblings, 1 reply; 7+ messages in thread
From: Duncan @ 2017-09-18 2:22 UTC (permalink / raw
To: gentoo-dev
Andrew Savchenko posted on Sun, 17 Sep 2017 18:44:11 +0300 as excerpted:
> On Sun, 17 Sep 2017 12:05:07 +0200 Michał Górny wrote:
>> W dniu nie, 17.09.2017 o godzinie 12∶12 +0300, użytkownik Andrew
>> Savchenko napisał:
>> > On Sun, 17 Sep 2017 02:56:08 +0700 Vadim A. Misbakh-Soloviov wrote:
>> > > Hi there!
>> > >
>> > > Every time I switch from mastering service on my work
>> > > (Ubuntu-powered) to my own server farm (Gentoo powered) I'm going a
>> > > bit frustrated: Ubuntu (with all my hate to many other things in
>> > > it) has nice user-friendly way of managing services: you can freely
>> > > call any of `service <servicename> action` irrelevant to which
>> > > init-system is currently in use. Will it be systemd, or (whatever
>> > > there is alternative there). `service` wrapper will detect it
>> > > anyway and will do the proper things (forward it to either systemd
>> > > or another service manager).
>> > >
>> > > I'd like to suggest to remove `service` widget from openrc and make
>> > > it the part of (which package? baselayout?)? Here is a pseudocode
>> > > of how I see it:
>> > >
>> > > ```
>> > > servicename=${1}
>> > > action=${2}
>> > >
>> > > if in_systemd; then
>> > > systemctl "${action}" "${servicename}"
>> > > else
>> > > rc-service "${servicename}" "${action}"
>> > > fi ```
>> > >
>> > > Well, actually, there may be some more logic (for example, instance
>> > > units (`unit@instance` in `systemd` vs `unit.instance` in openrc),
>> > > "enable" action (forward it to `rc-update add` for `openrc`,
>> > > probably) and maybe some more. But anyway, the conception is
>> > > something like that.
>> > >
>> > >
>> > > What do you think about that?
>> >
>> > https://xkcd.com/927/
>> >
>> > We will create even more confusion for Gentoo users with one more
>> > tool to do the same stuff.
>> >
>> > Of course you are free to implement some separate wrapper package,
>> > but it must be completely optional, since some users will have no use
>> > for it including myself.
>> >
>> > Really, unifying distributions is futile. We will have either the
>> > same and only distribution (to rule them all) or an attempt will
>> > fail. The same way you can try to unify emerge and apt tools via some
>> > wrapper manager.
>>
>> Fun fact: systemd was created to unify distributions in one init
>> system.
>
> Exactly. This case is perfectly covered by https://xkcd.com/927/ :)
Well, I'd argue the case for "not 'perfectly'", because for better or for
worse, systemd has had rather more luck at cross-distro init-system
unification than that comic suggests. There's still special-cases like
small embedded where systemd simply won't fit, and there's still a rather
strident no-special-case opposition, but virtually all the "don't care as
long as it works" distros are systemd, now -- the middle ground simply
isn't there any more, it's all systemd.
That's rather more successful as a unifying standard than the comic
suggests, so while the comic does cover the general situation and perhaps
matches the first few years near perfectly, as the situation has evolved
by now, the punchline panel would have to be rather different to be a
"perfect" cover.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-dev] Re: [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did)
2017-09-18 2:22 ` [gentoo-dev] " Duncan
@ 2017-09-18 9:32 ` Vadim A. Misbakh-Soloviov
0 siblings, 0 replies; 7+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2017-09-18 9:32 UTC (permalink / raw
To: gentoo-dev
> Well, I'd argue the case for "not 'perfectly'", because for better or for
> worse, systemd has had rather more luck at cross-distro init-system
> unification than that comic suggests.
It would have a chance to be true if systemd had less stupid bugs (which never
appeared in other init systems), don't ignore CVEs and support custom actions
on units.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-09-18 9:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-16 19:56 [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did) Vadim A. Misbakh-Soloviov
2017-09-16 20:09 ` Rich Freeman
2017-09-17 9:12 ` Andrew Savchenko
2017-09-17 10:05 ` Michał Górny
2017-09-17 15:44 ` Andrew Savchenko
2017-09-18 2:22 ` [gentoo-dev] " Duncan
2017-09-18 9:32 ` Vadim A. Misbakh-Soloviov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox