Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did)
Date: Sun, 17 Sep 2017 10:05:19
Message-Id: 1505642707.1554.1.camel@gentoo.org
In Reply to: Re: [gentoo-dev] [openrc] [systemd] make `service` common for both OpenRC and SystemD (like Debian/Ubuntu/whatever did) by Andrew Savchenko
1 W dniu nie, 17.09.2017 o godzinie 12∶12 +0300, użytkownik Andrew
2 Savchenko napisał:
3 > On Sun, 17 Sep 2017 02:56:08 +0700 Vadim A. Misbakh-Soloviov wrote:
4 > > Hi there!
5 > >
6 > > Every time I switch from mastering service on my work (Ubuntu-powered) to my
7 > > own server farm (Gentoo powered) I'm going a bit frustrated: Ubuntu (with all
8 > > my hate to many other things in it) has nice user-friendly way of managing
9 > > services: you can freely call any of `service <servicename> action` irrelevant
10 > > to which init-system is currently in use. Will it be systemd, or (whatever
11 > > there is alternative there). `service` wrapper will detect it anyway and will
12 > > do the proper things (forward it to either systemd or another service
13 > > manager).
14 > >
15 > > I'd like to suggest to remove `service` widget from openrc and make it the
16 > > part of (which package? baselayout?)? Here is a pseudocode of how I see it:
17 > >
18 > > ```
19 > > servicename=${1}
20 > > action=${2}
21 > >
22 > > if in_systemd; then
23 > > systemctl "${action}" "${servicename}"
24 > > else
25 > > rc-service "${servicename}" "${action}"
26 > > fi
27 > > ```
28 > >
29 > > Well, actually, there may be some more logic (for example, instance units
30 > > (`unit@instance` in `systemd` vs `unit.instance` in openrc), "enable" action
31 > > (forward it to `rc-update add` for `openrc`, probably) and maybe some more.
32 > > But anyway, the conception is something like that.
33 > >
34 > >
35 > > What do you think about that?
36 >
37 > https://xkcd.com/927/
38 >
39 > We will create even more confusion for Gentoo users with one more
40 > tool to do the same stuff.
41 >
42 > Of course you are free to implement some separate wrapper package,
43 > but it must be completely optional, since some users will have no
44 > use for it including myself.
45 >
46 > Really, unifying distributions is futile. We will have either the
47 > same and only distribution (to rule them all) or an attempt will
48 > fail. The same way you can try to unify emerge and apt tools via
49 > some wrapper manager.
50
51 Fun fact: systemd was created to unify distributions in one init system.
52
53 --
54 Best regards,
55 Michał Górny

Replies