[10:26] jodh, we want to run our test tool as soon as the system is ready to be tested. what that actually means may need discussion. i don't know that much about upstart [10:27] brendand: ok, well you need to know what environment your test tool needs to run in. [10:27] brendand: 'start on runlevel [2345]' is generally appropriate for jobs that need to run when disks are mounted and networks are up. [10:27] jodh, we do - but how to express that in upstart terms is beyond me at the moment [10:28] brendand: so what does your test tool need before it can run? [10:28] jodh, the best way to describe it would be to say that we should start testing when all initialisation that's going to happen has happened [10:29] brendand: what does the test tool test? [10:29] jodh, well we're testing hardware so all services that interact with hardware need to be started [10:29] brendand: can you give examples of such h/w services that you care about? [10:29] networking [10:29] usb [10:30] jodh: we talk to network manager, udisks, poke udev [10:30] zyga, actually on servers we don't touch NM [10:30] brendand: perhaps this also implies our jobs should be able to depend on upstart stuff being started? that would remove the requirement from plainbox itself and offset it to other parts of the system [10:31] jodh, on desktop systems we are just using xdg autostart to start after login [10:31] jodh, so we're thinking only about servers here [10:31] brendand: we could perhaps use upstart for that as well, without user sessions (jodh: we need to support precise +) [10:36] brendand: I'd go for the runlevel 'start on' then since nm isn't going to be available on the server. [10:37] jodh: meta-question, do you think backporting current upstart to precise would be a good idea? [10:37] jodh, http://upstart.ubuntu.com/cookbook/#normal-start seems to imply that using the runlevel start on would mean that you are okay with the service starting without a valid network interface [10:39] brendand: please just try the runlevel start on. I'll tweak the cookbook when I'm less busy ;) [10:39] * brendand is reading https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/701576 [10:39] zyga: why? [10:39] jodh: so that stuff that targets 12.04 can take advantage of new features and can rely on stuff that upstart is good at [10:41] zyga: doesn't that argument apply to most packages in Ubuntu though? [10:42] jodh: yes but web apps typically sidestep normal packaging already [10:42] jodh: yet depend on upstart for getting started [10:43] zyga: upstart in precise works perfectly well. I don't understand your argument. [10:44] jodh: perhaps I miss something, let me explain that [10:45] jodh: I was looking for setgit/setuid but apparently those are in precise by now [10:45] jodh: I must have confused that with lucid [10:46] setgid [10:49] zyga: ok. You can compare 'rmadison upstart' with http://upstart.ubuntu.com/cookbook/#stanzas-by-category [14:39] Is it possible for a service to stop itself and prevent further respawns for the current upstart session? [14:41] My use case is to shut down a client service whose server (another system) rejected communication. The client exits but respawns immediately due to upstart. [14:46] fabiant7t: respawn can have limits, such that it will stop respawning. [15:01] xnox: thx! I'll try to add a respawn limit to the upstart job [15:04] fabiant7t: http://upstart.ubuntu.com/cookbook/#respawn-limit [15:05] xbox: Jap, I'm reading through it, just need to find the right place to apply it on saltstacks generic upstart job script (http://dpaste.com/1052456/) [15:16] fabiant7t: if the service exits with a normal exit, no respawn will ocurr [15:16] fabiant7t: so just exit(0) [15:17] SpamapS: I tested that with sys.exit(0) in python, but it got respawned [15:17] fabiant7t: something went wrong then [15:17] fabiant7t: is it being run by a wrapper script that maybe doesn't exit cleanly? [15:19] SpamapS: As far as I can tell (and read in the logs), it did exit property with a return code 0 [15:20] SpamapS: I'm trying to fix that issue here, btw: https://github.com/saltstack/salt/issues/4411 [15:20] fabiant7t: oh I misunderstood actually [15:20] only tasks can exit 0 to avoid respawn [15:21] fabiant7t: to make non-tasks behave the same way you have to add 'normal exit 0' [15:21] SpamapS: It's a system service, and it's running into a deadlock right now [15:22] SpamapS: to this script? http://dpaste.com/1052456/ [15:23] I am pretty unfamiliar with upstart and the startup scripts, unfortunately :( [15:23] fabiant7t: oh thats a sysvinit. Wha? [15:23] obviously it got automatically rewritten to upstart [15:24] fabiant7t: wait no, ignore that script [15:24] fabiant7t: /etc/init/$that_scripts_name.conf [15:25] SpamapS: aaah, got it [15:30] SpamapS: That fixes the loop, thanks a lot!