# Dovecot: Permission denied - after reboot changed owner



## setevoy (May 12, 2012)

After every reboot I see in maillog:

```
May 10 10:17:57 akira dovecot: auth: Fatal: net_connect_unix(auth-worker) in directory
 /var/run/dovecot failed: Permission denied (euid=65534(nobody) egid=65534(nobody) missing +r perm:
 /var/run/dovecot/auth-worker, dir owned by 0:0 mode=0755)
```


This helps:

`chown nobody:nobody /var/run/dovecot/auth-worker`

because dovecot works under nobody.

Can somebody explain me - why does the owner change?

I have an idea to change owner with editing file /etc/mtree/BSD.var.dist, adding:


```
run
            named           uname=bind gname=bind
            ..
            ppp             gname=network mode=0770
            ..
            wpa_supplicant
            ..
            dovecot         uname=nobody gname=nobody
            ..
```

But after reboot - again:


```
# ls -la /var/run/
    total 66
    drwxr-xr-x   9 root        wheel         512 May 10 10:42 .
    drwxr-xr-x  26 root        wheel         512 May 10 13:41 ..
    ...
    drwxr-xr-x   4 root        wheel         512 May 10 10:42 dovecot
```


What do I do wrong?

P.S. sorry for my English


----------



## inky (May 24, 2012)

Hello, check Dovecot configuration files (usually this setting is in 10-master.conf). *H*ere you need to find service auth-worker and comment out 
	
	



```
user = root
```
 - after it it will run under the dovecot user. If you need it to run under nobody - just set it to nobody. 


```
service auth-worker {
  # Auth worker process is run as root by default, so that it can access
  # /etc/shadow. If this isn't necessary, the user should be changed to
  # $default_internal_user.
  #user = root
}
```

*H*ope it helps you.


----------



## setevoy (May 25, 2012)

Hi! Thanks for repl*y*, but:


```
# locate 10-master.conf
/usr/local/share/doc/dovecot/example-config/conf.d/10-master.conf
```

I think Dovecot dosen't use this file.

Then I make:
[cmd=]# less /usr/local/etc/dovecot/dovecot.conf | grep root[/cmd]

and there is nothing about root.

About auth-worker, here is part of dovecot.conf:


```
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener auth-master {
    mode = 0666
  }
  user = dovecot
}
```

But it do*es*n't help :-(


----------



## setevoy (May 25, 2012)

Maybe there is another configuration file from which Dovecot gets info?


----------

