[PC-BSD Commits] r4126 - in pbibuild/modules/servers/squid3: . kmenu-dir overlay-dir overlay-dir/services/squid

svn at pcbsd.org svn at pcbsd.org
Mon Jun 22 09:50:24 PDT 2009


Author: kris
Date: 2009-06-22 09:50:21 -0700 (Mon, 22 Jun 2009)
New Revision: 4126

Added:
   pbibuild/modules/servers/squid3/kmenu-dir/squid-readme
   pbibuild/modules/servers/squid3/kmenu-dir/squid-website
   pbibuild/modules/servers/squid3/overlay-dir/README
Removed:
   pbibuild/modules/servers/squid3/kmenu-dir/squid
Modified:
   pbibuild/modules/servers/squid3/build.sh
   pbibuild/modules/servers/squid3/overlay-dir/PBI.RemoveScript.sh
   pbibuild/modules/servers/squid3/overlay-dir/PBI.SetupScript.sh
   pbibuild/modules/servers/squid3/overlay-dir/services/squid/isRunning.sh
   pbibuild/modules/servers/squid3/overlay-dir/squid.png
   pbibuild/modules/servers/squid3/pbi.conf
Log:

Updated squid3 module, now works great!



Modified: pbibuild/modules/servers/squid3/build.sh
===================================================================
--- pbibuild/modules/servers/squid3/build.sh	2009-06-22 16:11:48 UTC (rev 4125)
+++ pbibuild/modules/servers/squid3/build.sh	2009-06-22 16:50:21 UTC (rev 4126)
@@ -8,3 +8,6 @@
 # MODULEDIR = The location of the module directory for this PBI
 #   PORTVER = Version number of the port we used to build
 ##############################################################################
+
+# Make sure we set 755 on our services scripts
+chmod 755 ${PBIDIR}/services/squid/*.sh

Modified: pbibuild/modules/servers/squid3/overlay-dir/PBI.RemoveScript.sh
===================================================================
--- pbibuild/modules/servers/squid3/overlay-dir/PBI.RemoveScript.sh	2009-06-22 16:11:48 UTC (rev 4125)
+++ pbibuild/modules/servers/squid3/overlay-dir/PBI.RemoveScript.sh	2009-06-22 16:50:21 UTC (rev 4126)
@@ -7,7 +7,10 @@
 # TIP: 'kdialog' should be used for user interaction. 
 #########################################
 
+# Stop squid first
 /Programs/rc.d/squid stop
+killall -9 squid
+
 rm -f /PCBSD/Services/squid
 rm -f /Programs/rc.d/squid
 

Modified: pbibuild/modules/servers/squid3/overlay-dir/PBI.SetupScript.sh
===================================================================
--- pbibuild/modules/servers/squid3/overlay-dir/PBI.SetupScript.sh	2009-06-22 16:11:48 UTC (rev 4125)
+++ pbibuild/modules/servers/squid3/overlay-dir/PBI.SetupScript.sh	2009-06-22 16:50:21 UTC (rev 4126)
@@ -16,18 +16,16 @@
 echo "SETSETPS: 1"
 echo "MSG: Configurating"
 
-# Make the squid logs directory
-mkdir -p /Programs/${PROGDIR}/squid/logs >/dev/null 2>/dev/null
-
 # Make the squid conf directory 
 mkdir -p /Programs/etc/squid >/dev/null 2>/dev/null
 
 # Setup our default configs
-for i in "squid.conf cachemgr.conf mime.conf msntauth.conf"
+SQUIDCONF="squid.conf cachemgr.conf mime.conf msntauth.conf"
+for i in ${SQUIDCONF}
 do
   if [ ! -e "/Programs/etc/squid/${i}" ]
   then
-    cp /Programs/${PROGDIR}/etc/squid/${i}.dist /Programs/etc/squid/${i}
+    cp /Programs/${PROGDIR}/etc/squid/${i}.default /Programs/etc/squid/${i}
   fi
   ln -s /Programs/etc/squid/${i} /Programs/${PROGDIR}/etc/squid/${i}
 done
@@ -40,10 +38,65 @@
 echo "SETSETPS: 2"
 echo "squid_enable=\"YES\"" >> /etc/rc.conf
 
+# Lets setup the squid user / group now
+############################################################################
+if [ -x /usr/sbin/nologin ]; then
+        nologin=/usr/sbin/nologin
+else
+        nologin=/sbin/nologin
+fi
+squid_user="squid"
+squid_group="squid"
+squid_gid=100
+squid_uid=100
+if ! pw groupshow ${squid_group} -q >/dev/null ; then
+          echo "There is no group '${squid_group}' on this system, so I will try to create it (using group id ${squid_gid}):"
+          if ! pw groupadd ${squid_group} -g ${squid_gid} -q ; then
+                  echo "Failed to create group \"${squid_group}\"!" >&2
+                  echo "Please create it manually." >&2
+          fi
+else
+  echo "I will use the existing group '${squid_group}':"
+fi
+pw groupshow ${squid_group}
+
+
+if ! pw usershow ${squid_user} -q >/dev/null ; then
+  echo "There is no account '${squid_user}' on this system, so I will try to create it (using user id ${squid_uid}):"
+  if ! pw useradd -q -n ${squid_user} \
+    -u ${squid_uid} -g ${squid_group} \
+    -c "Squid caching-proxy pseudo user" \
+    -d "${squid_base}" -s "${nologin}" \
+    -h - ; then
+    echo "Failed to create user '${squid_user}'!" >&2
+    echo "Please create it manually." >&2
+  else
+    echo "User '${squid_user}' created successfully:"
+  fi
+else
+  echo "I will use the existing user '${squid_user}':"
+fi
+
+############################################################################
+
+# Make the squid logs directory
+mkdir -p /Programs/${PROGDIR}/squid/logs >/dev/null 2>/dev/null
+mkdir -p /Programs/${PROGDIR}/squid/cache >/dev/null 2>/dev/null
+# Chown these directories
+chown -R squid:squid /Programs/${PROGDIR}/squid
+
+
+
 echo "SETSETPS: 3"
 echo "MSG: Starting squid service"
+# Start by creating our cache data for the first time
+/Programs/${PROGDIR}/sbin/squid -z
+
+# Start squid
 /Programs/rc.d/squid start
 
 echo "MSG: Finished!"
 echo "SETSETPS: 4"
 
+kdialog --msgbox "Squid has been installed and started. Please see the README for more information on usage"
+

Modified: pbibuild/modules/servers/squid3/overlay-dir/services/squid/isRunning.sh
===================================================================
--- pbibuild/modules/servers/squid3/overlay-dir/services/squid/isRunning.sh	2009-06-22 16:11:48 UTC (rev 4125)
+++ pbibuild/modules/servers/squid3/overlay-dir/services/squid/isRunning.sh	2009-06-22 16:50:21 UTC (rev 4126)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # This script checks if a service is currently running
 # Return a "0" if the service is running, or a "1" if it is stopped
-ps -x | grep -v "grep" | grep squid
+ps -auwx | grep -v "grep" | grep squid
 if [ "$?" = "0" ]
 then
   exit 0

Modified: pbibuild/modules/servers/squid3/overlay-dir/squid.png
===================================================================
(Binary files differ)

Modified: pbibuild/modules/servers/squid3/pbi.conf
===================================================================
--- pbibuild/modules/servers/squid3/pbi.conf	2009-06-22 16:11:48 UTC (rev 4125)
+++ pbibuild/modules/servers/squid3/pbi.conf	2009-06-22 16:50:21 UTC (rev 4126)
@@ -32,7 +32,7 @@
 
 # Build Key - Change this to anything else to trigger a rebuild 
 #           - The rebuild will take place even if port is still the same ver
-BUILDKEY="01"
+BUILDKEY="02"
 
 # If this port has a non-standard port version variable in Makefile, then
 # list the key here such as "OOOVERSION="



More information about the Commits mailing list