Can't get squid to start automatically

I have just installed squid and sarg, both are working well.

I cannot get squid to start when the machine boots. I installed webmin
and configured the setup through the webmin interface where I checked
the "start at boot option".

I think the problem is that my network card responsible for the web
connection is wireless so when squid tries to load during boot it is
trying before the Wireless card is up and so it fails.

I have tried multiple methods of adding a script to the "dispatcher.d"
folder in "NetworkManager" to load squid after wlan0 is up but all have
failed to bring up the squid proxy without my interaction. I have not
found any two sites that describe the syntax for "dispatcher.d" alike so
I may have the command wrong but I have no idea what to do.

I probably have 20 hours trying to get this service to run
automatically and no luck. I am new to Linux so help that is explained
it a way that I can understand how to apply it is hard to find.

Has anyone figured out a way to automatically execute a simple command
(/etc/init.d/.squid start) after a regular user's desktop is fully up?

Any help would be greatly appreciated.
I am running OpenSuse 11.2
Thank you fore looking!


-- 
RET423
------------------------------------------------------------------------



0
RET423
3/26/2010 12:46:01 AM
opensuse.org.network-internet 6943 articles. 1 followers. Follow

9 Replies
759 Views

Similar Articles

[PageSpeed] 46

You should enable start at boot using YaST. webmin may not understand
the openSUSE way of doing things. I don't know why people want to use
webmin for this sort of thing when it's supported in YaST.

squid should start fine even if you don't have a network connection but
you may have to provide a server name corresponding to the IP address
it's listening on. Look in the logs in /var/log/squid for clues after
you have set it up to start at boot.


-- 
ken_yap
------------------------------------------------------------------------
ken_yap's Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
ken
3/26/2010 12:56:01 AM
ken_yap;2142839 Wrote: 
> You should enable start at boot using YaST. webmin may not understand
> the openSUSE way of doing things. I don't know why people want to use
> webmin for this sort of thing when it's supported in YaST.
> 
> squid should start fine even if you don't have a network connection but
> you may have to provide a server name corresponding to the IP address
> it's listening on. Look in the logs in /var/log/squid for clues after
> you have set it up to start at boot.
I did enable squid in Yast and it does load, the problem is it loads
before the wireless interface is up so it does not function. I have to
manually restart squid if I load it through the system runlevel option
in yast so it is basically the same as if I wait for the desktop to come
up and just run the start command.

I have told squid to look for the ip address of the router that will be
providing the connection but unless the connection is already
established squid will not start in a way that will function after the
interface is up.

That is why I started looking for a way to execute the start command a
few seconds after the desktop is up.

Webmin was just a last resort after failing to get this to load
automatically after 15 hours or so of research and trial & error. The
proxy and the website logging through sarg has been working from the
start, I just want this to work without having to babysit the machine
every time it starts. When I put this server online I won't be present
every time is starts and there won't be anyone around who will be able
to login as su and manually do it.


-- 
RET423
------------------------------------------------------------------------
RET423's Profile: http://forums.opensuse.org/member.php?userid=43967
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
RET423
3/26/2010 1:16:01 AM
Look in the log for clues as to why it won't start. You may need a
ServerName directive. AFAICT squid binds to port 3128 on all addresses
(including localhost) so if an interface comes up later, it will be
listening on that interface.

The other reason is it may be looking for a DNS server on another
machine, and hence not reachable, at startup. One workaround is to run a
DNS proxy that is always available, like dnsmasq.


-- 
ken_yap
------------------------------------------------------------------------
ken_yap's Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
ken
3/26/2010 1:36:02 AM
The logs are in /var/log/squid/ as already mentioned. There should be
rcsquid.log, cache.log, store.log and access.log at the very least.

If you need to run dnsmasq, it would be on the same machine.


-- 
ken_yap
------------------------------------------------------------------------
ken_yap's Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
ken
3/26/2010 2:06:01 AM
ken_yap;2142852 Wrote: 
> Look in the log for clues as to why it won't start. You may need a
> ServerName directive. AFAICT squid binds to port 3128 on all addresses
> (including localhost) so if an interface comes up later, it will be
> listening on that interface.
> 
> The other reason is it may be looking for a DNS server on another
> machine, and hence not reachable, at startup. One workaround is to run a
> DNS proxy that is always available, like dnsmasq.
I can't find an error log for squid, I have:
cachemgr.conf
mime.conf
msntauth.conf
squid.conf
squid.conf.rpmsave

None of these has a reference to any errors, webmin has an error log
that says PAM is not installed and that a perl module would need to be
installed.

I installed Squid, Sarg and the Yast plugin through  the Yast installer
and did not see any reference to a perl dependency so I assumed this
module was not needed for the functionality that I am seeking.

Would this DNS proxy you are referring to run on this local machine or
would it be dependent on a client machine? If Squid binds to this DNS
proxy would it know to switch to the wlan0 interface once it loads up or
just find the wlan0 interface through the DNS proxy?


-- 
RET423
------------------------------------------------------------------------
RET423's Profile: http://forums.opensuse.org/member.php?userid=43967
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
RET423
3/26/2010 2:06:01 AM
ken_yap;2142865 Wrote: 
> The logs are in /var/log/squid/ as already mentioned. There should be
> rcsquid.log, cache.log, store.log and access.log at the very least.
> 
> If you need to run dnsmasq, it would be on the same machine. Squid
> doesn't need to switch, you would continue to let dnsmasq provide DNS
> resolution to squid.
I was looking in the /var folder as a user and the /log folder was not
visible. I can see it as root, sorry about that.

Here is the error that repeats at every boot
> 
> 2010/03/25 16:44:12| aclParseIpData: WARNING: Netmask masks away part
> of the specified IP in '192.168.9.254/255.255.255.0'
> 2010/03/25 16:44:12| Failed to acquire SSL certificate '(null)':
> error:0200100E:system library:fopen:Bad address

The network address and mask it is referencing is the LAN configuration
for this network.


-- 
RET423
------------------------------------------------------------------------
RET423's Profile: http://forums.opensuse.org/member.php?userid=43967
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
RET423
3/26/2010 2:36:01 AM
That acl error should be fixed eventually but the fatal error is the SSL
cert. I've not seen this before but then I don't use SSL with squid (not
even sure off the top of my head what for). fopen indicates it's a local
file. Is there some certificate that's not readable by the squid user?
You may have saved it as root and only root processes can read it.


-- 
ken_yap
------------------------------------------------------------------------
ken_yap's Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
ken
3/26/2010 6:06:01 AM
ken_yap;2142932 Wrote: 
> That acl error should be fixed eventually but the fatal error is the SSL
> cert. I've not seen this before but then I don't use SSL with squid (not
> even sure off the top of my head what for). fopen indicates it's a local
> file. Is there some certificate that's not readable by the squid user?
> You may have saved it as root and only root processes can read it.
I don't know, I set up squid and sarg from a user account but at every
step I had to enter the root password so it is possible.
Is there a folder or files where this SSl might be that I can change
permissions on? 
Do you think this might be connected somehow to squid not starting
correctly until the entire system is fully booted or just something that
should be delt with?


-- 
RET423
------------------------------------------------------------------------
RET423's Profile: http://forums.opensuse.org/member.php?userid=43967
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
RET423
3/26/2010 6:26:02 AM
I don't know how the SSL is involved but if squid refuses to start
without it, then you either should provide it or disable SSL. Not even
sure where the SSL comes in.

As for the subnet specification, I suspect your network is actually
192.168.9.0/255.255.255.0. The first part of the spec should be a
network address, not a host address.


-- 
ken_yap
------------------------------------------------------------------------
ken_yap's Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=435890

0
ken
3/26/2010 6:36:01 AM
Reply: