# Issues with privoxy [solved]

## artificio

Ever since ~nov 22nd (according to the log) privoxy hasn't been starting for me at boot. The log file has nothing in it since nov 22nd, and from what I can tell everything is peachy. Everything seems to be owned by what it should be, and the config file seems correct, it just won't start. I can start it as a user (I symlinked the config), and it listens on the correct port, but it doesn't work . Any ideas?Last edited by artificio on Fri Dec 23, 2005 11:40 pm; edited 1 time in total

----------

## PaulBredbury

Are you saying that it runs as a user, but not as root? /etc/init.d/privoxy contains:

```
start-stop-daemon --start --quiet --exec /usr/sbin/privoxy -- \

--pidfile /var/run/privoxy.pid \

--user privoxy.privoxy  /etc/privoxy/config 2>/dev/null
```

So check that the privoxy user and group exists. Re-emerge privoxy.

----------

## artificio

It runs either way. It's fine as long as I specify the config file. It just won't start as a service (be it at boot, or when I try /etc/init.d/privoxy start). 

```
cat /etc/passwd | cut -d":" -f1

...

privoxy

...
```

```
cat /etc/group

...

privoxy:x:408:

...
```

```
       start-stop-daemon --start --quiet --exec /usr/sbin/privoxy -- \

                --pidfile /var/run/privoxy.pid \

                --user privoxy.privoxy  /etc/privoxy/config 2>/dev/null
```

All seems to be there. I've tried emerging it several times, but that doesn't work. I'm going to try and emerge -C and remove all the config files for the heck of it. Thanks for the help btw! 

edit- unmerging and removing /etc/privoxy, then emerging didn't help. It only starts when I execute privoxy in a directory where the config is (or linked to), not as a service.   :Sad:  It must be a permission/ownership problem with the privoxy user or group...   :Confused: 

edit(eleventy billion)- The problem seems to be that privoxy can't open /var/log/privoxy/privoxy.log as privoxy.privoxy

```
Dec 17 01:57:29 Privoxy(-1210489152) Fatal error: init_error_log(): can't open logfile: /var/log/privoxy/privoxy.log

```

no matter what the permissions on /var/log/privoxy and it's contents (i.e. they are all rwx by rug and owned by privoxy privoxy).

Also found something akin

 *Quote:*   

>  ..apparently the process, which runs as wwwrun.nogroup lacks
> 
>  sufficient privileges to write to (or create if absent) the
> 
>  logfile. This problem is related to the way Privoxy was
> ...

 

but I'm not sure what the analogous process in Gentoo is.

----------

## PaulBredbury

Sounds weird. Try deleting the /var/log/privoxy directory.

----------

## artificio

I rm -R'd that, /etc/privoxy, deleted the user and group, emerge -C'd it, and finally emerged it again. And it's still being a PITA!

However, this

```
# start-stop-daemon --start --verbose --exec /usr/sbin/privoxy --pidfile /var/run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config

start-stop-daemon: user `privoxy.privoxy' not found
```

seems to imply that it's a problem with the group or user. Think this is bug report worthy?Last edited by artificio on Mon Dec 19, 2005 11:28 pm; edited 1 time in total

----------

## PaulBredbury

Did it create the user and group? Run the emerge again, and check for error messages near the start. The ebuild contains this:

```
pkg_setup() {

   enewgroup privoxy

   enewuser privoxy -1 -1 /etc/privoxy privoxy

}
```

----------

## artificio

After removing privoxy.privoxy, it seems to add everything correctly when I emerge it.

```
 * Adding group 'privoxy' to your system ...

 *  - Groupid: next available

 * Adding user 'privoxy' to your system ...

 *  - Userid: 102

 *  - Shell: /bin/false

 *  - Home: /etc/privoxy

 *  - Groups: privoxy
```

----------

## PaulBredbury

Are you compiling it with safe CFLAGS?

----------

## artificio

No.   :Very Happy: 

I suppose I could use a chroot jail to recompile my system with safe CFLAGS, just to see if they would make a difference.

----------

## PaulBredbury

Grr, you could have mentioned your unsafe CFLAGS in your original post, and spared me some effort.

----------

## artificio

Sorry about that.

----------

## artificio

One last thing, if you or anyone is still reading this. If I want to rebuild my system with sane (no) CFLAGS/stable packages, I would alter my /etc/make.conf appropriately, then run two emerge -e systems. Now would I need to run an emerge -e world to make sure my OS is completely sane? Or can I rebuild my system twice, and rebuild privoxy and all it's dependencies?

----------

## PaulBredbury

For the emerges, you're best using emwrap.

----------

## artificio

Holy Awesome PaulBredbury, thanks a bunch! I suppose we'll see if I'm a jackass for not mentioning Jackass!, or if this is a problem with privoxy. Hope I don't get any power outages for the next day or so...   :Very Happy: 

----------

## artificio

Aw crap, if this is what I think it is...   :Embarassed: 

I rebuild my entire system, removed the config files, and deleted privoxy.privoxy. I emerged it, with the exact same problems...

Then, for shits'n giggles, I changed to permissions on /var/log from 700 to 770. Lo and behold, privoxy works... the init script, as a user, the whole deal   :Laughing: 

Anyhoo, I was wondering what the permissions on /var/log should be? Can't privoxy cd into /var/log/privoxy without having /var/log +x for users?

----------

## PaulBredbury

My (as per the default) permissions on /var/log/ and /var/log/privoxy/ are:

```
drwxr-xr-x  13 root    root        4096 Dec 23 19:28 log

drwxr-x---  2  privoxy privoxy     4096 Apr 16  2005 privoxy
```

----------

## artificio

Well then, that must be the problem  :Embarassed: . I wonder why the pemissions on my /var/log weren't default, I don't recall changing them...

Thanks for the help, and my apologies for the run-around.   :Smile: 

----------

