Squid suddenly stops

Hi!

I found a possible solution. I was checking documentation and this lost of connection might be related to a behavior of squid. In short text, squid tries to connect to a web page using IPv6 (don’t know why and I haven’t seen any related to IPv6 in the .conf file) so adding this line “dns_v4_first on” in the .conf file, the squid will allways use IPv4 (according to squid documentation - http://www.squid-cache.org/Doc/config/dns_v4_first/). During all day, since I put that line, the disconnection hasn’t occured. I’ll keep testing.

4 Likes

Guys…

I haven’t lost connection til now. But I realized that the line I put in squid.conf was missing so I added the same line in /etc/e-smith/templates/etc/squid/squid.conf/90options. And here I have another question. If I want to add a new domain o url inside a category pre-established, let’s say movies, I just add the domain, run the sudo -u squid /usr/sbin/ufdbConvertDB -d /var/squidGuard/blacklists/movies/ command, restart the ufdb service and it’s done… but after the “night update” that ufdb does, the domain that I’ve added, dissapears.

So, which file do I have to edit to keep this new add?

pd: sorry for my english :stuck_out_tongue_closed_eyes:

/etc/squid/squid.conf
DO NOT MODIFY THIS FILE
Manual changes will be lost when this file is regenerated
Which file do you want to change?

Please create a custom template to add the line to squid.conf

1 Like

Hi,

The file is squid.conf.
I just added the new line in this file > /etc/e-smith/templates/etc/squid/squid.conf/90options
and the change (new line) persists.

Hi @lldm30,

please copy the template file to templates-custom and make the change there, so the changes will keep after updates.

mkdir -p /etc/e-smith/templates-custom/etc/squid cp /etc/e-smith/templates/etc/squid/squid.conf/90options /etc/e-smith/templates-custom/etc/squid/squid.conf/90options

Docs:
http://docs.nethserver.org/projects/nethserver-devel/en/v7/templates.html

1 Like

Please no, custom templates from copies of the original templates should be used only to override a default value or option.
In this case, simply add a new file called 91ipv4dns and put that single line in it (dns_v4_first on).

So, to recap, the best practice is to avoid copying standard templates to templates-custom directory unless you need to override a default behaviour.
And the commands for @lldm30 are:

mkdir -p /etc/e-smith/templates-custom/etc/squid
echo "dns_v4_first on" >/etc/e-smith/templates-custom/etc/squid/91ipv4dns
signal-event nethserver-squid-save

@mrmarkuz I think that we may need to expand our documentation to add some best practices.

6 Likes

Oh no, I really thought, that’s how to do it generally…but if there were new functions in new templates they’ll never be used as they would be overwritten by my custom templates.

OK, so what I can see it’s always possible to take 91somename for adding entries at the end.

If you want to add an option:

mkdir -p /etc/e-smith/templates-custom/ABSOLUTE_PATH_OF_FILE_TO_CHANGE
echo "option=test" > /etc/e-smith/templates-custom/ABSOLUTE_PATH_OF_FILE_TO_CHANGE/91DESCRIBING_NAME

Change a default option:

mkdir -p /etc/e-smith/templates-custom/ABSOLUTE_PATH_OF_FILE_TO_CHANGE
cp /etc/e-smith/templates/ABSOLUTE_PATH_OF_FILE_TO_CHANGE/XXOPTIONFILE /etc/e-smith/templates-custom/ABSOLUTE_PATH_OF_FILE_TO_CHANGE/
vi /etc/e-smith/templates-custom/ABSOLUTE_PATH_OF_FILE_TO_CHANGE/XXOPTIONFILE
1 Like

One final note: if the syntax permits, sometimes we can override a variable re-defining it.
As an example, amavisd.conf permits redefinition, so if you want to change log_level you can redfine it at the end with a 92loglevel custom template. This way is preferred over copying and modifying /etc/e-smith/templates/etc/amavisd/amavisd.conf/10server.

1 Like

@mrmarkuz The first thing to check is if squid is listening and you have any ip v6 routes on the system.
If the system has any ipv6 addresses else then on lo you should remove them and disable ipv6 auto addressing before you change to “dns_v4_first on” but it’s a relevant solution.
In cases like this what I am using is:
http://gogs.ngtech.co.il/elicro/linux-ipv6-utils/src/master/remove-ipv6-addresses.sh

but do not know how it should be done on nethserver.

5 Likes

Thanks Filippo for explanation, I did it wrong to.
What do you think about adding a hint of that in documentation for claryfying?

Best practice build over time and experience. These are not general rules that can be applied in all cases.
I agree that a note in the manual to give some guidelines would be helpful.
Pull request welcome. :slight_smile:

1 Like

Pull request is done

3 Likes

I do not see any pull request. No mail notification from gituhb either. Do you have a link?

I have a look tomorrow and send it to you

Something went wrong, I sent the request again. Do you have a mail about it?

Hi @m.traeumner,

I am new to GitHub, but I think you have to do the pull request here:

1 Like

Hi Markus,
thanks for your help.
What I don’t understand is that mine says

forked from NethServer/docs

So I could think it is at the right place, but don’t know why it isn’t placed at the overview you posted.
@davidep Can you Help?

Seems like you made a pull request in your fork of NethServer docs…

1 Like

Thanks for help, with your hint and the following documention I moved it to the right place.

Creating a pull request from a fork - GitHub Docs

2 Likes