SquidGuard, no such file or directory, emergency mode



  • Hello this is my first post and I got a lot of information from these forums, Thank you,

    My problem
    We just upgraded to squid3 and the new squidGuard so that we could get Man in the middle.  The certificates are setup and under realtime when squid and squidGuard are started I can see https requests along with http.

    The squidGuard logs only show back several months when we had it running before.  Now nothing new shows up.

    In the console I ran

    [2.2.4-RELEASE][admin@pfsense.localdomain]/root: squidGuard start
    2015-09-01 07:49:11 [43612] /usr/local/bin/squidGuard: can't write to logfile /var/log/squidGuard/squidGuard.log
    2015-09-01 07:49:11 [43612] New setting: dbhome: /usr/local/share/examples/squidGuard/blacklists
    2015-09-01 07:49:11 [43612] New setting: logdir: /var/log/squidGuard
    2015-09-01 07:49:11 [43612] Added User: root
    2015-09-01 07:49:11 [43612] Added User: foo
    2015-09-01 07:49:11 [43612] Added User: bar
    2015-09-01 07:49:11 [43612] destblock good missing active content, set inactive
    2015-09-01 07:49:11 [43612] destblock local missing active content, set inactive
    2015-09-01 07:49:11 [43612] init domainlist /usr/local/share/examples/squidGuard/blacklists/porn/domains
    2015-09-01 07:49:11 [43612] /usr/local/share/examples/squidGuard/blacklists/porn/domains: No such file or directory
    2015-09-01 07:49:11 [43612] Going into emergency mode
    
    

    I see the dbhome: shows /usr/local/share/examples/squid
    but the folder /usr/local/share/examples does not exist.

    I have updated the blacklist on the GUI in squidGuard many times.  Completely removed all packages and reinstalled a couple of times.
    I dont know where the config file is for squidGuard to change the dbhome and even if i did I don't know what to change it to.

    Any help would be greatly appreciated.

    PFsense: 2.2.4-RELEASE (i386)
    squid3: 0.2.9
    squidGuard: 1.9.14

    Another note, the permission for squidGuard.log is
    -rw–-----  1 root    wheel  465090 Aug 31 09:57 squidGuard.log
    same as all the other log files, should i change it to 777?

    Thank you in advance, Brink



  • run
    squidGuard -d -u -c /usr/pbi/squidguard-i386/etc/squidGuard/squidGuard.conf



  • I ran the command you suggested by allxi and it looks like the db was updated but i am still getting the errors about missing files.  its as if when I run squidGuard start it overwrites the changes from before.

    [2.2.4-RELEASE][admin@pfsense.localdomain]/root: squidGuard -d -u -c /usr/pbi/squidguard-i386/etc/squidGuard/squidGuard.conf
    2015-09-08 06:53:32 [92845] New setting: logdir: /var/squidGuard/log
    2015-09-08 06:53:32 [92845] New setting: dbhome: /var/db/squidGuard
    2015-09-08 06:53:32 [92845] squidGuard 1.4 started (1441716812.433)
    2015-09-08 06:53:32 [92845] db update done
    2015-09-08 06:53:32 [92845] squidGuard stopped (1441716812.434)
    
    [2.2.4-RELEASE][admin@pfsense.localdomain]/root: squidGuard start
    2015-09-08 06:55:53 [34283] /usr/local/bin/squidGuard: can't write to logfile /var/log/squidGuard/squidGuard.log
    2015-09-08 06:55:53 [34283] New setting: dbhome: /usr/local/share/examples/squidGuard/blacklists
    2015-09-08 06:55:53 [34283] New setting: logdir: /var/log/squidGuard
    2015-09-08 06:55:53 [34283] Added User: root
    2015-09-08 06:55:53 [34283] Added User: foo
    2015-09-08 06:55:53 [34283] Added User: bar
    2015-09-08 06:55:53 [34283] destblock good missing active content, set inactive
    2015-09-08 06:55:53 [34283] destblock local missing active content, set inactive
    2015-09-08 06:55:53 [34283] init domainlist /usr/local/share/examples/squidGuard/blacklists/porn/domains
    2015-09-08 06:55:53 [34283] /usr/local/share/examples/squidGuard/blacklists/porn/domains: No such file or directory
    2015-09-08 06:55:53 [34283] Going into emergency mode
    
    

    Thank you for the suggestion allxi,

    Any other thoughts?



  • Same problem here. Some suggestions, please ?



  • Not sure its related, but have you tried?:

    "On all versions of Squid, if only blacklists have been configured, then at startup some important files/directories may not be set properly. Add at least one Custom Target Category with a site to pass or block and use it along with the blacklist entries to work around the problem."

    ( Source: https://doc.pfsense.org/index.php/SquidGuard_package#Troubleshooting )



  • Hello.

    I think there is no problem here. The errors you see only appear if you start squidGuard from command line without passing the right configuration file as a parameter. Try to start the service with the config file and the errors will disappear.



  • I had a similar problem, not trying the noisy man stuff, but here is what was causing me troubles:
    I had a group added to squidguard, everything working fine, added another group the same way and squidguard
    stopped working, although the service was started according to web-gui.

    Loking at:
    /var/squid/logs/cache.log

    two lines gave me the clue:
    /usr/local/bin/squidGuard: can't write to logfile /var/log/squidGuard/squidGuard.log
    … bunch of other useless stuff here
    syntax error in configfile /usr/pbi/squidguard-amd64/etc/squidGuard/squidGuard.conf line 24
    Going into emergency mode

    Then in squidGuard.conf aparently my second group was malformed, here is what the groups looked like:

    src group1{
            ip    192.168.1.30-192.168.1.40
            log block.log
    }
    src group2{
            domain    192.168.1.41-192.168.1.50 <--line 24
            log block.log
    }

    So I did the only logic thing to do, went to buy a couple of beers and deleted the second group, voala, squidguard is now working, I haven't tried to add the group again because I'm drunk, but I it is working do not mess with it.

    Pfsense 2.2.4-RELEASE, over Vmware 5.5
    Squid 0.3.4
    SquidGuard 1.9.15



  • Replacing domain with ip would have also fixed it.


Log in to reply