[18:54] <jY> is there anyway to tell upstart a pid has changed?
[20:01] <redondos> hello. what's the recommended way of outputting stdout and stderr of my daemon to a specific file? (not /var/log/upstart/daemon.log)
[20:07] <jY> redirect ater the process to the file
[20:07] <jY> after*
[20:08] <jY> app 1>> stdout.log 2>> stderr.log
[20:11] <redondos> jY: I'm trying that but upstart is still writing to /var/log/upstart/daemon.log
[20:11] <redondos> do I need to specify any particular value for "console"?
[20:11] <redondos> i know the default is "log", and I also tried "output"
[20:19] <xnox> jY: change pid how? after initial started event?
[20:20] <xnox> redondos: there should be an example somewhere, one sec.
[20:20] <jY> xnox: haproxy on a reload changes pids
[20:20] <jY> which causes upstart to freak out
[20:22] <xnox> jY: that's evil. and needs investigation. you can now specify a custom reload signal, such that you could make "reload" send a harmless signal.
[20:23] <xnox> jY: and have some other job to reload haproxy, or do full restarts instead.
[20:23] <xnox> redondos: to redirect output you should be able to use "logger"
[20:23] <jY> xnox: i take it now means it's not in the version in ubuntu 12.04?
[20:23] <xnox> jY: no, not in 12.04.
[20:24] <jY> ok thanks
[20:25] <xnox> jY: is there a bug open against haproxy?
[20:25] <jY> xnox: no but i've talked to some of the devs and they said its the way it is
[20:25] <xnox> jY: haproxy package that is on launchpad?
[20:25] <xnox> jY: well, ubuntu can patch haproxy and/or change configs and/or upstream patches to get it fixed.
[20:26] <jY> ok
[20:27] <xnox> jY: 12.04 will have 3 more years of support and 2 more point releases.....
[20:28] <xnox> jY: in precise haproxy is not using upstart job, is it?
[20:28] <jY> nope
[20:28] <jY> we tried haproxy to make restarts quick if it dies
[20:28] <jY> i mean we tried upstart
[20:32] <xnox> jY: reload doesn't actually reload haproxy.
[20:33] <xnox> jY: it suppose to dump every server's state, from source code.
[20:33] <jY> ya
[20:33] <xnox> jY: it looks like the only way to restart haproxy is to actually "stop and start" it again.
[20:33] <xnox> jY: what job / conf file did you use for haproxy?
[20:33] <jY> well stop will kill in flight connections
[20:34] <jY> if you reload it will wait till they all finish then close the process
[20:34] <jY> i think it's like how apache does it
[20:34] <xnox> jY: there is "sig_soft_stop" on SIGUSR1
[20:34] <jY> it's just a simple job that does like a exec haproxy -db -f conf.file
[20:35] <xnox> jY:        -sf <pidlist>
[20:35] <xnox>               Send  FINISH  signal  to  the pids in pidlist after startup. The
[20:35] <xnox>               processes which receive this signal will wait for  all  sessions
[20:35] <xnox>               to  finish  before  exiting. This option must be specified last,
[20:35] <xnox>               followed by any number of PIDs.  Technically  speaking,  SIGTTOU
[20:35] <xnox>               and SIGUSR1 are sent.
[20:36] <jY> -sf is what we use
[20:36] <jY> to reload it
[20:36] <xnox> jY: so in pre-stop, you could just send those two signals.
[20:36] <xnox> jY: or you can create a job to do that for you.
[20:37] <jY> but with pre-stop then it won't think haproxy is up
[20:37] <jY> when it is
[20:37] <jY> right?
[20:37] <xnox> jY: pre-stop is executed upon "restart haproxy", so you will get a graceful restart instead of tear everything down. 
[20:38] <jY> ok i'll give it a try
[20:38] <xnox> jY: alternative is to patch haproxy, to install / call functions which do SIGTTOU & SIGUSR1 at the moment, and make SIGHUP do that.
[20:39] <xnox> jY: or you can create "haproxy-reload.conf" task, script, which does "status haproxy | grep -q start/running && then get pid and send SIGTTOU and SIGUSR1 to the main process.
[20:40] <xnox> jY: i'd be happy to see that upstart job of yours included in ubuntu =)
[20:41] <jY> xnox: ok let me pastebin it
[20:42] <jY> http://pastebin.com/V6wy7qfQ
[20:42] <xnox> jY: you write pid file to still be able to use /etc/init.d ?
[20:44] <jY> for monit