tags 828843 + patch

Here is a (trivial) patch against the current git.

My tests show no problem with this config so far (it just prevents find
to take into account links to point to anything that isn't a regular file).

Cheers,

-- 
nodens

Le 28/06/2016 à 14:36, Clément Hermann a écrit :
> Package: php5-common
> Version: 5.6.22+dfsg-1
> Severity: normal
>
> Hi,
>
> in some cases (here: joyent smartos LX zone), there could be broken
> links in /proc/<pid>/fd. On LX zones, for instance, deleted files still
> show a fd link but no destination (on a proper linux kernel, it would
> say "deleted: <path to deleted file>").
>
> This causes (harmless) errors in the session clean script cron job. It's
> easy to fix by adding "-xtype f" to the find command arguments, to
> prevent find to take broken link into account.
>
> Thanks !
>


-- 
Clément (nodens)

diff --git a/debian/sessionclean b/debian/sessionclean
index 059391f..6dadc36 100644
--- a/debian/sessionclean
+++ b/debian/sessionclean
@@ -44,7 +44,7 @@ for sapi in ${SAPIS}; do
 done
 # first find all open session files and touch them (hope it's not massive amount of files)
 for pid in $(pidof $proc_names); do
-    find "/proc/$pid/fd" -ignore_readdir_race -lname "$save_path/sess_\*" -exec touch -c {} \;
+    find "/proc/$pid/fd" -ignore_readdir_race -xtype f -lname "$save_path/sess_\*" -exec touch -c {} \;
 done
 ) | sort -rn -t: -k2,2 | sort -u -t: -k 1,1 | while IFS=: read -r save_path gc_maxlifetime; do
     # find all files older then maxlifetime and delete them

Reply via email to