packages: php-dirs/php-dirs.spec, php-dirs/php-session.sh (NEW) - rel 6; mo...

arekm arekm at pld-linux.org
Tue Aug 18 00:03:58 CEST 2009


Author: arekm                        Date: Mon Aug 17 22:03:58 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 6; more frequent and partially configurable garbage collecting

---- Files affected:
packages/php-dirs:
   php-dirs.spec (1.15 -> 1.16) , php-session.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/php-dirs/php-dirs.spec
diff -u packages/php-dirs/php-dirs.spec:1.15 packages/php-dirs/php-dirs.spec:1.16
--- packages/php-dirs/php-dirs.spec:1.15	Wed Jun 24 19:32:12 2009
+++ packages/php-dirs/php-dirs.spec	Tue Aug 18 00:03:52 2009
@@ -3,9 +3,10 @@
 Summary(pl.UTF-8):	Wspólne katalogi dla różnych wersji PHP
 Name:		php-dirs
 Version:	1.1
-Release:	5
+Release:	6
 License:	GPL
 Group:		Base
+Source0:	php-session.sh
 BuildRequires:	rpmbuild(macros) >= 1.461
 Requires(postun):	/usr/sbin/groupdel
 Requires(pre):	/usr/bin/getgid
@@ -14,8 +15,6 @@
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_tmpwatchdir	/etc/tmpwatch
-
 %description
 Common directories for PHP version 4 and version 5.
 
@@ -26,11 +25,10 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{php_data_dir}/tests,/var/run/php}
+install -d $RPM_BUILD_ROOT{%{php_data_dir}/tests,/etc/cron.hourly,/var/run/php}
 install -d $RPM_BUILD_ROOT%{_docdir}/phpdoc
 
-install -d $RPM_BUILD_ROOT%{_tmpwatchdir}
-echo '/var/run/php 720' > $RPM_BUILD_ROOT%{_tmpwatchdir}/php.conf
+install %{SOURCE0} $RPM_BUILD_ROOT/etc/cron.hourly
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -51,7 +49,7 @@
 # http needs only x for directory (otherwise it knows session file
 # names and can read it contents)
 %attr(730,root,http) %dir %verify(not group mode) /var/run/php
-%config(noreplace) %verify(not md5 mtime size) %{_tmpwatchdir}/php.conf
+%attr(755,root,root) %{_sysconfdir}/cron.hourly/php-session.sh
 
 %define	date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -59,6 +57,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.16  2009/08/17 22:03:52  arekm
+- rel 6; more frequent and partially configurable garbage collecting
+
 Revision 1.15  2009/06/24 17:32:12  arekm
 - rel 5; fix perm
 

================================================================
Index: packages/php-dirs/php-session.sh
diff -u /dev/null packages/php-dirs/php-session.sh:1.1
--- /dev/null	Tue Aug 18 00:03:58 2009
+++ packages/php-dirs/php-session.sh	Tue Aug 18 00:03:52 2009
@@ -0,0 +1,22 @@
+#!/bin/sh
+if [ -x /usr/bin/php.cli ] ; then
+	RUNTIME5=$(/usr/bin/php.cli -r 'echo 1+(int)(ini_get("session.gc_maxlifetime")/3600);' 2> /dev/null)
+elif [ -r /etc/php/php.ini ]; then
+	RUNTIME5=$(awk -F"=" '/^session.gc_maxlifetime[[:space:]]*=/ { t=sprintf("%d", 1+($2/3600)); print t;}' /etc/php/php.ini)
+fi
+
+if [ -x /usr/bin/php4.cli ] ; then
+	RUNTIME4=$(/usr/bin/php4.cli -r 'echo 1+(int)(ini_get("session.gc_maxlifetime")/3600);' 2> /dev/null)
+elif [ -r /etc/php4/php.ini ]; then
+	RUNTIME4=$(awk -F"=" '/^session.gc_maxlifetime[[:space:]]*=/ { t=sprintf("%d", 1+($2/3600)); print t;}' /etc/php4/php.ini)
+fi
+
+[ -z "$RUNTIME5" ] && RUNTIME5="1h"
+
+if [ -n "$RUNTIME5" ]; then
+	/usr/sbin/tmpwatch ${RUNTIME5} /var/run/php
+fi
+
+if [ -n "$RUNTIME4" -a "$RUNTIME5" != "$RUNTIME4" ]; then
+	/usr/sbin/tmpwatch ${RUNTIME4} /var/run/php
+fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-dirs/php-dirs.spec?r1=1.15&r2=1.16&f=u



More information about the pld-cvs-commit mailing list