What I'm getting is clean and unified management of this and some other related 
daemons. It seems reasonable to allow supervisord to manage details like 
ensuring restarts if/when the daemon isn't running, handling start/stop in a 
common way, etc.

There's a lot more to supervisord than just managing things that have a console.

J

________________________________
From: David Birdsong [[email protected]]
Sent: Sunday, December 22, 2013 1:35 PM
To: Josh Jore
Cc: [email protected]
Subject: Re: [Supervisor-users] Controlling daemonized programs?




On Sun, Dec 22, 2013 at 8:58 AM, Josh Jore 
<[email protected]<mailto:[email protected]>> wrote:
Hi,
I have a daemonized Apache httpd which I'd like to manage with supervisord. 
I've just read http://supervisord.org/subprocess.html#apache-2-2-6 and 
http://smarden.org/runit/runscripts.html#apache2 which roughly suggest using 
-DFOREGROUND to prevent forking and detaching from the console.

I'm really unsure that it's smart for me to adjust this existing daemon much 
since it's actually a mod_perl application server with a lot of moving parts. 
I'd much rather just manage the program as-is, even though it detaches from its 
parent and is a proper daemon.


These two paragraphs contradict each other to some extent. 1. you'd like to 
manage w/ supervisord, then 2nd states that there's too much going on w/ the 
app to get it to behave under supervisord.

My suggestion is to identify what you want out of supervisord that the apache 
package scripts doesn't provide. If it's just the ability to expose the status 
and restart commands over a cli, then let me introduce you to 
(ba)sh/csh/zsh--also considered CLI's.


I'd like a suggestion for something that's been already worked out, preferably 
nicer than this terribly buggy shell script I just penned for this email.

#!/bin/sh
# TODO(jjore): handle `start | stop | status | restart`
PIDFILE=$1
SIGNAL=WINCH

if [ -r "$PIDFILE" ] && kill -0 $(cat "$PIDFLE"); then
  echo "$@ is already running"
  exit 1
fi

trap 'kill "-$SIGNAL" $(cat "$PIDFILE")' TERM
rm -f "$PIDFILE"
while true; do
  # TODO(jjore): Avoid restarting too quickly
  ( exec "$@" ) &
  while kill -0 $(cat "$PIDFILE") && sleep 1; do
  done
  wait
done



I'd avoid any of this voodoo. You're reinventing what supervisord 
offers--process control by way of the WAIT variants.

Some processes come with a good set of daemonization primitives that working 
around aren't worth the effort. Supervisord offers process control for 
processes missing these primitives.

For me: nginx and haproxy are the two I never run under anything under init or 
upstart. There's so much going on with graceful reloads and child watching that 
supervisord (or circusd) aren't needed and create extra work for me. the 
operator, for little benefit.


_______________________________________________
Supervisor-users mailing list
[email protected]<mailto:[email protected]>
https://lists.supervisord.org/mailman/listinfo/supervisor-users


_______________________________________________
Supervisor-users mailing list
[email protected]
https://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to