# Dansguardian won't run has anything BUT root

## Cheesegoduk

Hiya

I've just replaced our aging proxy servers with a much faster system and began the process of reinstalling gentoo on the system, everything appears to be working fine aside from Dansguardian

Upon starting I recieve the following error

```

Error opening/creating log file. (check ownership and access rights).

I am running as nobody and I am trying to open /var/log/dansguardian/access.log 
```

[/quote]

This error confuses me because nobody is the owner of the above file/folder, even after completly removing dansguardian and the folder above and reinstalling I'm hit by the same error  - I've tried running Dansguardian with other users(such as the squid user) with no success, which makes no sense because I even chmod'd 777 the folder to rule out permissions! The only user it seems to run perfectly has is the root user - Which is not really what I want an Internet proxying system to run as.

A post on the DG mailing list suggests running in debug mode to see the full output of DG - However this involves modifying the makefile and I've no idea where this is on a Gentoo system.

Thanks

Lee

----------

## GoofballJM1

I had the same problem.  It happened to me when I installed logrotate.  Logrotate sets up a rotation schedule for dansguardian, and so does dansguardian.  So when logrotate runs and recreates the new log file, it does it as a different user and different permissions, thus disallowing dansguardian running as nobody:nobody to access the log file.  Just  remove /etc/logrotate.d/dansguardian and you should be fine.  :Laughing: 

----------

## al

Trying to start Dansguardian, i get the following error:

```
 * Starting DansGuardian ...

Error opening/creating log file. (check ownership and access rights).

I am running as nobody and I am trying to open /var/log/dansguardian/access.log                       [ !! ]
```

The permissions for access.log are:

```
-rw-rw-rw-  1 nobody nobody 0 Jan 18 13:26 /var/log/dansguardian/access.log
```

I've tried two different versions of Dansguardian but still get the same error.

I found the following link with the same problem, but the answer given doesn't work for me: https://forums.gentoo.org/viewtopic-t-381543-highlight-dansguardian+starting.html

Can anyone help?

 :Sad: 

----------

## al

Shameless bump as i fell of the bottom of the page.

I still haven't resolved this.

/dansguardian and /dansguardian/access.log are both owned my nobody:nobody, yet nobody can't write to it.

can i change the user that dansguardian runs as instead?

 :Sad: 

----------

## thecooptoo

my setup is fine 

browser ->DG ->Squid->www

if it helps heres the conf files 

```
/var/log/dansguardian/access.log {

  rotate 4

  weekly

  missingok

  notifempty

  nocreate

  nocopy

  nocopytruncate

  nocompress

  postrotate

    /usr/sbin/dansguardian -r

  endscript

}

```

```
grenada dansguardian # grep ^[A-Za-z] /etc/dansguardian/dansguardian.conf

reportinglevel = 0

languagedir = '/etc/dansguardian/languages'

language = 'ukenglish'

loglevel = 2

logexceptionhits = on

logfileformat = 1

filterip =

filterport = 8080

proxyip = 127.0.0.1

proxyport = 3128

accessdeniedaddress = 'http://YOURSERVER.

nonstandarddelimiter = on

usecustombannedimage = 1

custombannedimagefile = '/etc/dansguardia

filtergroups = 1

filtergroupslist = '/etc/dansguardian/fil

bannediplist = '/etc/dansguardian/bannedi

exceptioniplist = '/etc/dansguardian/exce

banneduserlist = '/etc/dansguardian/banne

exceptionuserlist = '/etc/dansguardian/ex

showweightedfound = on

weightedphrasemode = 2

urlcachenumber = 1000

urlcacheage = 900

phrasefiltermode = 2

preservecase = 0

hexdecodecontent = 0

forcequicksearch = 0

reverseaddresslookups = off

reverseclientiplookups = off

createlistcachefiles = on

maxuploadsize = -1

maxcontentfiltersize = 256

usernameidmethodproxyauth = on

usernameidmethodntlm = off # **NOT IMPLEM

usernameidmethodident = off

preemptivebanning = on

forwardedfor = on

usexforwardedfor = off

logconnectionhandlingerrors = on

maxchildren = 120

minchildren = 8

minsparechildren = 4

preforkchildren = 6

maxsparechildren = 32

maxagechildren = 500

ipcfilename = '/tmp/.dguardianipc'

urlipcfilename = '/tmp/.dguardianurlipc'

nodaemon = off

nologger = off

softrestart = off

```

----------

## nixnut

merged above three posts here.

----------

