1 |
On Tue, Oct 28, 2014 at 9:50 PM, Rich Freeman <rich0@g.o> wrote: |
2 |
> On Tue, Oct 28, 2014 at 9:36 PM, Tom H <tomh0665@×××××.com> wrote: |
3 |
>> Since Gentoo's rpcbind.service has "Wants=rpcbind.target" and |
4 |
>> "Before=rpcbind.target"", having nfs-server.service depend on |
5 |
>> rpcbind.target rather than rpcbind.service should work as long as |
6 |
>> rpcbind.service is enabled. |
7 |
>> |
8 |
>> But having "Requires=rpcbind.service" and "After=rpcbind.service", |
9 |
>> like nfsd.service has/had, means that you don't have to enable |
10 |
>> rpcbind.service. |
11 |
> |
12 |
> I was just looking at that and thinking the same thing. Nothing is |
13 |
> really forcing rpcbind to load the way things are specified right now. |
14 |
> If a service really requires another service to operate, it should say |
15 |
> that. There is no problem doing that via a target, but then the |
16 |
> target still needs to pull it in. |
17 |
|
18 |
Wouldn't the solution to this problem to have a news item to let the |
19 |
user know that rpcbind was being started as a dependency of |
20 |
nfsd.service but that it now needs to be enabled in order to be |
21 |
started by nfs-server.service? |
22 |
|
23 |
|
24 |
> There seems a general tendency in systemd to express dependencies as |
25 |
> "after" instead of "requires." That is fine if the service doesn't |
26 |
> really require something else, but if there really is a true |
27 |
> dependency then it just causes problems when somebody doesn't notice |
28 |
> and fails to enable the other unit. |
29 |
|
30 |
AFAIK they're completely different and you can have service1 have a |
31 |
"Requires" on service2 but have service2 start before service1. So if |
32 |
someone's using "After" and expecting "Requires", he/she is bound to |
33 |
be surprised by the result. |
34 |
|
35 |
Is "After" really necessary as an option? I've never come across a |
36 |
service that uses "After" without a "Requires" or a Wants" but I've |
37 |
never taken the time to look. |