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.


2 Answers 2


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.


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".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.