PS, after some research, I landed on:
https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/


The *right* Service configuration to use for Ubuntu to ensure that it starts 
only after the network is up is:


[Unit]
Description=The Apache HTTP Server
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
Environment=APACHE_STARTED_BY_SYSTEMD=true
ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl stop
ExecReload=/usr/sbin/apachectl graceful
PrivateTmp=true
Restart=on-abort

[Install]
WantedBy=multi-user.target


----
The critical lines are: 

After=network-online.target
Wants=network-online.target 


The implication of this configuration is that if it takes a while for the 
network to be up (example, slow DHCP resolution), then it will take a while for 
apache to boot up. I don't expect it to affect boot up time much since I don't 
think anything waits for apache, but i haven't tested or verified this.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1786675

Title:
  Apache will not start on boot if bound to a fixed IP address

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1786675/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to