* bug#32934: privoxy daemon fails to start
@ 2018-10-04 20:02 Pierre Neidhardt
2020-06-15 9:41 ` bug#32934: [PATCH] gnu: privoxy: Fix default logging configuration Brice Waegeneire
0 siblings, 1 reply; 3+ messages in thread
From: Pierre Neidhardt @ 2018-10-04 20:02 UTC (permalink / raw)
To: 32934
[-- Attachment #1: Type: text/plain, Size: 4130 bytes --]
Currently privoxy can only be started in non-daemon mode:
--8<---------------cut here---------------start------------->8---
$ privoxy --no-daemon /gnu/store/d3q0nz8568j32gslkc3lskxpzmimcx9z-privoxy-3.0.26/etc/privoxy/config
--8<---------------cut here---------------end--------------->8---
In daemon mode, we get the following error:
--8<---------------cut here---------------start------------->8---
$ strace -f privoxy /gnu/store/d3q0nz8568j32gslkc3lskxpzmimcx9z-privoxy-3.0.26/etc/privoxy/config
...
clone(/home/ambrevar/.guix-profile/bin/strace: Process 11406 attached
child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fed1647ea10) = 11406
[pid 11406] set_robust_list(0x7fed1647ea20, 24 <unfinished ...>
[pid 11405] nanosleep({tv_sec=1, tv_nsec=0}, <unfinished ...>
[pid 11406] <... set_robust_list resumed> ) = 0
[pid 11406] setsid() = 11406
[pid 11406] close(0) = 0
[pid 11406] close(1) = 0
[pid 11406] openat(AT_FDCWD, "/dev/null", O_RDONLY) = 0
[pid 11406] openat(AT_FDCWD, "/dev/null", O_WRONLY) = 1
[pid 11406] chdir("/") = 0
[pid 11406] stat("/gnu/store/d3q0nz8568j32gslkc3lskxpzmimcx9z-privoxy-3.0.26/etc/privoxy/config", {st_mode=S_IFREG|0444, st_size=68434, ...}) = 0
[pid 11406] brk(NULL) = 0x6b2000
[pid 11406] brk(0x6d3000) = 0x6d3000
[pid 11406] openat(AT_FDCWD, "/gnu/store/d3q0nz8568j32gslkc3lskxpzmimcx9z-privoxy-3.0.26/etc/privoxy/config", O_RDONLY) = 3
[pid 11406] fstat(3, {st_mode=S_IFREG|0444, st_size=68434, ...}) = 0
[pid 11406] read(3, "# Sample Configuration Fi"..., 4096) = 4096
[pid 11406] read(3, "# The best all purpose solu"..., 4096) = 4096
[pid 11406] read(3, "et:\n#\n# The templates are a"..., 4096) = 4096
[pid 11406] read(3, "#\n# Default value:\n#\n# Uns"..., 4096) = 4096
[pid 11406] read(3, "tten to the network\n# deb"..., 4096) = 4096
[pid 11406] read(3, " machines (e.g. on\n# your l"..., 4096) = 4096
[pid 11406] read(3, "(e.g Java) is also\n# capabl"..., 4096) = 4096
[pid 11406] read(3, "[:port][/dst_masklen]]\n#\n# "..., 4096) = 4096
[pid 11406] read(3, "\n# an IPv4 address (not sup"..., 4096) = 4096
[pid 11406] read(3, "roxy but are made directly to th"..., 4096) = 4096
[pid 11406] read(3, "voxy and Tor, both running on th"..., 4096) = 4096
[pid 11406] read(3, "ifies:\n#\n# Whether requests"..., 4096) = 4096
[pid 11406] read(3, "ing on the client connection is "..., 4096) = 4096
[pid 11406] read(3, "he \"No server or forwarder data\""..., 4096) = 4096
[pid 11406] read(3, " resources are being blocke"..., 4096) = 4096
[pid 11406] read(3, " |\n# |-----------"..., 4096) = 4096
[pid 11406] read(3, " client's IP address from\n# "..., 4096) = 2898
[pid 11406] read(3, "", 4096) = 0
[pid 11406] close(3) = 0
[pid 11406] openat(AT_FDCWD, "/gnu/store/d3q0nz8568j32gslkc3lskxpzmimcx9z-privoxy-3.0.26/var/log/privoxy/logfile", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EACCES (Permission denied)
[pid 11406] close(2) = 0
[pid 11406] openat(AT_FDCWD, "/gnu/store/d3q0nz8568j32gslkc3lskxpzmimcx9z-privoxy-3.0.26/var/log/privoxy/logfile", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EACCES (Permission denied)
[pid 11406] exit_group(1) = ?
[pid 11406] +++ exited with 1 +++
<... nanosleep resumed> {tv_sec=0, tv_nsec=998431322}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11406, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
restart_syscall(<... resuming interrupted nanosleep ...>) = 0
wait4(11406, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 11406
exit_group(1) = ?
+++ exited with 1 +++
--8<---------------cut here---------------end--------------->8---
We probably need to patch privoxy so that it writes the logfile to
/var/log/privoxy/logfile instead of inside the store.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#32934: [PATCH] gnu: privoxy: Fix default logging configuration.
2018-10-04 20:02 bug#32934: privoxy daemon fails to start Pierre Neidhardt
@ 2020-06-15 9:41 ` Brice Waegeneire
2020-06-18 7:40 ` Pierre Neidhardt
0 siblings, 1 reply; 3+ messages in thread
From: Brice Waegeneire @ 2020-06-15 9:41 UTC (permalink / raw)
To: Pierre Neidhardt; +Cc: 32934
Fixes <https://issues.guix.info/32934>.
* gnu/packages/tor.scm (privoxy)[arguments]<configure-flags>: Add
'localstatedir'.
<phases>: Add 'patch-default-logging'.
---
Hello Pierre,
This patch should allow one to use privoxy's default configuration as is:
--8<---------------cut here---------------start------------->8---
$ /gnu/store/1705l8br2bc4lvs7wf7mpzj4ss0zkl9c-privoxy-3.0.28/sbin/privoxy /gnu/store/1705l8br2bc4lvs7wf7mpzj4ss0zkl9c-privoxy-3.0.28/etc/privoxy/config
$ echo $?
0
--8<---------------cut here---------------end--------------->8---
- Brice
gnu/packages/tor.scm | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index 2f2623b0e6..19ab5cf374 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
+;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -141,8 +142,28 @@ rejects UDP traffic from the application you're using.")
;; $out/etc/privoxy.
#:configure-flags (list (string-append "--sysconfdir="
(assoc-ref %outputs "out")
- "/etc/privoxy"))
- #:tests? #f))
+ "/etc/privoxy")
+ "--localstatedir=/var")
+ #:tests? #f ; no test suite
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-default-logging
+ (lambda _
+ (with-fluids ((%default-port-encoding "ISO-8859-1"))
+ ;; Do not create /var/run nor /var/log/privoxy/logfile.
+ (substitute* "GNUmakefile.in"
+ (("(logfile \\|\\| exit )1" _ match)
+ (string-append match "0"))
+ (("(\\$\\(DESTDIR\\)\\$\\(SHARE_DEST\\)) \\\\" _ match)
+ match)
+ ((".*\\$\\(LOG_DEST\\) \\$\\(DESTDIR\\)\\$\\(PID_DEST\\).*")
+ ""))
+ ;; Disable logging in the default configuration to allow for
+ ;; non-root users using it as is.
+ (substitute* "config"
+ (("^logdir") "#logdir")
+ (("^logfile") "#logfile")))
+ #t)))))
(inputs
`(("w3m" ,w3m)
("pcre" ,pcre)
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#32934: [PATCH] gnu: privoxy: Fix default logging configuration.
2020-06-15 9:41 ` bug#32934: [PATCH] gnu: privoxy: Fix default logging configuration Brice Waegeneire
@ 2020-06-18 7:40 ` Pierre Neidhardt
0 siblings, 0 replies; 3+ messages in thread
From: Pierre Neidhardt @ 2020-06-18 7:40 UTC (permalink / raw)
To: Brice Waegeneire; +Cc: 32934
[-- Attachment #1: Type: text/plain, Size: 129 bytes --]
Thanks a lot!
Tested and pushed as e418c3d076ec301a2deda42568035d75f5ed174d.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-18 7:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 20:02 bug#32934: privoxy daemon fails to start Pierre Neidhardt
2020-06-15 9:41 ` bug#32934: [PATCH] gnu: privoxy: Fix default logging configuration Brice Waegeneire
2020-06-18 7:40 ` Pierre Neidhardt
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).