squid unprivilleged

This commit is contained in:
Jean-François GUILLAUME 2025-06-13 13:08:26 +00:00
commit aec79126dc

View file

@ -40,7 +40,7 @@
(respawn-delay 10) (respawn-delay 10)
(start #~(make-forkexec-constructor (start #~(make-forkexec-constructor
(list (list
"/run/privileged/bin/squid" #$(file-append pkg "/sbin/squid")
"-f" #$config-file "-f" #$config-file
) )
#:pid-file #$pid-file #:pid-file #$pid-file
@ -50,6 +50,27 @@
#:resource-limits '((nofile 65535 65535)))) #:resource-limits '((nofile 65535 65535))))
(stop #~(make-kill-destructor))))))) (stop #~(make-kill-destructor)))))))
(define squid-privileged-shepherd-service
(match-lambda
(($ <squid-configuration> pkg port loglevel config-file pid-file log-file)
(list
(shepherd-service
(provision '(squid))
(documentation "Run squid.")
(requirement '(user-processes))
(respawn? #t)
(respawn-delay 10)
(start #~(make-forkexec-constructor
(list
"/run/privileged/bin/squid"
"-f" #$config-file
)
#:pid-file #$pid-file
#:log-file #$log-file
#:user (passwd:uid (getpwnam "squid"))
#:group (passwd:gid (getpwnam "squid"))
#:resource-limits '((nofile 65535 65535))))
(stop #~(make-kill-destructor)))))))
(define %squid-activation (define %squid-activation
#~(begin #~(begin