Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When you have a PHP background process running, what are recommended approaches to:

1/ Monitor that the process is alive and/or automatically launch a new one if it dies

2/ Make sure that there are never 2 versions of the process running? i.e. prevent someone from doing:

/usr/bin/php ./myprocess.php

when myprocess.php is already running in background

Fyi, in my case it's a process that remains connected to the Apple APNS, polling a database every 5s and sending push notifications to APNS when needed

share|improve this question
Might be best answered on SuperUser SE. –  mdpc Dec 21 '12 at 17:17
maybe do run a ps command with the filename and see the returned value –  MitziMeow Dec 24 '12 at 22:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.