WebFaction
Community site: login faq

Hi,

I have a cronjob that checks every minute whether supervisord is running using:

if [ -e $SUPERVISORD_PIDFILE ]; then 
   echo "Already Running"
   return 1
fi

However when the webfaction server that everything is hosted on restarts the pid file being checked isn't removed and so although the process isn't running, the pid remains and the script doesn't trigger the starting code.

When stopping supervisord normally, the pid file gets removed and the script notices this and restarts supervisord. However, it seems that the shutdowns that the webfaction server is going through isn't giving the supervisord process enough time or opportunity to remove the pid file (though my knowledge of shutdown sequences is minimal).

My question then is; what is the recommended way of detecting whether a particular process is running, given that the pid file seems to be an unreliable source?

asked 28 Jan '13, 19:34

mrmagooey
312
accept rate: 0%


PID is how you would monitor the process, we have a more advanced example in this thread.

permanent link

answered 29 Jan '13, 00:23

johns
5.3k312
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×5
×1

question asked: 28 Jan '13, 19:34

question was seen: 5,546 times

last updated: 29 Jan '13, 00:23

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM