talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Privoxy

Sat Apr 27, 2013 8:02 am

I have Privoxy running nicely on my Pi having followed the excellent LifeHacker article. However, when starting up the Pi afresh, or after rebooting, the Privoxy service does not restart and I have to SSH in to do so manually. Can some kind soul suggest a way to remedy that, please?

nadir
Posts: 112
Joined: Sun Jun 10, 2012 5:45 am

Re: Privoxy

Sat Apr 27, 2013 6:59 pm

What i would do, as an easy solution, is install

Code: Select all

apt-get install sysv-rc-config
run it as root and check if privoxy is listed in the second runlevel (second row). If not enable it.

If that doesn't work i would try

Code: Select all

apt-get install bootlogd
I think in the past one had to enable it by editing /etc/bootlogd
Now i can't find said file, man page doesn't say how to do it, so i would use sysv-rc-conf.

Reboot and read the log /var/log/boot

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: Privoxy

Sat Apr 27, 2013 9:21 pm

Hi Nadir

Thanks for your reply. There's no package for sysv-rc-config so tired bootlogd. The logs shows no sign of Privoxy.

Not sure where we go from here?

nadir
Posts: 112
Joined: Sun Jun 10, 2012 5:45 am

Re: Privoxy

Sun Apr 28, 2013 5:26 am

Edit: Duh. My fault. Package name is:

Code: Select all

sysv-rc-conf
You can ignore the rest if that is the problem (i assume that).

I am a bit puzzled that sysv-rc-conf can't be installed. Perhaps double check that (I use it on my raspian and debian images on raspberry).

sysv-rc-conf is just a frontend, and easy to use. I know there are manual ways to do it, but i don't know them as i always use sysv-rc-conf.
A quick search for " Debian how to enable services" or "raspberry how to enable service gave some results, for example this:
http://www.raspberrypi.org/phpBB3/viewt ... 31&t=23491
But i would rather wait for someone who knows for sure
(You could check what you find in
ls -l /etc/rc2.d
and
ls -l /etc/init.d
in the meantime, perhaps piping the output to grep
ls -l /etc/rc2.d | grep privoxy
)

You probably know this, but this shouldn't be necessary. Usually you install it and it get's added automatically.

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: Privoxy

Sun Apr 28, 2013 8:38 am

Hi

I now have sysv-rc-conf running now, thanks. It shows Privoxy running as a level 2 service but I still have to start Privoxy over Putty/SSH by typing

Code: Select all

 service privoxy start
or

Code: Select all

 /etc/init.d/privoxy start
I don't understand why that's necessary.

.

tsusan
Posts: 11
Joined: Sat Apr 20, 2013 7:38 am

Re: Privoxy

Sun Apr 28, 2013 9:46 am

Apparently privoxy is not started through the runlevels.

Since you can run

Code: Select all

# service privoxy start
all that needs to be done is adding privoxy to the runlevel.
For that you need update-rc.d.

See

Code: Select all

man update-rc.d
--
wq

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: Privoxy

Sun Apr 28, 2013 3:53 pm

I have tried adding Privoxy by updating

Code: Select all

update-rc.d.
but it still doesn't run at start up. Very strange. Could it be anything to do with user permissions?

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: Privoxy

Sun Apr 28, 2013 7:32 pm

I have found the problem, though not the solution.

Looking at the Privoxy log in var/log/privoxy there is a fatal error at boot time;
Fatal error: can't bind to 10.0.0.5:8118: Cannot assign requested address
I am running a VPN at that address which Privoxy cannot bind to. Any suggestions how to resolve this?

tsusan
Posts: 11
Joined: Sat Apr 20, 2013 7:38 am

Re: Privoxy

Mon Apr 29, 2013 8:03 am

talkeasy wrote:I have found the problem, though not the solution.

Looking at the Privoxy log in var/log/privoxy there is a fatal error at boot time;
Fatal error: can't bind to 10.0.0.5:8118: Cannot assign requested address
I am running a VPN at that address which Privoxy cannot bind to. Any suggestions how to resolve this?
Make sure the interface is up when privoxy starts (but you knew that :) use update-rc.d to make sure that the VPN starts before privoxy starts.

you can check the runlevel the system is running by entering:

Code: Select all

# runlevel

(most likely it's at runlevel 2)
Have a look at

Code: Select all

ls -l /etc/rc2.d/
Chances are that you VPN is started at the same moment or even after privoxy is started, resulting in the error you are running into.

update-rc.d will help you get the order right.

good luck!

--
:wq

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: Privoxy

Mon Apr 29, 2013 8:14 pm

Hi Tsusan

Yes, you're right. Privoxy is starting before the VPN (Neorouter). However, I cannot change the order. When I type

Code: Select all

update-rc.d -f privoxy defaults start 44
to change from 17, for example, it just changes back to 17 when I type

Code: Select all

ls -l /etc/rc?.d/*privoxy
What am I missing? Thanks.

tsusan
Posts: 11
Joined: Sat Apr 20, 2013 7:38 am

Re: Privoxy

Tue Apr 30, 2013 6:41 am

talkeasy wrote:<snip>When I type

Code: Select all

update-rc.d -f privoxy defaults start 44
to change from 17, for example, it just changes back to 17 when I type

Code: Select all

ls -l /etc/rc?.d/*privoxy
Remove privoxy first (it won't remove the script /etc/init.d/privoxy)

Code: Select all

# update-rc.d -f privoxy remove
and add it again at the desired sequence number:

Code: Select all

# update-rc.d privoxy defaults 44 56 
that should do the trick.

--
:wq

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: Privoxy

Wed May 01, 2013 6:24 pm

I am able to remove the service by typing

Code: Select all

# update-rc.d -f privoxy remove
But when i add privoxy back with a higher start number, such as

Code: Select all

update-rc.d -f privoxy defaults 25
when I run

Code: Select all

ls -l  /etc/rc2.d/
it returns to the default values of

Code: Select all

lrwxrwxrwx 1 root root  17 May  1 18:23 S01privoxy -> ../init.d/privoxy
How can I get privoxy to start at a higher order number?

tsusan
Posts: 11
Joined: Sat Apr 20, 2013 7:38 am

Re: Privoxy

Thu May 02, 2013 1:18 pm

Code: Select all

    update-rc.d -f privoxy defaults 25
thats not what it said in my example.
What are the results when you follow the example precisely?

--
:wq

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: Privoxy

Thu May 02, 2013 6:13 pm

I did try exactly as suggested, but posted the code incorrectly. Nevertheless I have tried again, but it still places Privoxy back at 17, not the new values. Could it be a permissions issue perhaps?

Code: Select all

lrwxrwxrwx 1 root root  17 May  2 18:57 S01privoxy -> ../init.d/privoxy

Thanks.

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: Privoxy

Sat May 04, 2013 1:25 pm

In the absence of a solution of how to successfully lower the boot order of the Privixy service to after Neorouter I devised a very British bodge job - yes cron jobs to the rescue.

In crontab I added

Code: Select all

@reboot sleep 60 && /etc/init.d/privoxy restart
This runs a cron job after a reboot (or cold boot) but first delays restarting the Privoxy service by 60 seconds to allow the other services to settle down. If anyone can find a way of moving Privoxy down the services load order that would be a preferable solution - so please still let me know.

tsusan
Posts: 11
Joined: Sat Apr 20, 2013 7:38 am

Re: Privoxy

Sun May 05, 2013 1:50 pm

Well, yes.

That is a solution.

I have done a bit of learning, no longer being able to rely on knowledge gained before, and found this:

http://wiki.debian.org/LSBInitScripts/D ... yBasedBoot

In Short:

Code: Select all

sudo vi /etc/init.d/privoxy
And add neorouter as a prerequisite for privoxy

Return to “Raspberry Pi OS”