+
+ $lockpath = get_lockpath();
+ if ($lockpath != '') {
+ $pidfile = new pidfile($lockpath, 'onepoll'.$contact_id);
+ if ($pidfile->is_already_running()) {
+ logger("onepoll: Already running for contact ".$contact_id);
+ if ($pidfile->running_time() > 9*60) {
+ $pidfile->kill();
+ logger("killed stale process");
+ }
+ exit;
+ }
+ }