Gentoo Archives: gentoo-dev

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

Replies