Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: Providing a `service` scripts that speaks OpenRC and systemd
Date: Fri, 29 Sep 2017 00:08:24
Message-Id: pan$42eab$34f73a19$12805b5b$f7b6a395@cox.net
In Reply to: [gentoo-dev] Providing a `service` scripts that speaks OpenRC and systemd by Austin English
1 Austin English posted on Thu, 28 Sep 2017 16:27:31 -0500 as excerpted:
2
3 > (Note: serious discussion, please take systemd trolling elsewhere).
4 >
5 > While having the pleasure of working with some proprietary software
6 > recently, I was asked to run `service foo restart`, and was surprised to
7 > see:
8 > foobar ~ # service foo restart
9 > * service: service `foo' does not exist
10 >
11 > Since `systemctl restart foo` works, I had a workaround anyway.
12 >
13 > Talking with Whubbs about it, I found that our service script only
14 > supports OpenRC, via rc-service. I looked around, and from what I can
15 > tell, most distros ship a service tool for all supported init systems.
16 > I.e.,
17 > Debian/Ubuntu: supports sysvinit and systemd via init-system-helpers
18 > CentOS/Fedora: provides support for systemd via initscripts
19 > OpenSUSE: has a working service binary for systemd (according to #suse)
20 >
21 > I'd like to propose moving `service` out of OpenRC and into a separate
22 > package that OpenRC and systemd can both use. It's very possible that we
23 > could simply package/use another distro's scripts (I haven't evaluated
24 > that though).
25
26 While I wouldn't oppose moving "service" into a separate package, I don't
27 see the need.
28
29 It's rather like instructions assuming you're running MS something or
30 other. You simply translate them in your head to whatever's appropriate
31 for your system-administrative environment and go on. If you're bothered
32 enough about it, when you're done, you open a support ticket with whoever
33 wrote the instructions and suggest that they don't assume what cannot be
34 taken as a safe assumption. Otherwise, you just go on with your day.
35
36 While I can see users of some distros needing hand-holding in that
37 regard, Gentoo has always been about giving people the tools, documenting
38 how to use them, and getting out of the way -- if they can't read the
39 docs or choose to use the tools to bash their hand, or /accidentally/
40 bash their hand because they couldn't be bothered to read the docs and
41 either ran the tool without asking for confirmation (emerge without --ask
42 or --pretend, we don't make --ask the default and have a --justdoit
43 option, do you suggest we switch that around too?), or answered the
44 tool's prompt for confirmation with a go ahead, well, that's their
45 problem, and gentoo doesn't normally stand in the way of them bashing
46 their hand... or head or whatever else, if they wish to do so.
47
48 So I don't see the problem. As a systemd user I know that services are
49 handled via systemctl, and would automatically translate an instruction
50 to run "service" accordingly, just as when I was an openrc user I was
51 aware that openrc didn't always function quite like other initsystems,
52 and would consider what I was doing before I blindly ran "service
53 <anything>".
54
55 Or are we going to replace rm, and fdisk, and gdisk, and cfdisk, and
56 cgdisk, and who knows how many other binaries, with "safe" alternatives,
57 because some gentooer couldn't be bothered to think for a moment whether
58 a command in some instructions they're following is actually appropriate
59 to the situation and the environment they're working in?
60
61 Meanwhile:
62
63 $ equery b service
64 * Searching for service ...
65
66 $
67
68 But that's no problem, because as I said I'd automatically translate the
69 instructions into something appropriate to my environment. (Indeed, were
70 there a separate package providing "service" that was for some reason a
71 dep, I'd strongly consider creating for myself an empty virtual to
72 provide it, just as I've done for a number of other packages that aren't
73 actually required to build or run the commands I /do/ want to run.)
74
75 --
76 Duncan - List replies preferred. No HTML msgs.
77 "Every nonfree program has a lord, a master --
78 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
[gentoo-dev] Re: Providing a `service` scripts that speaks OpenRC and systemd Harald Weiner <Harald.Weiner@×××.at>