help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Privoxy user config without hard-coded GNU store path?


From: Efraim Flashner
Subject: Re: Privoxy user config without hard-coded GNU store path?
Date: Sun, 6 Oct 2019 15:22:45 +0300
User-agent: Mutt/1.12.2 (2019-09-21)

On Sun, Oct 06, 2019 at 01:51:43PM +0200, Pierre Neidhardt wrote:
> Hi!
> 
> I start a privoxy daemon on login like this:
> 
> --8<---------------cut here---------------start------------->8---
> privoxy --no-daemon ~/.config/privoxy/config &
> --8<---------------cut here---------------end--------------->8---
> 
> ~/.config/privoxy/config contains essentially this:
> 
> 
> --8<---------------cut here---------------start------------->8---
> ## Mandatory options:
> confdir /gnu/store/b1nv74wiz4i32vracafmdqiij8y8p7il-privoxy-3.0.28/etc/privoxy
> logdir 
> /gnu/store/b1nv74wiz4i32vracafmdqiij8y8p7il-privoxy-3.0.28/var/log/privoxy
> 
> ## My options:
>        forward-socks5t   /               127.0.0.1:9050 .
> --8<---------------cut here---------------end--------------->8---
> 
> The problem is that the config won't stand an upgrade +
> garbage-collection of the old path.

The simple solution here is to change the lines to 
confdir /home/USER/.guix-profile/etc/privoxy
logdir /home/USER/log/privoxy

> 
> Ideally, we could have a Shepherd service to start and configure privoxy
> reliably.
> 
> Is there any other way to configure privoxy reliably?
> 

If you want an untested user shepherd service, here's one I've come up
with on the spot:

(define privoxy
  (make <service>
  #:provides '(privoxy)
  #:docstring "Privoxy filters outgoing internet connections"
  #:start (make-forkexec-constructor
            '("/var/guix/profiles/per-user/USER/current-guix/bin/privoxy" 
"--no-daemon" "/home/USER/.config/privoxy/config")
            #:log-file "/home/USER/log/privoxy/privoxy.log")
  #:stop (make-kill-destructor)
  #:respawn? #t))
(register-services privoxy)

And then you'd add that to your ~/.config/shepherd/init.scm

I have at the bottom of mine:
;; Send shepherd into the background
(action 'shepherd 'daemonize)

(for-each start '(syncthing kdeconnect))

and at the top:
(use-modules (shepherd service))


-- 
Efraim Flashner   <address@hidden>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]