Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6862877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:42:51+00:00 2026-05-27T02:42:51+00:00

I recently set up Ubuntu Natty with PHP5-FPM, Gearman, and Supervisor. I’ve edited my

  • 0

I recently set up Ubuntu Natty with PHP5-FPM, Gearman, and Supervisor. I’ve edited my Supervisord config to run a Gearman worker.

[program:gearman] 
command=/usr/bin/php php_gearman_worker.php
numprocs=1 
directory=/root/sandbox
stdout_logfile=/root/sandbox/supervisord.log 
environment=GEARMAN_USER=gearman 
autostart=true
autorestart=true
user=gearman

Here’s the relevant info (showing only gearmand and php processes) when I lsof -i -P before I run supervisord:

COMMAND     PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
gearmand  29314  gearman    6u  IPv4 328139      0t0  TCP localhost:4730 (LISTEN)    

And here’s what I get when I lsof -i -P after I /etc/init.d/supervisor stop && /etc/init.d/supervisor start.

COMMAND     PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
gearmand  29314  gearman    6u  IPv4 328139      0t0  TCP localhost:4730 (LISTEN)
gearmand  29314  gearman   11u  IPv4 328206      0t0  TCP localhost:4730->localhost:39072 (ESTABLISHED)
php       29571  gearman    4u  IPv4 329744      0t0  TCP localhost:39072->localhost:4730 (ESTABLISHED)

I don’t see any listing for supervisord itself, should I see supervisord as one the commands?!

Anyway, when I stop and start (or restart) supervisord again:

COMMAND     PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
gearmand  29314  gearman    6u  IPv4 328139      0t0  TCP localhost:4730 (LISTEN)
gearmand  29314  gearman   11u  IPv4 328206      0t0  TCP localhost:4730->localhost:39072 (ESTABLISHED)
gearmand  29314  gearman   12u  IPv4 329754      0t0  TCP localhost:4730->localhost:51570 (ESTABLISHED)
php       29571  gearman    4u  IPv4 329744      0t0  TCP localhost:39072->localhost:4730 (ESTABLISHED)
php       29619  gearman    4u  IPv4 327233      0t0  TCP localhost:51570->localhost:4730 (ESTABLISHED)

It looks like with each time I stop and start supervisord, it creates another php process, and then another. It’s only when I restart gearmand that it goes back to normal i.e. /etc/init.d/gearman-job-server stop && /etc/init.d/gearman-job-server start.

This seems abnormal to me being that when I stop supervisord, it’s supposed to stop

Is this the way supervisord works?! Is there a way I can prevent this from happening?!

Thanks in advance.

EDIT

I found out what was causing the problem. It was a small conflict with the supervisord.conf and my init script.

My supervisord.conf file had the following settings:

pidfile=/tmp/supervisord.pid

But my init script at /etc/init.d/supervisord had the following setting:

NAME=supervisord
PIDFILE=/var/run/$NAME.pid

So I just changed the setting in supervisord.conf to match what was in my init script.

Also, I added stopsignal=KILL to the program config in my supervisord config file (supervisord.conf).

Thanks to Minaz for the direction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:42:52+00:00Added an answer on May 27, 2026 at 2:42 am

    I always include the stopsignal config option for my supervisor config files. This allows the gearman process to be killed when a stop is requested. Try this:

    [program:gearman] 
    command=/usr/bin/php php_gearman_worker.php
    numprocs=1 
    directory=/root/sandbox
    stdout_logfile=/root/sandbox/supervisord.log 
    environment=GEARMAN_USER=gearman 
    autostart=true
    autorestart=true
    user=gearman
    stopsignal=KILL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently set up a Ubuntu 9.10 server with a LAMP configuration and then
I recently set up a j2ee development environment under Ubuntu: Eclipse (Helios) with the
I recently set up, for a learning exercise, an Ubuntu desktop PC with KDE
recently I set out to port ucos-ii to Ubuntu PC. As we know, it's
I recently set up a Cedar (Rails 3.1) app on Heroku, and to run,
I recently set up a local copy of Wordpress, added some content and created
I recently set up a github account to store the source code of a
I've recently set up a WordPress blog and it's removing the www from all
I've recently set up a SVN to work on my collaborative university homework with
I've been working on a Heroku app for several months. We've recently set up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.