Discussion:
[Supervisor-users] Controling child processes
Steve Piercy - Website Builder
2014-09-01 12:01:40 UTC
Permalink
I want to control child processes started by a process that
supervisor started.

I read these docs:
http://supervisord.org/subprocess.html#pidproxy-program

And it appears that I can do what I want. However, I'm a little
fuzzy about where the docs say "/path/to/pidfile" and
"/path/to/mysqld_safe". Here's my situation.

When started through supervisor, the app 'foo' creates one child
process per "site" using these two commands:

./foo --nolisten --ischild --siteid=1 --sitename=site_1 \
--pipename=foo_1 --workingdir=sites/site_1

./foo --nolisten --ischild --siteid=2 --sitename=site_2 \
--pipename=foo_2 --workingdir=sites/site_2

Although each process—the app started by supervisor and the
two children spawned by the app—has its own pid, only the app
generates a pidfile.

Assuming I can modify the startup of the child processes such
that each writes to its own pidfile, would I then (in theory) be
able to control each child process through supervisor and
pidproxy, like so?

[program:site_1]
command=/path/to/pidproxy /path/to/pidfile/for/site_1 /path/to/script/that/starts/site_1

[program:site_2]
command=/path/to/pidproxy /path/to/pidfile/for/site_2 /path/to/script/that/starts/site_2

If it's possible, then I'll have a go at making the children
write pidfiles. If not, I'd like to save myself some frustration.

TIA.

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy Website Builder Soquel, CA
<***@StevePiercy.com> <http://www.StevePiercy.com/>
Loading...