Thanks, this is looking better now.  Here are some notes:

1. PROC_NAMES should be defined as proc_names or used as PROC_NAMES 
(inconsistent case)
2. printf "%s:%s:%s\n" "$save_path" "$gc_maxlifetime" has 2 arguments but the 
definition takes 3, I would simplify it to this:
echo "$save_path:$gc_maxlifetime"
3. If apache2filter is installed, $proc_names will contains "apache2 apache2", 
which, when passed to pidof, will return all the PIDs twice, so I've uniq'd 
them by delimiting them with \n and using "sort -u | xargs pidof".
4.  I'm not entirely sure how "cgi" method would work, but I suppose it means 
the php command is running on the system by itself, so I've used the following 
bit to discover that pidof requires "php", not "php5" since that is the real 
name of the process:
php -r 'sleep(60);echo "Done";' &
5. We've been using HHVM for a few years for one of our products, and I could 
easily add support for that ("hhvm --php -r"...), but things seem a bit out of 
order there, mainly, the php.ini is in /etc/hhvm instead of /etc/php5/hhvm

I've attached an updated script.

** Attachment added: "sessionclean"
   
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1356113/+attachment/4180769/+files/sessionclean

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in Ubuntu.
https://bugs.launchpad.net/bugs/1356113

Title:
  PHP5 session clean cron job causes OOM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1356113/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to