From ca3ab201d2cfedc7eba25d53ecb342f83b560671 Mon Sep 17 00:00:00 2001 From: fredbcode Date: Mon, 20 Dec 2021 19:12:06 +0100 Subject: [PATCH] try to run without root user --- Dockerfile | 10 +++++----- run.sh | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c4420d..367442c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,6 @@ RUN echo "deb-src http://deb.debian.org/debian bullseye main contrib" >> /etc/ap && ./configure \ --prefix=/usr \ --datadir=/usr/share/squid \ - --build=x86_64-linux-gnu \ --enable-cache-digests \ --includedir=/usr/include \ --program-prefix= \ @@ -22,14 +21,13 @@ RUN echo "deb-src http://deb.debian.org/debian bullseye main contrib" >> /etc/ap --enable-icap-support \ --enable-async-io \ --with-pthreads \ - --with-winbind \ + --with-winbind \ --bindir=/usr/sbin \ --sbindir=/usr/sbin \ --with-squid=/usr/lib/squid \ --disable-ipv6 \ --enable-ltdl-convenience \ --enable-http-violations \ - build_alias="x86_64-linux-gnu" \ CFLAGS="-g -O2 -g -Wall -O2" \ LDFLAGS= \ CPPFLAGS= \ @@ -46,13 +44,15 @@ RUN echo "deb-src http://deb.debian.org/debian bullseye main contrib" >> /etc/ap --enable-auth-digest="LDAP" \ --enable-auth-ntlm \ --enable-auth-negotiate \ - --enable-negotiate-auth-helpers \ - --with-krb5-config=yes \ + --enable-negotiate-auth-helpers \ + --with-krb5-config=yes \ --enable-icap-client \ --sysconfdir=/etc/squid \ --with-filedescriptors=48000 \ --enable-delay-pools \ --with-large-files \ + --with-pidfile=/tmp \ + --with-default-user=squid \ --enable-removal-policies="lru,heap" \ && make \ && find /tmp/ -type f -name "Makefil*" -delete \ diff --git a/run.sh b/run.sh index d78b2ca..93115df 100644 --- a/run.sh +++ b/run.sh @@ -1,8 +1,8 @@ #!/bin/bash -if [ -e "/run/squid.pid" ];then +if [ -e "/tmp/$HOSTNAME.pid" ];then echo "Squid pid: Already running ?" - rm /run/squid.pid + rm /tmp/$HOSTNAME.pid pkill squid exit 1 fi @@ -17,7 +17,7 @@ else touch "/var/spool/squid/$HOSTNAME" fi -while test -e /var/run/squid.pid +while test -e /tmp/$HOSTNAME.pid do echo "cache is generated/checked" sleep 1