# Unable to open "/var/run/tor.pid" [Solved]

## vvulfe

Just noticed this in the last day, but I'm unsure if if broke longer ago than that.

When tor starts at boot, it generates (in /var/log/tor/tor.log) the following error.

"[warn] write_pidfile(): Unable to open "/var/run/tor.pid" for writing: Permission denied"

I've tried following the instructions here, specifically:

```

touch /var/run/tor.pid

chown tor:tor /var/run/tor.pid
```

To no avail. If I touch the file and then start Tor, I'm not anonymized. If I touch the file, and then go so far as to restart the machine, tor.pid vanishes and the same error is generated.

I've got an odd feeling that this might have something to do with baselayout. I don't know why I think this, and to be honest, it's a conclusion beyond what I know about linux, but on the off-chance I'm right, I have the following settings in /etc/conf.d/rc

```

RC_COLDPLUG="no"

RC_NET_STRICT_CHECKING="lo"

```

The machine's got two network devices, both onboard. Eth0 and Ath0.

Thanks in advance!Last edited by vvulfe on Wed Jun 28, 2006 4:12 pm; edited 1 time in total

----------

## hpeters

The permissions of the /var/run directory only allow root to write to it and tor doesn't run as root so you can either change the permissions of the /var/run directory or you can do what i did and move the pid file to the /var/lib/tor directory.

Put this in your /etc/tor/torrc file:

PIDFile /var/lib/tor/tor.pid

----------

## vvulfe

Worked quite nicely to fix that error. 

Repairing the .pid error didn't fix the fact that Tor and Privoxy didn't seem to be talking, but a re-emerge of Tor and Privoxy, along with a reconfiguring of /etc/torrc, /etc/privoxy/config and /etc/privoxy/default.action according to the Gentoo Tor Wiki did.

Anonymized, and error-less. Thanks!   :Very Happy: 

*Shrug*

----------

