[CentOS] CentOS 7, NSF, "feature"

Wed Feb 3 08:23:41 UTC 2016
James Hogarth <james.hogarth at gmail.com>

On 2 Feb 2016 20:19, "Ricardo J. Barberis" <ricardo at palmtx.com.ar> wrote:
> because the interface wasn't yet up, so I had to make a new unit and put
> inside (/etc/systemd/system/nginx.service):
> <code>
> .include /usr/lib/systemd/system/nginx.service
> [Unit]
> After=network.target remote-fs.target nss-lookup.target
> </code>
> The After line is the important one, I copied it from
> /usr/lib/systemd/system/nginx.service and added "network-online.target"
> at the end.
> After making your changes, be sure to reenable the service so it takes
> new unit, e.g.:
> # systemctl reenable nginx.service

1) Don't use .include as that's not recommended and deprecated behaviour.
Make an override snippet in /etc/systemd/system/nginx.service.d called
custom.conf or network.conf or something. This has the benefit as well of
working nicely with systemctl cat and systemd-delta.

2) You just need a systemctl daemon-reload after this not reenable.

3) The network targets situation is detailed (and the whys of it) in the
systemd.special man page.