Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
de64f48d
Commit
de64f48d
authored
Oct 08, 2010
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes
#189
"Cleanup process slows down considerably the Apache server"
parent
13e86ea8
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
4 deletions
+60
-4
build/lemonldap-ng/Makefile
build/lemonldap-ng/Makefile
+4
-0
build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.cron.d
...d/lemonldap-ng/debian/liblemonldap-ng-handler-perl.cron.d
+4
-0
build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.install
.../lemonldap-ng/debian/liblemonldap-ng-handler-perl.install
+1
-0
build/lemonldap-ng/debian/rules
build/lemonldap-ng/debian/rules
+1
-0
modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm
...ldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm
+4
-3
modules/lemonldap-ng-handler/MANIFEST
modules/lemonldap-ng-handler/MANIFEST
+2
-0
modules/lemonldap-ng-handler/example/scripts/purgeLocalCache
modules/lemonldap-ng-handler/example/scripts/purgeLocalCache
+38
-0
modules/lemonldap-ng-handler/example/scripts/purgeLocalCache.cron.d
...monldap-ng-handler/example/scripts/purgeLocalCache.cron.d
+4
-0
modules/lemonldap-ng-portal/example/scripts/purgeCentralCache
...les/lemonldap-ng-portal/example/scripts/purgeCentralCache
+2
-1
No files found.
build/lemonldap-ng/Makefile
View file @
de64f48d
...
...
@@ -219,6 +219,7 @@ install_bin: install_conf_dir
# Binary install
@
install
-v
-d
$(RBINDIR)
@
cp
--preserve
=
mode
--remove-destination
\
${SRCHANDLERDIR}
/example/scripts/purgeLocalCache
\
${SRCPORTALDIR}
/example/scripts/purgeCentralCache
\
${SRCPORTALDIR}
/example/scripts/buildPortalWSDL
\
${SRCCOMMONDIR}
/scripts/convertConfig
\
...
...
@@ -355,6 +356,7 @@ install_handler_site: install_conf_dir
@
cp
--remove-destination
${SRCHANDLERDIR}
/example/MyHandlerZimbra.pm
${RHANDLERDIR}
@
cp
--remove-destination
${SRCHANDLERDIR}
/example/MyHandlerSympa.pm
${RHANDLERDIR}
@
cp
--remove-destination
${SRCHANDLERDIR}
/example/MyUpdateCookieHandler.pm
${RHANDLERDIR}
@
cp
--remove-destination
lemonldap-ng-handler/example/scripts/purgeLocalCache.cron.d
$(RCRONDIR)
/lemonldap-ng
@
rm
-rf
$$
(
find
$(RHANDLERDIR)
-type
d
-name
.svn
)
install_test_site
:
...
...
@@ -575,6 +577,7 @@ debian-diff:
@
$(DIFF)
lemonldap-ng-portal/example/cdc.pl
$(DIFFPREFIX)
/var/lib/lemonldap-ng/portal/cdc.pl
||
true
@
# Handler
@
$(DIFF)
lemonldap-ng-handler/lib/Lemonldap/NG/Handler
$(DIFFPREFIX)
/usr/share/perl5/Lemonldap/NG/Handler
||
true
@
$(DIFF)
lemonldap-ng-portal/example/scripts/purgeLocalCache
$(DIFFPREFIX)
/usr/share/lemonldap-ng/bin/purgeLocalCache
||
true
@
# Common
@
$(DIFF)
lemonldap-ng-common/lib/Lemonldap/NG/Common
$(DIFFPREFIX)
/usr/share/perl5/Lemonldap/NG/Common
||
true
@
$(DIFF)
lemonldap-ng-common/lib/Lemonldap/NG/Common.pm
$(DIFFPREFIX)
/usr/share/perl5/Lemonldap/NG/Common.pm
||
true
...
...
@@ -604,6 +607,7 @@ default-diff:
@
$(DIFF)
lemonldap-ng-handler/example/MyHandler.pm
$(LMPREFIX)
/handler/MyHandler.pm
||
true
@
$(DIFF)
lemonldap-ng-handler/example/MyHandlerZimbra.pm
$(LMPREFIX)
/handler/MyHandlerZimbra.pm
||
true
@
$(DIFF)
lemonldap-ng-handler/example/MyHandlerSympa.pm
$(LMPREFIX)
/handler/MyHandlerSympa.pm
||
true
@
$(DIFF)
lemonldap-ng-portal/example/scripts/purgeLocalCache
$(LMPREFIX)
/bin/purgeLocalCache
||
true
@
# Common
@
$(DIFF)
lemonldap-ng-common/lib/Lemonldap/NG/Common /usr/local/share/perl/5.10.0/Lemonldap/NG/Common
||
true
@
$(DIFF)
lemonldap-ng-common/lib/Lemonldap/NG/Common.pm /usr/local/share/perl/5.10.0/Lemonldap/NG/Common.pm
||
true
...
...
build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.cron.d
0 → 100644
View file @
de64f48d
#
#
Regular
cron
jobs
for
the
Lemonldap
::
NG
portal
#
1
*
*
*
*
www
-
data
test
-
x
/
usr
/
share
/
lemonldap
-
ng
/
bin
/
purgeLocalCache
&&
/
usr
/
share
/
lemonldap
-
ng
/
bin
/
purgeLocalCache
build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.install
View file @
de64f48d
/
usr
/
share
/
perl5
/
Lemonldap
/
NG
/
Handler
*
/
usr
/
share
/
man
/
man3
/
Lemonldap
::
NG
::
Handler
*
/
var
/
lib
/
lemonldap
-
ng
/
test
/
usr
/
share
/
lemonldap
-
ng
/
bin
/
purgeLocalCache
build/lemonldap-ng/debian/rules
View file @
de64f48d
...
...
@@ -101,6 +101,7 @@ binary-indep: build install
ln
-s
../../liblemonldap-ng-manager-perl/examples manager
&&
\
ln
-s
../../liblemonldap-ng-portal-perl/examples portal
chmod
+x debian/liblemonldap-ng-portal-perl
$(LMSHAREDIR)
bin/purgeCentralCache
chmod
+x debian/liblemonldap-ng-handler-perl
$(LMSHAREDIR)
bin/purgeLocalCache
# dh_installmenu
dh_installdebconf
# dh_installlogrotate
...
...
modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm
View file @
de64f48d
...
...
@@ -101,7 +101,8 @@ sub unserialize {
$v
=~
s/^'(.*)'$/$1/s
;
# Manage hashes
if
(
$k
=~
/^
(?
x:
if
(
$k
=~
/^
(?
x:
applicationList
|
authChoiceModules
|
CAS_proxiedServices
...
...
@@ -124,8 +125,8 @@ sub unserialize {
|
samlSPMetaDataXML
|
samlStorageOptions
)
$/
and
$v
||=
{}
and
not
ref
(
$v
)
)
and
$v
||=
{}
and
not
ref
(
$v
)
)
{
$conf
->
{
$k
}
=
{};
...
...
modules/lemonldap-ng-handler/MANIFEST
View file @
de64f48d
...
...
@@ -6,6 +6,8 @@ example/MyHandlerLog4Perl.pm
example/MyHandlerSympa.pm
example/MyHandlerZimbra.pm
example/MyUpdateCookieHandler.pm
example/scripts/purgeLocalCache
example/scripts/purgeLocalCache.cron.d
lib/Lemonldap/NG/Handler.pm
lib/Lemonldap/NG/Handler/AuthBasic.pm
lib/Lemonldap/NG/Handler/CDA.pm
...
...
modules/lemonldap-ng-handler/example/scripts/purgeLocalCache
0 → 100755
View file @
de64f48d
#!/usr/bin/perl
#=============================================================================
# Cleaner for LemonLDAP::NG: purge local handler cache
#
# This module is written to be used by cron to clean old sessions from
# Apache::Session. It does not works with Apache::Session::Memcached
#
# This is part of LemonLDAP::NG product, released under GPL
#=============================================================================
use
Lemonldap::NG::Common::
Conf
;
use
Lemonldap::NG::Common::Conf::
Constants
;
use
strict
;
my
$debug
=
0
;
#=============================================================================
# Load configuration
#=============================================================================
my
$lmconf
=
Lemonldap::NG::Common::
Conf
->
new
()
or
die
$
Lemonldap::NG::Common::Conf::
msg
;
my
$conf
=
$lmconf
->
getConf
or
die
"
Unable to get configuration ($!)
";
my
$localconf
=
$lmconf
->
getLocalConf
(
HANDLERSECTION
)
or
die
"
Unable to get local configuration ($!)
";
if
(
$localconf
)
{
$conf
->
{
$_
}
=
$localconf
->
{
$_
}
foreach
(
keys
%$localconf
);
}
print
"
Configuration loaded
\n
"
if
$debug
;
exit
0
unless
(
$conf
->
{
localStorage
}
);
eval
"
require
$conf
->{localStorage}
";
$conf
->
{
localStorageOptions
}
->
{
namespace
}
||=
"
lemonldap
";
$conf
->
{
localStorageOptions
}
->
{
default_expires_in
}
||=
600
;
my
$c
=
$conf
->
{
localStorage
}
->
new
(
$conf
->
{
localStorageOptions
}
);
$c
->
Purge
();
exit
0
;
modules/lemonldap-ng-handler/example/scripts/purgeLocalCache.cron.d
0 → 100644
View file @
de64f48d
#
#
Regular
cron
jobs
for
LemonLDAP
::
NG
#
1
*
*
*
*
__APACHEUSER__
[
-
x
__BINDIR__
/
purgeLocalCache
]
&&
__BINDIR__
/
purgeLocalCache
modules/lemonldap-ng-portal/example/scripts/purgeCentralCache
View file @
de64f48d
...
...
@@ -19,7 +19,8 @@ my $nb_purged = 0;
#=============================================================================
# Load configuration
#=============================================================================
my
$lmconf
=
Lemonldap::NG::Common::
Conf
->
new
();
my
$lmconf
=
Lemonldap::NG::Common::
Conf
->
new
()
or
die
$
Lemonldap::NG::Common::Conf::
msg
;
my
$conf
=
$lmconf
->
getConf
or
die
"
Unable to get configuration ($!)
";
my
$localconf
=
$lmconf
->
getLocalConf
(
PORTALSECTION
)
or
die
"
Unable to get local configuration ($!)
";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment