You are not logged in.
Hi All,
[att moderators] Yes, this is running on a Raspberry, but its a general problem that I can't get a resolution from from the ARM forums, please allow your gurus to help!
My arch distro is running fine, and it can run every other package and systemctl script, but this privoxy one just does not work, and I don't know what's wrong.
I've tried all sorts of things, even straced it, but can't see whats wrong.
The current privoxy.service file looks like:
[Unit]
Description=Privoxy Web Proxy With Advanced Filtering Capabilities
After=network.target
[Service]
Type=forking
PIDFile=/run/privoxy.pid
ExecStart=/usr/bin/privoxy /etc/privoxy/config
SuccessExitStatus=1
PrivateDevices=yes
[Install]
WantedBy=multi-user.target
and the error is:
# systemctl status privoxy.service
* privoxy.service - Privoxy Web Proxy With Advanced Filtering Capabilities
Loaded: loaded (/etc/systemd/system/privoxy.service; enabled)
Active: failed (Result: resources) since Mon 2014-08-11 20:22:29 EST; 7min ago
Process: 19762 ExecStart=/usr/bin/privoxy /etc/privoxy/config (code=exited, status=1/FAILURE)
Offline
Have you tried https://wiki.archlinux.org/index.php/Sy … emd_errors?
Offline
Have you tried https://wiki.archlinux.org/index.php/Sy … emd_errors?
Thanks, I have tried the suggestions there, but the suggested path (using journalctl) doesn't produce any useful results.
systemctl status privoxy
* privoxy.service - Privoxy Web Proxy With Advanced Filtering Capabilities
Loaded: loaded (/etc/systemd/system/privoxy.service; enabled)
Active: failed (Result: resources) since Mon 2014-08-11 21:18:24 EST; 28s ago
Process: 20267 ExecStart=/usr/bin/privoxy /etc/privoxy/config (code=exited, status=1/FAILURE)
[root@alarmpi ~]# journalctl -b _PID=20267
-- Logs begin at Thu 1970-01-01 10:00:03 EST, end at Sat 2014-08-09 22:27:55 EST. --
Offline
Is there a reason you are not using the service file included with the package? If so, you should still look at that service file to see what yours is missing.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Is there a reason you are not using the service file included with the package? If so, you should still look at that service file to see what yours is missing.
Thanks, there is no reason apart from it doesn't work. It has some extra declarations but I don't think they are the problem.
To clarify, this works when run from root:
# privoxy /etc/privoxy/config
The daemon starts up and runs fine, for days or weeks.
But I can't get systemctl to run it. I think it might be a permissions error? Would systemctl run the process using a different user? I'm not sure how to debug that...
Last edited by emdeex (2014-08-14 08:39:46)
Offline
*headdesk* well, start by using the provided service file then report any errors you get with that.
There are bits of the included service file that are different from yours that would really matter. The most obvious is the SuccessExitStatus. It's no wonder systemd reports that yours failed because the exit code of the process doesn't match what you indicates it should provide on success.
As to why the included service file might not work for you, I have no idea - and no one could have any idea unless you tell us about those errors.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
*headdesk* well, start by using the provided service file then report any errors you get with that.
.
Thanks, *palmhead*. ...
Using the package service file...
# systemctl start privoxy
Job for privoxy.service failed. See 'systemctl status privoxy.service' and 'journalctl -xn' for details.
# systemctl status privoxy.service
* privoxy.service - Privoxy Web Proxy With Advanced Filtering Capabilities
Loaded: loaded (/etc/systemd/system/privoxy.service; enabled)
Active: failed (Result: exit-code) since Mon 2014-08-11 21:56:10 EST; 5s ago
Process: 20529 ExecStart=/usr/bin/privoxy --pidfile /run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config (code=exited, status=1/FAILURE)
Offline
Most likely the privoxy log file and/or log file directory defined in your config are not owned by privoxy.privoxy
(Caused by you manually running privoxy without the --user switch)
Offline
Most likely the privoxy log file and/or log file directory defined in your config are not owned by privoxy.privoxy
(Caused by you manually running privoxy without the --user switch)
Sounds good. But log file dir and file look OK.
ls -la /var/log/privoxy/
total 8
drwx------ 2 privoxy privoxy 4096 Aug 11 21:53 .
drwxr-xr-x 5 root root 4096 Aug 11 21:53 ..
-rw-r--r-- 1 privoxy privoxy 0 Aug 11 21:53 logfile
Offline
Try calling it this way from root shell, as this is how systemd calls it:
/usr/bin/privoxy --pidfile /run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config
Offline
Try calling it this way from root shell, as this is how systemd calls it:
/usr/bin/privoxy --pidfile /run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config
Executing that command, returns nothing. No error message. No process starts. Not sure where to look for the error.
Offline
I just noticed that your working command uses /etc/config/privoxy, but the systemd service file uses /etc/privoxy/config.
In any case, it is no longer a systemd issue, just privoxy. A few things to try if your problem persists after reconciling the config file issue:
1) Output should go to the logfile, /var/log/privoxy/logfile by default if it could be opened. You may try --no-daemon to make output go to the terminal, but this may not work in combination with --user.
2) Reinstall the privoxy package
3) Since "privoxy /etc/config/privoxy" works but "/usr/bin/privoxy --pidfile /run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config" does not, test to see which difference is causing the failure.
4) run 'echo $?' directly after trying to run privoxy to print the return value, this may give a clue.
Offline
I just noticed that your working command uses /etc/config/privoxy, but the systemd service file uses /etc/privoxy/config.
Thanks for that pickup, had me scratching my head, but it was just a typo.. I hadn't been using that actual command in real life
I'm narrowing it down to something with the user.
4) run 'echo $?' directly after trying to run privoxy to print the return value, this may give a clue.
Running the same command without the --user flag executes with a 0 return (success). Running with the --user privoxy.privoxy flag gives a 1 response (fail)
Running it with --no-daemon is weird... it runs as user privoxy, but of course doesn't become a daemon which is what I need.
# /usr/bin/privoxy --no-daemon --pidfile /run/privoxy.pid --user privoxy.privoxy /etc/privoxy/config
2014-08-14 19:05:11.090 b6fbd000 Info: Privoxy version 3.0.21
2014-08-14 19:05:11.091 b6fbd000 Info: Program name: /usr/bin/privoxy
It's annoying that the binary or journalctl doesn't show any log messages when it fails with a 1 return code.
Would pastebin'ing two straces outputs of each command be of any use to anyone? I can see the differences, but can't yet decode whats going on.
Last edited by emdeex (2014-08-14 12:09:22)
Offline
Probably ukhippo was on the right track. File permissions or some such.
Try to run privoxy as the privoxy user:
# as root
su privoxy --shell=/usr/bin/bash
/usr/bin/privoxy /etc/privoxy/config
If the above fails, check the permissions of the following files, as well as the permissions of the directories they reside in (from the privoxy man page):
/etc/privoxy/config
/etc/privoxy/match-all.action
/etc/privoxy/default.action
/etc/privoxy/user.action
/etc/privoxy/default.filter
/etc/privoxy/user.filter
/etc/privoxy/trust
/etc/privoxy/templates/*
/var/log/privoxy/logfile
Offline
Probably ukhippo was on the right track. File permissions or some such.
Try to run privoxy as the privoxy user:
# as root su privoxy --shell=/usr/bin/bash /usr/bin/privoxy /etc/privoxy/config
If I do this.. and run it exists with a 1 return. No logs or error messages.
If I run it with --no-deamon it runs OK
Offline
#!/bin/sh
#### Trying to connect using privoxy and tor
echo " Trying to connect to connect anonimously"
echo
cd /etc/privoxy
sudo /usr/sbin/privoxy
sudo /usr/sbin/rctor start
echo
sudo netstat -tulpn | grep :
echo
echo "Thank you "
Offline