/srv/irclogs.ubuntu.com/2013/01/16/#upstart.txt

slangasekI'm trying to think through why that's not simply a bug in the current importer, fixable by having richer annotations in the loom data00:00
xnoxbug 91149600:00
xnoxhttp://pad.lv/91149600:00
xnoxbecause given one source package in can now have one or many states (the debian one or the ubuntu one) for each version =/ and it all gets hairy.00:01
slangasekah right, because then you're trying to do a merge from the Debian branch into the Ubuntu branch, and use the looms for it, but the Debian branch's loom doesn't actually represent what you'd be merging00:02
xnox=) yeap.00:02
xnoxi think it was a bad idea to introduce series.vendor00:03
xnoxanyway =) i want tea and need to send in patch pilot report.00:04
slangasek:)00:05
jodhxnox/stgraber: comments please - https://wiki.ubuntu.com/FoundationsTeam/Specs/RaringUpstartUserSessions#Shutdown_Details11:55
stgraberjodh: looking14:30
stgraberjodh: wow, we end up with a pretty complex logout sequence but I guess it makes sense ;) We'll need to restrict the shutdown command to --user for now to avoid people trying to use it against PID 1.14:35
jodhstgraber: It might need some tweaks, but it's as fair as I could make it whilst also having reasonable performance.14:36
jodhstgraber: agreed - this is for Session Inits only for this cycle :)14:36
jodhstgraber: an alternative could be that we handle the entire shutdown from a job, but I'm not particularly in favour of that as we don't have sufficient control over the other jobs.14:38
jodhstgraber: do you know the desktop suspend path? That's the only scenario not covered in that section.14:45
stgraberjodh: I think the desktop suspend path is pretty much a direct call to pm-suspend, I'm not sure gnome-session is really involved there14:46
jodhstgraber: ack. I wonder if adding a pm-suspend hook that emits a 'resumed' event would be useful?15:02
stgraberjodh: yeah, I guess having suspend/resume events would be nice and will be easy enough to do15:19
xnoxjodh: do we not have those system wide? or we just come back and assume the laptop is still in the same country connected to the same Heathrow airport wifi hot spot?15:22
xnoxis this point were I am being pressed for :: events?! =)15:24
jodhxnox: we don't have such events atm, but yeah, it should be at the :sys: level.15:25
stgraberjodh: just saw your e-mail, looks like that branch isn't based on the right upstream branch, let me fix that :)15:26
stgraber(I didn't modify any .conf in my branch, so I must have messed up its base yesterday when debugging upstart)15:27
jodhstgraber: ok, np.15:27
addisonjlooking at this post: http://serverfault.com/questions/128605/have-upstart-read-environment-from-etc-environment-for-a-service, is this still the best way to properly source an environment?17:38
xnoxaddisonj: yes, but tbh it's best to only source the only environemt variable you want / need like guested in the second answer.17:44
addisonjxnox: so setuid/setgid doesn't do anything PAM? just runs the daemon with that uid/gid set?17:45
xnoxyes.17:45
addisonjxnox: yeah, problem is, we inject config into our application servers through env vars and don't want to maintain that list elsewhere...17:45
xnoxI believe, you can check the source code should be easily done.17:45
xnoxaddisonj: but you do have that list somewhere right?!17:46
addisonjchef writes it out to /etc/environment17:46
xnoxaddisonj: on debian/ubuntu systems it is typical to have /etc/defaults/mydaemon which is user editable file for configs.17:46
xnoxaddisonj: chef can also write out /etc/init/mydaemon.overrides which includes partially the stanzas you need with environmental variables you need.17:47
xnoxs/overrides/override/17:47
xnoxwhich upstart will apply on top of the .conf file.17:47
xnox(patch-style replacing individual stanzas)17:47
addisonjoh, cool, didn't know that17:47
xnoxsee cookbook17:47
xnoxhttp://upstart.ubuntu.com/cookbook/17:48
addisonjright now, we just use su and run it as our non-privileged user with env sourced, which has worked17:48
addisonjbut now I am trying to do a reload but the SIGHUP isn't getting through to me process17:48
* xnox wonders if upstart is tracking su pid, instead of daemon pid.17:49
addisonji believe it is17:49
xnoxdoes $ status mydaemon matches the pid of the daemon queried via ps?17:49
addisonjoh, lemme check, never thought of doing that17:50
xnoxcuase if it doesn't upstart is sending SIGHUP to something else =))))17:51
xnox(also see cookbook on establishing fork count)17:51
addisonjyeah, the pid is the su process17:51
* xnox recommends to avoid su / sudo in upstart jobs17:52
addisonjso I just need to do expect fork 2 or something and it should work I imagine?17:52
xnoxhttp://upstart.ubuntu.com/cookbook/#expect-daemon17:52
xnoxexpect daemon17:52
addisonjyeah... thats why I was asking about proper PAM support so I could avoid that, maybe I shall hack something up to properly source env as part of the job17:52
addisonjon another note however, upstart is quite awesome :) I much prefer it to init.d17:55
xnoxaddisonj: http://paste.ubuntu.com/1538257/17:56
xnoxexample of script stanza that sources config file with envrionment variables and then executes fork.17:57
xnoxyou can have setuid/setguid stanzas up there if you need to change user.17:57
xnoxthis way you track "expect fork" & don't need su17:58
addisonjhrm, interesting, I think the only problem with that is that /etc/environment vars don't do an export :\ but I think ican make it work with someting like that18:00
xnox. /etc/environment18:06
xnoxexport $PATH18:06
xnoxexport $socks_proxy18:06
xnoxor whichever you need.18:06
xnoxor make chef write out sourcable / exportable /etc/environment18:07
addisonjyeah, I shall figure something out, but you have been quiet helpful, many thanks18:08
xnoxnp.18:21
stgraberjodh: ping19:33
stgraberjodh: ping?19:41
depeszhi. first of all - i never had to write init scripts for upstart. but today is the day. So, I have a program, pgbouncer, that I can start, or stop, and it works fine.20:43
depeszbut. this program has also full online restart mode. where I run it using special parameters, and it takes over job of previously running copy. but the new copy has different pid, and upstart doesn't knwo it's still running20:44
depeszdo you know of any way to let upstart know that pid of a service has changed ?20:44
JanCdepesz: I suppose you mean it does a handover between 2 instances of the program so that there is no "gap" during the restart?21:05
JanCno availability gap21:06
depeszi am not sure about how it works internally, but as far as I understand - there is no gap as in "moment in time when there is no pgbouncer"21:07
depeszthere is always some pgboucner running, but it can online restart/upgrade21:07
JanCmaybe you could do some trickery by only using pre- & post- scripts but no main exec/script21:09
JanCbut it's certainly something where upstart could improve21:09
xnoxdepesz: JanC: in this case you should use instances and restarting actually should stop one instance and start another.21:25
xnoxthis way you can achieve & monitor the overlap as well.21:25
depeszxnox: but i don't want to use restart.21:25
depeszas restart does stop+ start.21:25
depeszthe built-in (in pgbouncer) is much better21:26
xnoxdepesz: you can override in pre-stop script what actually happens during stop+start combo.21:26
xnoxdepesz: detect that restart was requested and perform the pgbouncer handover.21:26
xnoxI am giving you a method how to use the built-in pbuilder restart & let upstart track the new pid.21:27
depeszhmm .. ok21:27
JanCxnox: that's more or less what I suggested, but there should probably be a more user friendly way to express that in upstart21:28
xnox90% things are trivial 10% are easy enough to achieve ;-) pre-stop scripts are unusual but it's not the end of the world.21:30
JanCxnox: still, having syntax for it makes it easier to understand what the config does21:55
JanCthat's why sysvinit scripts have a semantic difference between restart & reload, for example22:02
xnoxJanC: so does upstart. it has both reload and restart22:05
JanCexcept reload & restart are still (mostly) hardcoded22:06
JanCand reload breaks if it causes the daemon to "switch" to another PID22:10

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!