1 |
On Wed, May 8, 2013 at 2:55 PM, Ambroz Bizjak <ambrop7@×××××.com> wrote: |
2 |
>> Init.d scripts are programs - they could probably do just about anything. |
3 |
> |
4 |
> They couldn't monitor a process and restart it when it crashes, as |
5 |
> specified by the restart options in the unit file. That is, without |
6 |
> significant modifications in the way OpenRC works, such as adding a |
7 |
> monitoring process, or hacks such as launching a daemon that monitor |
8 |
> that process specifically. |
9 |
|
10 |
Sure. I doubt anybody is suggesting that OpenRC would expand the full |
11 |
feature set of systemd anyway (if it did the people who don't want to |
12 |
use systemd would likely fork it back to where it is now anyway). |
13 |
|
14 |
A unit can support dozens of options, but for the most part you can |
15 |
get by with just a few. I'm sure any support across the two systems |
16 |
would start with the few features that get people 90% of the way |
17 |
there. |
18 |
|
19 |
If somebody wants to have their processes propped up, they can install |
20 |
systemd. Ditto for launching daemons in containers, implementing |
21 |
xinetd, and all the other bells and whistles systemd offers. |
22 |
|
23 |
All we really need to get working from a basic usability standpoint is |
24 |
stuff like what to launch, what UID/niceness/etc to use, and what the |
25 |
deps are - the stuff in the typical skeleton init.d script. Really |
26 |
all you need is some code at the top of the existing init.d script |
27 |
that just populates some environment variables based on values |
28 |
translated from the unit file and then invokes the typical current |
29 |
logic. |
30 |
|
31 |
The biggest issue I'd see would be around dependency translation. |
32 |
Assuming our units use the same names as our existing package init.d |
33 |
scripts (likely) that isn't a problem in most cases, but dependencies |
34 |
on targets/etc in systemd might need a little handling. I'm not |
35 |
really a systemd guru yet so I'm sure I'm oversimplifying, but as long |
36 |
as any translation focuses only on what openrc already supports it |
37 |
shouldn't be a big problem. |
38 |
|
39 |
Rich |