On Tue, Oct 28, 2014 at 9:50 PM, Rich Freeman <ri...@gentoo.org> wrote: > On Tue, Oct 28, 2014 at 9:36 PM, Tom H <tomh0...@gmail.com> wrote: >> Since Gentoo's rpcbind.service has "Wants=rpcbind.target" and >> "Before=rpcbind.target"", having nfs-server.service depend on >> rpcbind.target rather than rpcbind.service should work as long as >> rpcbind.service is enabled. >> >> But having "Requires=rpcbind.service" and "After=rpcbind.service", >> like nfsd.service has/had, means that you don't have to enable >> rpcbind.service. > > I was just looking at that and thinking the same thing. Nothing is > really forcing rpcbind to load the way things are specified right now. > If a service really requires another service to operate, it should say > that. There is no problem doing that via a target, but then the > target still needs to pull it in.
Wouldn't the solution to this problem to have a news item to let the user know that rpcbind was being started as a dependency of nfsd.service but that it now needs to be enabled in order to be started by nfs-server.service? > There seems a general tendency in systemd to express dependencies as > "after" instead of "requires." That is fine if the service doesn't > really require something else, but if there really is a true > dependency then it just causes problems when somebody doesn't notice > and fails to enable the other unit. AFAIK they're completely different and you can have service1 have a "Requires" on service2 but have service2 start before service1. So if someone's using "After" and expecting "Requires", he/she is bound to be surprised by the result. Is "After" really necessary as an option? I've never come across a service that uses "After" without a "Requires" or a Wants" but I've never taken the time to look.