4

In my case, squid is started before DHCP has written a new /etc/resolv.conf which results in odd errors (timeouts, 504 Gateway) when I try to load a page in the web browser.

As I see it, the correct solution would be to start squid only after dhcpd/NetworkManager/whoever (?) has finished configuring the network.

Braiam
  • 67,791
  • 32
  • 179
  • 269

2 Answers2

5

You should modify the squid.conf file in /etc/init so that it only starts when network is up:

start on (started networking)

You can find much more info here, and looking at the files in your /etc/init/ dir.

This question should also help. If you prefer to configure it with a GUI, look here.

Javier Rivera
  • 35,153
2

Here are two examples from the Upstart Cookbook:

To start a job when eth0 is available

start on net-device-up IFACE=eth0

To start once a non-loopback device has come up:

start on net-device-up IFACE!=lo

Note: net-device-up is not a regular job, it's an "Ubuntu well-known event".

Benoit Blanchon
  • 330
  • 2
  • 6