#upstart 2007-01-02
<Zzzot> help
<Zzzot> I am trying to improve the performance of my kubuntu6.10 system. some tips/tricks that I have read say to remove unneeded ttys from /etc/inittab how would i do this with upstart?
<Zzzot> would I remove the files from /etc/event.d? for example: /etc/event.d/tty6?
<Md> it will not help unless you are *horribly* tight on RAM
<Zzzot> Do I have the idea correct? would I remove the files from /etc/event.d? for example: /etc/event.d/tty6?
<gnutz>  /msg nickserv link gnutz workhard
<Keybuk> gnutz: you may want to change your password ;)
<gnutz> LOL
<gnutz>  Im a dame nubie
<gnutz> damm
<AlexExtreme> heh
<gnutz> So I guess I just exploted my user account
<gnutz> LOL
<AlexExtreme> yeah
<gnutz>  So is this an Ubuntu room?
<AlexExtreme>  /msg nickserv set password will help
<AlexExtreme> gnutz, it's for the init program used in Ubuntu
<gnutz> ok thx
<gnutz> init?
<gnutz> what is that?
<AlexExtreme> gnutz, init is the program which boots up a linux system
<wasabi> I'm curious how you managed to join the channel.
<gnutz> o the Kernal?
<AlexExtreme> gnutz, no, it's the thing that's run once the kernel is loaded
<gnutz> wasabi try /list then click
<gnutz> Ok like a gnome / xsever type of thing?
<AlexExtreme> no
<gnutz> Never mind sorry Ill google it
<AlexExtreme> gnutz, http://en.wikipedia.org/wiki/Init might help you understand what init does
<gnutz> Cool Im reading up on it
<gnutz>  Hey I do have a relitive question
<gnutz> I have dual boot XP ntfs on fisrt part then EXT3 with Unbuntu on the 2nd part 
<gnutz> some times I'll boot outta XP and into Ubuntu and it will freeze
<AlexExtreme> XP freezes? or Ubuntu?
<gnutz> then I'll hard boot and Ubuntu will finale boot up
<gnutz> Ubuntu
<AlexExtreme> strange
<gnutz> Im wondering if Ubuntu is corrpting the MBR 
<gnutz>  or its a NTFS issue
<AlexExtreme> you should probably ask in #ubuntu
<AlexExtreme> just type /j #ubuntu
<gnutz> cool Alex thnx
<Keybuk> http://einit.sourceforge.net/
<Keybuk> No real shell scripts, no inittab, no runlevels and a configuration file in XML
<Keybuk> nice to see people refer to upstart :)
<AlexExtreme> Keybuk, strange, I was just reading that at the exact same time as you... :P
<Keybuk> http://einit.sourceforge.net/documentation/users/introduction-differences-upstart.html
<Keybuk> heh
<Keybuk> I'd be interested to see how it's "partially event-based"
<AlexExtreme> yes... I don't quite get how that would work
<Keybuk> I guess it's actually as event-based as upstart
<Keybuk> actually, it looks rather strange
<Keybuk> to my eyes, anyway; I guess it makes sense to the author
<AlexExtreme> It must do, otherwise he/she wouldn't have written it
<Keybuk> the embedded market does seem to be the focus
<Keybuk> e.g. having just one config file for every single job/task/service/module/mode
<Keybuk> makes it hard for a distribution though, as packages can't extend it
<AlexExtreme> yes
<AlexExtreme> the first design flaw that will make it difficult for a distro to adopt it ;)
<Keybuk> I doubt their aiming for that
<AlexExtreme> interesting.... there's a file in it's source called "bitch.c"
<AlexExtreme> with a "bitch" function
<Keybuk> dpkg has an ohshit() function
<Keybuk> and an onshite() function
<Keybuk> the difference being that onshite() appends strerror() to the error message :p
<AlexExtreme> really? :)
<Keybuk> I'm hardly in a position to diss someone for NIHing an init daemon <g>
<Keybuk> I wish them well
<AlexExtreme> may I ask, what does NIH stand for?
<Keybuk> Not Implemented Here
<Keybuk> or Not Invented Here
<AlexExtreme> ah
<Keybuk> it's usually used in a derogative sense if someone goes and reinvents a wheel
<Keybuk> or writes code themselves that already existed elsewhere
<Keybuk> the focus really does seem to be writing everything in C
<Keybuk> cf. the modules subdir
<Keybuk> it has C code to do things like set the hostname, mount a filesystem, fork getty, etc.
<Keybuk> whereas we'd use shell code for that
<AlexExtreme> Keybuk, question: when do you think the current specifications for upstart be implemented? just so I know if upstart will be ready for Frugalware 0.6, or whether I'll need to delay inclusion of upstart until 0.7
<Keybuk> I'm aiming for over the next two weeks
<AlexExtreme> hmm#
<AlexExtreme> would be in time for rc1, if I work hard on the jobs... but after rc1 will have to be delayed
<AlexExtreme> mental note: stop thinking out loud
<Keybuk> heh
<Keybuk> nothing wrong with thinking out loud, I do it all the time
<AlexExtreme> :p
<Keybuk> it's been delayed a bit from my original plan because I've changed roles at Canonical
<Md> what are you working on now/
<Md> ?
<Keybuk> I'm a manager now; in charge of one of the two teams that develop Ubuntu
<AlexExtreme> ah
<Keybuk> I'll be still doing a fair amount of development work as well, ie. initramfs/udev/upstart
<Keybuk> but the transition meant that I didn't get as much chance as I'd've liked before xmas
#upstart 2007-01-03
<aegis> Hi ...I need some help from a staff member please.
<AlexExtreme> why are you asking here?
<AlexExtreme> you mean a freenode staff member?
<aegis> Just hoping there might be one here.
<aegis> Cant even type in there
<AlexExtreme> well I think Md is, but you'd be better to type /stats p to get a list of staff members available
<aegis> Yeah....I cant even find where he is...
<AlexExtreme> which channel is this?
<AlexExtreme> I mean the one you said you can't even type in
<aegis> Freenode
<Keybuk> meh, coming up with computer game names is getting increasingly harder :-/
<AlexExtreme> heh
<Keybuk> good ones, anyway
<Keybuk> hmm, that's kinda dump
<Keybuk> this doesn't have its MAC address printed on the bottom
#upstart 2007-01-04
* Starting logfile irclogs/upstart.log
<AlexExtreme> btw Keybuk, I don't know if you knew already but I just noticed Fedora is planning to switch to a new init system in FC7, and Upstart is one of 3 candidates. The other 2 are initng and launchd
<Keybuk> AlexExtreme: interesting, reference?
<AlexExtreme> http://fedoraproject.org/wiki/Releases/FeatureNewInit
<Keybuk> (brb)
<AlexExtreme> wb
<AlexExtreme> there's also this: https://www.redhat.com/archives/fedora-advisory-board/2006-December/msg00170.html
<Keybuk> back
<AlexExtreme> gotta go, night
<Keybuk> interesting
<Keybuk> thanks for pointing that out!
<Keybuk> hopefully they'll have someone at LCA?
* Keybuk wonders whether it would be worth e-mailing them to see if they'd like assistance
<_ion> It probably would be a good idea to tell them about the upstart's "schedule".
<_ion> s/the //
<Keybuk> indeed
<Keybuk> "Now until LCA = Keybuk doesn't sleep, and writes it"
<Keybuk> "LCA = Keybuk doesn't sleep, and fixes it"
<Keybuk> (brb - food)
<_ion> :-)
#upstart 2007-01-05
<CNW8835> hi
<CNW8835> if anyone is watching this channel...
<CNW8835> is there anyway to tell upstart to boot into a specified runlevel as a boot paramiter?
<CNW8835> I tried doing it the way it was done with sysvinit, just by setting the desired runlevel number as a boot parameter, but it doesn't seem to work that way with upstart
<CNW8835> and I can't find anything in the documentation about it other than changing the default runlevel
<Amaranth> sorry, setting something up
<_ion> (offtopic) A hypothetical example of creating a data structure out of thin air, http://johan.kiviniemi.name/stuff/ruby/acme/pair.html
<Keybuk> ?
<_ion> Just a bizarre way of implementing a "pair" data structure without using an array or any other existing data structures.
<Keybuk> very lispish
<_ion> Yes.
<Keybuk> meh, don't you just hate it when you think you've got something exactly right, and then hit a snag?
<_ion> Yeah. What is it?
<Keybuk> have streamlined all the IPC code, so it's a zillion times more efficient and easier to code
<Keybuk> but now it's difficult when sending a message and getting ECONNREFUSED to find out what pid it was going to, and thus remove that pid from the subscription list
<_ion> Hmm, ok.
<Keybuk> it's in the message, but encoded inside the destination address
<Keybuk> that's kinda cool
<Keybuk> I've got a process that I can't kill or ptrace
<Keybuk> even SysRq K didn't kill it
<Keybuk> sweet
<_ion> Heh, what caused that?
<Keybuk> for (;;) malloc ()
<Keybuk> roughly
<_ion> Heh. :-)
<Keybuk> "don't use recvmsg() on connected sockets, for returning zero to mean 'disconnected' will surprise you"
#upstart 2007-01-06
<AlexExtreme> sheesh
<AlexExtreme> *finally* got linux up and running on my new machine, there seems to be a kernel bug with something in it
<AlexExtreme> does ubuntu have any issues with Athlon 64 X2 processors or nForce 550 boards?
<Keybuk> not that I'm aware of
<Keybuk> what was happening?
<AlexExtreme> I get a kernel panic on boot with apic, it'll only boot with noapic on the command line
<AlexExtreme> happens with every kernel I've tried so far
<Keybuk> kernel bug, most likely
<Keybuk> or motherboard bug
<Keybuk> tried updating the bios?
<AlexExtreme> yep, it's the latest revision
<AlexExtreme> it wouldn't even boot more than once without resetting CMOS on the BIOS it came with
<Keybuk> heh
<Keybuk> seems a common problem with that board according to the interwobble
<AlexExtreme> interwobble?
<Keybuk> web
<AlexExtreme> ah
<AlexExtreme> it's an abit KN9S board
<_ion> Seems like abit knows how to make buggy hardware. ;-)
<_ion> Case in point: Abit BP6, which i happen to have.
<AlexExtreme> what problems do you have with that?
<_ion> Its ATA66 controller is notorious for being almost unusable. I ended up buying a PCI SATA controller.
<AlexExtreme> ah
<AlexExtreme> sata on this board is fine
<AlexExtreme> it's just those BIOS bugs (solved with update) and the apic bug
<AlexExtreme> what mystifies me, is why it shipped with the original BIOS revision from july or something when I bought it like, 2 days ago
<wasabi__> heh. there's only 3 packages in the commercial repos?
<Keybuk> noapic and pci=noacpi are the Ibuprofen and Paracetemol of the Linux world
<Keybuk> they cure all ills
<Keybuk> I personally swear by Asus for motherboards
<Keybuk> the A8N-SLI I have has never had a single problem
<Keybuk> but then again, elmo had exactly the same board in a machine, and it OOPSd every time he tried to use the on-board ethernet
<AlexExtreme> hah
<AlexExtreme> well
<wasabi__> i've got this great problem at work with the latest kernel in fiesty...
<AlexExtreme> my dad's ASUS board is quite good
<wasabi__> locks up on boot while "checking aperture"
<Keybuk> sendmsg(3, {msg_name(22)={sa_family=AF_FILE, path=@/com/ubuntu/upstart}, msg_iov
<Keybuk> (1)=[{"upstart\n\0\0\0\10\0\0\0\nrunlevel-2", 26}] , msg_controllen=0, msg_flags=
<Keybuk> 0}, 0) = 26
<Keybuk> whee!
<Keybuk> (and sometimes I think strace is getting too good at decoding syscalls into useful output)
<_ion> [artificially sped up low voice]  This channel is sponsored Pfizer
<AlexExtreme> hah
<_ion> Batteries not included
<AlexExtreme> ahhh, good old windows. i'm setting up my old machine for my mum, it's had windows installed for barely 2 hours and it's got adware on already ;)
<_ion> Why Windows?
<AlexExtreme> my mum doesn't like Linux
<AlexExtreme> she's used to windows and she despises change
<Keybuk> does she ever upgrade Windows?
<AlexExtreme> she likes 2000
<AlexExtreme> but I can't install XP on her box, because I don't have a license and don't want to pay for one
<Keybuk> ring them up and ask for a key
<AlexExtreme> you think it'll be that easy? ;)
<Keybuk> it is
<AlexExtreme> does it cost anything?
<hunger> AlexExtreme: It is free.
<AlexExtreme> interesting
<wasabi__> what are you talking about?
<Keybuk> I think they assume anyone who rings up and innocently claims that XP isn't accepting their license key, can't possibly be thieving, because no thief would ring them :p
<hunger> AlexExtreme: Even ringing them up is free:-( But you are supposed to have a license.
<AlexExtreme> hah
<AlexExtreme> but
<wasabi__> still noy legal
<wasabi__> not
<Keybuk> well, no :p
<wasabi__> if legal wasn't a concern you could just download an iso from a torrent in about 10 minutes
<AlexExtreme> I have a copy of XP with a license, but it's already installed on my sister's machine therefore installing it and activating it on another machine would mean that I'd have Microsoft's lawyers on my doorstep within 10 minutes
<wasabi__> not exactly. ;)
<AlexExtreme> anyway
<AlexExtreme> going to test my new machine with a bit of gaming, bbl
<Archenzo> Hi I i have lost my password
<Archenzo> I cant chat in private
<wasabi__> password for what?
<Archenzo> could you help me
<wasabi__> You've picked an odd channel to ask for help in.
<Archenzo> irc.freenode.net wikipedia-it
<Archenzo> I am registered in
<wasabi__> how about #freenode?
<wasabi__> does upstart have anything to do with this?
<Archenzo> Sorry many thanks! By by
<_ion> That was interesting.
<wasabi__> happens alot for some reason
* Keybuk looks at Md
<Keybuk> :)
<wasabi__> What, are they just following him?
<Keybuk> he's a freenode staff member
<Keybuk> I guess there's some command to look them up
<Keybuk> then they /whois him, and join the first channel in his list
<Keybuk> which happens to be this one :p
<wasabi__> and they can figure out all of that
<wasabi__> without realizing that upstart has nothing to do with them?
<Keybuk> indeed
#upstart 2007-01-07
<joh6nn> i'm trying to add a script to my boot process to turn off dma on one of my hdds (long story), and i'm very clearly going about it the wrong way, but i'm not sure where i'm falling down
<joh6nn> i've looked through the wiki and the getting-started page, but i'm guessing that's only taught me enough to be dangerous, not enough to get this working
<wasabi__> /etc/rc.local =)
<joh6nn> just stuff it in there and it should work?
<wasabi__> uh huh
<joh6nn> thanks, i'll give that a shot
<joh6nn> alternatively, is there a better way to disable dma for a drive at boot?
<joh6nn> er.  wasabi__, i must be missing something.  rc.local is a basically no-op script.  were you just suggesting i shove my one line in there, since it's there anyway?
<wasabi__> uh huh
<wasabi__> it's run during boot. it's for local stuff... to run during boot
<wasabi__> this has nothing to do with upstart, btw. =)
<joh6nn> yeah, normally, that'd be a fair enough answer to the question.  unfortunately, i'm needing to set /dev/hdd to dma = off round about the time that the init-top scripts start getting run (possibly sooner; i may be mis-remembering at that point)
<wasabi__> that would be in the initramfs
<joh6nn> yeah, that was where i tried to add it first.  i stuffed my own little script in there in init-top, but there's seemingly more to it than just adding new scripts to the directory; it didn't appear to run
<wasabi__> have to rebuild hte initramfs
<wasabi__> dpkg-reconfigure the kernel package
<wasabi__> also, i dont think your drives will exists in init-top
<wasabi__> maybe. ;)
<joh6nn> that can't be right; i need to reconfigure the kernel package just to add a new boot script?
<wasabi__> uh huh
<wasabi__> that's hte initramfs
<wasabi__> initramfs != boot scripts exactly.
<joh6nn> ok, well, then i'm clearly going about this the wrong way.  there's gotta be a better way of changing this setting then
<wasabi__> i'd like to know why you have to change it
<joh6nn> if it i don't, it hangs and doesn't finish booting.  at a guess, the BIOS in the box isn't very good, and isn't properly handling the dma settings for the drive
<wasabi__> hmm.
<wasabi__> well, how far does the boot get?
<joh6nn> gets to scanning to see what IDE devices are connected, and hangs at /dev/hdd
<joh6nn> i've tried setting it in /etc/hdparm.conf, too, but that doesn't have any visible effect
<wasabi__> It's going to be a bit hard to tell the kernel not to use dma on a device before the kernel hsa discovered hte device.
<joh6nn> yeah, i'm grasping at straws, really
<wasabi__> also, im not sure if the kernel even enables dma automatically in the initramfs or before
<joh6nn> i've tried setting it with hdparm, and then rebooting, but that doesn't work.  i'm guessing it's not working because the BIOS sees that the drive supports DMA, and turns it back on
<wasabi__> hdparm affects transient kernel settings.
<wasabi__> it doesn't save
<joh6nn> ah
<joh6nn> would be nice if the man made that clearer, eh? ; )
<wasabi__> well, anything that "saved" in linux would have to have someplace to 'save it'
<wasabi__> hdparm.conf is that
<wasabi__> off to bed. sorry i can't help ya much
<wasabi__> night
<Keybuk> random thought
<Keybuk> the job definition parser currently "ignores" parser errors and just outputs warnings
<Keybuk> should it abort parsing instead?
<AlexExtreme> I would think so
<AlexExtreme> because if there is an error, it could cause the rest of it to parse incorrectly and could cause problems
<Keybuk> yeah, especially the unknown stanza bit ...
<Keybuk> ned script
<Keybuk>   exec foo
<Keybuk> end block
<Keybuk> will give you
<Keybuk> foo:1: ignored unknown stanza: ned
<Keybuk> foo:2: ignored unknown stanza: end
<Keybuk> but set the job's exec to be "foo" because exec is a valid stanza
<AlexExtreme> yep
#upstart 2008-01-01
<mlankhorst-> Despite all the talk about upstart I found, are there some scripts for it already? Apart from sysvinit replacement.
<ion_> There are some features being developed that everyoneâs waiting for.
<ion_> If you mean booting the entire system with native upstart jobs.
<mlankhorst-> That's what I mean indeed.
<ion_> I think 0.5 (the next major release) is supposed to have all that is needed for that.
<mlankhorst-> Ah ok, I'll just wait then.
<ion_> https://lists.ubuntu.com/archives/upstart-devel/2007-October/000468.html
#upstart 2008-01-02
<ion_> keybuk: Have you had a chance to waste cycles with my email yet? :-)
<Keybuk> not even read it yet
<Keybuk> only returned from holiday this morning
<Keybuk> and haven't done e-mail catch-up
<ion_> Alright.
<ion_> No hurry.
<Keybuk> I originally wrote nih_alloc with ref-counting
<Keybuk> I forget why I removed it
<ion_> keybuk: Do you think youâll still be able to take a look at my commit today? :-)
<Keybuk> ion_: why is it a uint32_t ?
<Keybuk> unless you have specific need for a 32-bit type, shouldn't that just be "unsigned int" ?
<ion_> Heh, i just thought âwhatever, uint32_t is shorter to type and itâs not as if itâs too small for a refcountâ. :-P
<Keybuk> it's reasonably good practice to avoid the "fixed length" types unless you really want a fixed length
<ion_> Ok, iâll keep that in mind from now on.
<Keybuk> ah, now I remember why I didn't go with reference counting
<Keybuk> it made the world tricky when dealing with parents
<Keybuk> if you return objects with a ref count as 1 when parent = NULL
<Keybuk> and the parent holds a ref on the object
<Keybuk> then surely the returned object has to have a ref count of 1 when parent != NULL (ie. the parent)
<Keybuk> which didn't actually do what you want
<Keybuk> so you had to have the parents *not* reference the object
<ion_> Oh, perhaps i forgot to document it, but the refcount is increased when itâs added to a parent.
<Keybuk> since that's actually what you are after
<Keybuk> but then how do you deal with a child object being referenced when its parent is freed?
<Keybuk> sorry, not explaining well
<Amaranth> how can a child not have a parent? :)
<Amaranth> dunno what exactly you're talking about but i'm thinking the child would get a new parent?
<Keybuk> a = nih_new (NULL, void *);
<Keybuk> that has a refcount of 1
<Keybuk> our reference
<Amaranth> right
<Keybuk> b = nih_new (a, void *);
<Keybuk> that has a refcount of 2
<Amaranth> ok
<Keybuk> our reference
<Keybuk> AND a reference by its parent
<Keybuk> if I do nih_unref (a) now, what happens to b?
<Amaranth> it has a refcount of 1?
<ion_> Its refcount drops to 1
<Amaranth> can you still use b?
<Keybuk> so the object isn't freed when its parent is
<Amaranth> not if someone else is holding on to it, why would it be?
<Keybuk> the whole point of using the hierarchial allocator is to forget about objects if they have a parent
<Keybuk> imagine
<Keybuk>   a = nih_new (NULL, SomeStructure);
<ion_> True...
<Keybuk>  a->title = nih_strdup (a, "foo");
<Keybuk>  a->description = nih_strdup (a, "some long description");
<Keybuk> if a reference is left open for me, I now have to remember to nih_unref those as well
<Keybuk> doubling the length of code
<Amaranth> but wait, wouldn't a->title go away when a does?
<Keybuk> no
<Keybuk> because its refcount is 2
<Keybuk> losing its parent would only decrease it to 1, so it would stay
<Amaranth> but a is gone, how can a->title exist?
<Keybuk> the alternative way would be the refcount of any returned object to always be 1
<ion_> Actually, what iâd like to have would be the possibility of adding a child to multiple parents â or rather âcontainersâ â so that each one references the child once. But granted, thatâs something completely different than using the parent to automatically free the kids.
<Keybuk> if its parent is NULL, then its 1 (yours)
<Keybuk> if the parent is non-NULL, then its 1 (the parent)
<Amaranth> but then you're not really doing refcounting
<Keybuk> but then you can't unref the child yourself, since you don't have a reference :-)
<Keybuk> ion_: sure
<Keybuk> that's a refcounting allocator ;)
<Keybuk> not a hierarchial one
<Keybuk> it'd be a good different allocator, but I don't think you can bolt it onto an h one
<ion_> tss, the author of liblib (the âstandard libraryâ dovecot and icecap use) uses memory pools to implement the following:
<ion_> foo_push (pool);
<ion_> Allocate stuff using pool
<ion_> foo_pop (pool); // Everything you allocated above is freed
<ion_> But that solves a different problem.
<Keybuk> yeah, it's a bit like obstacks
<Amaranth> that sounds like what nih has now
<Keybuk> he wrote a great paper on why he did it that way, instead of just using alloca
<ion_> I wonder whether iâll end up NIHing my own âstandard libraryâ that is based on refcounting, since it would fit my application quite well... :-P
<Keybuk> interestingly, talloc (a description of which is what nih_alloc is roughly based on) does have ref-counting
<ion_> It would resemble libnih *a lot* since i quite like libnih, though, so iâd rather avoid duplication of effort.
<ion_> Perhaps thereâs a way to implement refcounting without breaking the hierarchical allocation. Iâll have to think about it when my brain is less exhausted.
<Keybuk> grab the samba source and look though source/lib/talloc.c and work out how Tridge does it? :p
<ion_> Ok, iâll take a look. :-)
<Keybuk> I think other objects can hold secondary references on an object
<Keybuk> and if the parent is freed, the object is reparented to the first secondary reference
<Keybuk> "god parents" if you like
<Keybuk>  a = nih_new (NULL, void *);
<ion_> A random thought: if nih_new is called with a parent, itâs still initialized with a refcount of one and youâre forbidden from calling nih_unref on the resulting object. Would that work?
<Keybuk>  b = nih_new (a, void *);
<Keybuk>  c = nih_new (NULL, void *);
<Keybuk>  nih_alloc_reference (c, b);
<Keybuk>  nih_free (a);
<Keybuk>  /* parent of b is now c */
<Keybuk> ion_: then you can't free the object independently later since you don't hold a ref on it
<Keybuk> (not without breaking ref counting semantics anyway)
<ion_> For own storage, you could then nih_ref it. :-P But yeah, that would be cumbersome.
<Keybuk> the god parent thing might work quite nicely though
<Keybuk> I don't know what you want the ref counting for?
<Amaranth> this reminds me of GInitiallyUnowned
<Amaranth> i mean, in this case it's initially owned by the parent but it's the same concept
<Amaranth> you don't want the creator to have a reference
<ion_> For instance, in an OpenGL engine iâm working on, a texture object can be attached to a number of mesh objects. I want the meshes to reference the texture, and unref it when theyâre being freed.
#upstart 2008-01-03
<Keybuk> Amaranth: but then how do you free a child object you're the owner of? :)
<Amaranth> Well, with GInitiallyUnowned the idea is to sink the floating reference right away
<Keybuk> ion_: the way I'd do that is just to have the objects allocated parent-less
<Amaranth> it's meant to be used so you can create a widget then add it to a container without having to unref your copy afterward
<Keybuk> and do the refcounting in the object
<Keybuk> (see upstart's own Event object, that's ref counted)
<ion_> Yep... I was kind of hoping to have the support for that in the allocator itself, but that works, too.
<ion_> How about relicensing libnih as LGPL so i can use it in stuff iâm going to release LGPLed? ;-)
<monchevique> is this forum about art
<monchevique> ?
<ion_> :-D
<monchevique> what does ":-D" MEAN?
<Keybuk> ion_: why not release your stuff GPLed? :)
#upstart 2008-01-04
<JamesB192> I have an issue w/ Upstart 0.3.8 on Gentoo:  when shutting down Upstart complains on shutting down all the init scripts w/o a stop section.
<JamesB192> Should I file  a bug w/ Gentoo and/or Upstart?
#upstart 2009-01-04
<Guest23498> upstart sounds very interesting, however I've heard that Ubuntu currently isn't fully migrated from sysvinit - how much, approximately, is there left to do before Ubuntu is fully upstart'ed and/or in which release will this be?
#upstart 2010-01-04
<_Andrew> Hi
<_Andrew> I have an upstart script I have made but it's not working on startup http://paste.ubuntu.com/351057/
<_Andrew> Am I doing this right? I'm trying to execute a program under a specific user
<JanC> _Andrew: 'exec' has a '-u' option on your system ?
<_Andrew> I just copied it from so other upstart script
<_Andrew> I have no idea
<JanC> from which one?
<JanC> you'll need to use something like su or sudo IMO
<JanC> unless you do have an 'exec' with that option of course
<_Andrew> http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall?highlight=%28upstart%29
<_Andrew> I got it from here
<JanC> well, they *do* use sudo there, right?
<JanC> also, the 4 first lines can be written as one: start on runlevel [2345]
<ion> Also, [-f foo] is invalid (unless you have a command called [-f), youâll want [ -f foo ]
<ion> Will startup.sh stay in the foreground until shutdown.sh is called?
<ion> (The job you pasted expects it to.)
<_Andrew> I think so yes
<_Andrew> Should it not stay in the foreground?
<ion> It should.
<ion> To clarify: it should stay in the foreground. :-)
<JanC> ion: well, that or you need extra stuff in that file  ;)
<ion> A future version of Upstart will properly track daemonizing things, but for now, itâs often best just to have it stay in the foreground.
<ion> janc: Yeah, and you also need to know exactly what youâre doing in order not to break Upstartâs current fork-tracking code. :-)
<JanC> _Andrew: did you read init(5) ?
<JanC> http://manpages.ubuntu.com/manpages/karmic/en/man5/init.5.html for a web version
<JanC> it's the best docs upstart has currently, I think  ;)
<_Andrew> ok thanks gys
<JanC> _Andrew: I also see that dropbox example is for versions of Ubuntu < 9.10
<JanC> the script needs to go into /etc/init/ now, not /etc/event.d/
<JanC> so, depending on what version of upstart you use...
<_Andrew> Our server is LTS so I think it's in the right place, but thanks for letting me know
<JanC> _Andrew: ah, then the manpage I pointing to might not work
<JanC> I'm not sure if there is much documentation for that version of upstart
<JanC> _Andrew: you can still use sysvinit init scripts though, if you are more familiar with those
<_Andrew> I think this should be working now. I'll let you know if I have any other probs that I can't figure out
<ion> keybuk: O hai
<ion> Welcome back
<ion> keybuk: http://people.canonical.com/~scott/daily-bootcharts/ :-D
<Keybuk> Happy new tiger
<Md> Keybuk: can you remind me the current plan wrt upstart and network up/down events?
<Keybuk> ion: what about them?
<Keybuk> ion: ah, amusing gap for new year calcuations :p
<ion> keybuk: Nothing really. It was just interesting to learn there are 29 days in the zeroth month of the year.
<ion> Beginning with the 0th day, of course.
<Keybuk> Md: I don't have any current plans fori t
<Md> Keybuk: I do... what do you think about a long-lived daemon which will listen to interface events on the netlink socket and feed back "cleaned up" events to upstart after applying a "carrier delay" and/or debouncing?
<Keybuk> Md: that's probably the right kind of thing
<Keybuk> though I don't know what you mean by "carrier delay"
<Md> oh, it's an IOS feature which delays up/down events for a few ms, to prevent flapping the IGP if the physical layer bounces
<btm> Md: bonding uses similar delays to deal with network equipment bring a link up before it is ready to recieve and pass traffic, which is another applicable analogy IRT upstart.
#upstart 2010-01-05
<rberger> Ist there any accurate stanza documentation for the version of upstart that is shipping with Ubuntu Karmic? The Wiki http://upstart.ubuntu.com/wiki/ does not seem to reflect what is being shipped in that release?
<raphael___> rberger: you want to look at http://packages.ubuntu.com/upstart
<rberger> raphael: That just seems to have the package info, but no usage documentation. I'm looking at info for writing my own init scripts
<JanC> rberger: man 5 init
<rberger> JanC: Thanks, that is what I'm looking for. I had tried man initctl and man upstart but cause of history had a historical blindspot for man init. Might be good to note this on the wiki/launchpad site...
<rberger> s/historical/mental/
<JanC> you should always look at the SEE ALSO section of manpages  ;)
<rberger> I did but "assumed" that init was the old init stuff and not the configuration info for the new stuff. I'm still realing from it going from /etc/event.d to /etc/init
<rberger> Looks like the console stuff no longer is there. I spent an hour or so trying the various example from the wiki that use the console output and console owner assuming I should see the output on my terminal...
#upstart 2010-01-06
<Zer> Howdy. I was looking at Ubuntu's /etc/init, and it seems there is 'expect fork' which will track the first fork, and then without that it'll just treat it like a normal executable, but...
<Zer> what if you have a server where the command line just starts/stops it, and the process itself is not related (I presume it just executes instead of forks). Is there any way to do this form with Upstart? (Nginx being what I am looking at, it starts it, and also has stop signals)
<Younder>  upstart doesn't yet have "Events generated at timed intervals or scheduled times"
<Younder> will it?
<sadmac2> Younder: it will.
<Younder> so it will replace cron?
<Younder> I seem to have said something along the line 'cron is outdated, upstart events will replace it', but that is clearly not true. yet
<Younder> on #ubuntu
<JanC> not yet
<sadmac2> Younder: will linux replace windows? We don't really make those decisions, we just make an offering :)
<JanC> you could do it now by having a daemon (cron or something else) issue upstart events, similar to the mountall tool  ;)
<rberger> Is there a way to 'export" an environment variable that is set inside of a script, lke pre-start script to set an env variable inside a init configure file?
<rberger> I want to set an env variable used thru out an init configuration by doing string manipulation of another environment variable that is passed in as an instance variable.
#upstart 2010-01-07
<rberger> if I have a job that was started with an instance name like "tesla_1" is there a way to be able to say something like "stop on TYPE=tesla"? 
<SatanClaus> heyho
<SatanClaus> I want to write an iptables firewall for my laptop and as ubuntu 9.10 uses upstart now, i thought I'd give it a try.
<SatanClaus> so what I wanted to do was a firewall.conf script which sets up the firewall (basically: allow all out, allow related traffic in)... as it's only a few iptables commands I included it into a script block
<SatanClaus> then i thought ok, maybe i want to be able to stop the firewall and so i wrote a post-stop script which flushes the iptables and allows everything again
<SatanClaus> now my problem is that it seems as if the pre-start script, script and post-stop script are executed immediately, so the firewall is setup, but immediately torn down
<SatanClaus> so, do i have to wait inside the script block?
<SatanClaus> the task option doesn't change that behaviour, but perhaps there is some other keyword, which tells upstart that the script block is not some daemon, but just some commands that change the system's behaviour
<SatanClaus> posted it here: http://pastebin.com/f642c88b8 I want to get rid of the "sleep 1d"
<SatanClaus> oh and yes, i should respawn, but that's as nasty... I never want to restart the firewall if not necessary
<sadmac2> SatanClaus: yes, upstart expects to follow a service, so when it detects that your script terminates it figures the service has died and tears it down again
<sadmac2> SatanClaus: the solution is to not have a "script" stanza at all. Put your rules in pre-start and your teardown in pre-stop (or post stop. the difference is if its in pre-stop upstart won't say the firewall is off until /after/ it runs the flush. I don't know which behavior is right in this case)
<SatanClaus> ok, will give it a try... is there any real documentation besides the http://upstart.ubuntu.com stuff? I mean like a proper language specification, etc.? I found Scott's blog entries, but they seem pretty old
<sadmac2> SatanClaus: the manpages
<SatanClaus> read them, but couldn't find respawn documented there
<SatanClaus> as well as task
<SatanClaus> cool, works if I move all the setup code into the pre-start script
<SatanClaus> sadmac: thx
<SatanClaus> sadmac: another question if you have time: you say that if i move the code into pre-stop it won't say the firewall is off until all flushing is done. Is this because if e.g. it fails during flush, the return command is wrong and upstart assumes that the pre-stop failed, so the "service" is still running?
<SatanClaus> s/return command/return value/
<sadmac2> SatanClaus: that, and the order of events is: emit starting event, pre-start script, start, emit started event, (running), emit stopping event, pre-stop script, stop, emit stopped event, post-stop script
<sadmac2> SatanClaus: so its just a question of where in the lifecycle the flush really goes.
<SatanClaus> ok, so you're right again, the tear-down should go into the pre-stop script.
<SatanClaus> if i register some task "foo" to "start on stopping firewall", will that be executed before firewall's pre-stop script or before stop?
<sadmac2> before the pre-stop
<SatanClaus> ok, so analogously my firewall can be "start on starting networking", right?
<SatanClaus> and does respawn make sense without exec or script stanza?
<sadmac2> SatanClaus: respawn specifies behavior when the service crashes. If there's no exec/script that can't happen.
<SatanClaus> sadmac: thanks a lot again... I just found the ufw.conf, which includes a pretty nice default firewall :-/
<sadmac2> SatanClaus: I don't use ubuntu so I can't help you there :)
#upstart 2011-01-03
<splotz90> hello ... can somebody answer a question about upstart?
#upstart 2011-01-04
<micheil> with upstart, I've noticed that each time my program crashes (with respawn on) that both my log files are truncated, anyone know anything about what could be causing this?
<SpamapS> micheil: does the program manage the log file?
<root_op> Apperantly this was the right channel.
<root_op> Right, so I'm trying to select a new init process since I'm feeling like trying something new. Besides sysinit-v's serializing method is pretty much obsolete and darn slow.
<root_op> At the moment I'm pending between systemd, launchd and Upstart.
<root_op> I've read pros and cons on each and every one of them. I've come to that systemd and launchd handles events through sockets, whereas Upstart doesn't. But still can.
<root_op> launchd has several integrated event methods like a built in FAM and a cron-ish method.
<root_op> Are there any pros with Upstart rather than any of the other ones?
#upstart 2011-01-05
<micheil> SpamapS: turns out yes, and that my i/o redirect was wrong; can up start manage the logfiles?
<SpamapS> micheil: not really.
<SpamapS> micheil: its on my todo list to develop a set of best practices for logging in upstart
<SpamapS> root_op|laptop[I: upstart is proven and its capabilities/shortcomings are well known and documented.
<micheil> SpamapS: okay, for now I'm just doing a exec program >> stdout.log 2> stderr.log
<micheil> style thing
<mreiss_> I'm trying to write a new upstart job, saving it in one folder and then adding a symlink to /etc/init. Upstart tells me "Unkown job". Does this mean that it is not possible to symlink to upstart jobs?
#upstart 2011-01-07
<djszapi> Why does it make sense to use daemons out of upstart if that can handle that sort of jobs ?
<jbn-o> I've got an upstart config file I'm having some trouble with â my process won't run ("ps auxw|grep -i radmind" shows the job isn't running) and "sudo start radmind" says "start: Job is already running: radmind" (which is not true).  If I put my /etc/init/radmind.conf file somewhere public, would someone help me?
#upstart 2011-01-08
<Jemt> Hello guys. I have created a job which executes fine when manually emitting the event. But it doesn't execute on boot. Can someone help ? Here is my small job: http://pastebin.com/cyVcbNg
<Jemt> Sorry, http://pastebin.com/cyVcbnNg
<Jemt> It's supposed to start together with gdm
<Jemt> gdm.conf contains this: emits starting-dm
<Jemt> So I don't understand why my job is not executed
<JanC> Jemt: the "emits" stanza is for documentation
<JanC> so maybe your gdm job is not emiting that event for some reason...
<JanC> also, did you test whether it's not running or failing to do what you want it to do?
#upstart 2011-01-09
<Jemt> Hello :)
<Jemt> I have created an upstart job which actually works just fine. But during boot, I receive the following message: "init: myjob main process (xxxx) terminated with status 1"
<Jemt> Why is that ?
<Jemt> Ah, I figured it out. The event I'm starting by is fired several times. The file system is not ready, hence my script fails multiple times, but succeeds the last time
<Jemt> I'm really in the need of a list of available events. It is difficult to figure out what event I need to use to trigger my script
<Jemt> I want it to run when all file systems have been mounted
<Jemt> FInally,  'start on mounted MOUNTPOINT=/' did it
<ion> jemt: If youâre running Ubuntu: start on filesystem
<Jemt> ion: Are all filesystems mounted then ?
<ion> yes
<Jemt> Perfect, I'll give it a try. Thank you :)
<ducktype> hi
<ducktype> http://paste.ubuntu.com/552318/
<ducktype> someone can help, i've mysql and mydns jobs, but i can't get mydns job depend on mysql
<ducktype> start mysql start mydns works but on reboot only mysql gets started
#upstart 2012-01-02
<muhdiekuh> hi, i got an issue on ubuntu 11.10: "service mysql status" says "mysql start/running", although mysql is not running. any hints, on how to debug this? (crossposted in #ubuntu, but thought, it might make more sense here)
#upstart 2012-01-03
<venugopal> Hi, I have question regarding the upstart script?
<venugopal> I have written script in /etc/init/daemon.conf - how to launch or application from this script with sudo permissions???
<venugopal> can anyone help me with this issue
<venugopal> ? 
<jodh> venugopal: http://upstart.ubuntu.com/cookbook/#run-a-job-as-a-different-user
#upstart 2012-01-04
<bencc> can I use upstart to start a python server as a daemon?
<bencc> I want to run rtmplite http://code.google.com/p/rtmplite/
<venugopal> jodh, Thanks for reply. I am able to fix it and it is working fine for all flavours of ubuntu and not working for fedora 15 OS.
<venugopal> Will the same upstart script works for Fedora 15?
<jodh> venugopal: Fedora 15 uses systemd, not Upstart.
<plautrba> venugopal: there is upstart-1.2-4.fc15 and you need upstart-1.3 so it won't work probably
<venugopal> ok
<bencc> if I'm using upstart with a python server, I don't need something like python-daemon?
<bencc> or do I need both?
<jodh> I don't understand your question.
<bencc> jodh: rtmplite is a server that you can run in the terminal
<bencc> I want to run it as a daemon
<bencc> I can do it with python-daemon and/or upstart
<bencc> my question is, if I'm using upstart to start and monitor rtmplite do I still need a python daemon or is it not necessary?
<jodh> I think that's a python question really. Upstart doesn't make a program run as a daemon: it manages daemons and other programs. You'd need to look at what python-daemon provides to your python app to see if it is appropriate to use that in your case or not.
<Ronnie> im trying to make an upstart script for service i need to runs, but somehow i cant get it to work: http://paste.ubuntu.com/793007/
<bencc> jodh: python-daemon runs a python process in the background and manage a pid lock file for you so you can start, stop and restart the process
<bencc> isn't that what upstart does?
#upstart 2012-01-05
<SpamapS> bencc: not really
<SpamapS> bencc: upstart allows you to coordinate the start/stop with other events
<SpamapS> bencc: it does end up replacing the need for pid/lock files, but thats only a small subset
<bencc> SpamapS: I understand that python-daemon is only a small subset of upstart
<bencc> I'm asking if I'm using upstart to monitor a long-living process, do I still need python-daemon or not
<jodh> bencc: python-daemon has *nothing* to do with Upstart. If your python script runs on the command-line, it should work as a job. If it forks, Upstart will need to know about it though. See http://upstart.ubuntu.com/cookbook/#precepts-for-creating-a-job-configuration-file, and particularly http://upstart.ubuntu.com/cookbook/#expect
<bencc> jodh: can you explain what python-daemon does that upstart doesn't?
<jodh> bencc: I have zero knowledge of python-daemon - it's nothing to do with upstart. This channel is for discussing Upstart, not python.
#upstart 2012-01-06
<Ronnie> somehow an the process created by the upstart job is crashed. i had the option respawn on, but that did not do anything. now, stop <service> command wont work anymore (it hangs with a blank line)
<Ronnie> if i do : status <service> i get the error: status: Unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
<JanC> Ronnie: what for system is this running on?
#upstart 2012-01-07
<bencc> can I have two upstart jobs in the same ubuntu package?
<soren> Sure.
<soren> (Not really an upstart question, though)
<bencc> soren: how?
<soren> bencc: Can we take this in #ubuntu-motu, please? It's not really relevant for this channel.
#upstart 2012-01-08
<venugopal> I am using daemib which is launched using upstart initctl start command. From this daemon I am trying to launch firefox browser with user permission using command "sudo -u <username> xdg-open http://www.google.com"
<venugopal> This launching in user mode and everything is fine  on ubuntu 11.04. But on ubuntu 10.04, 10.10 version it is still launching in root mode..  
<venugopal> Can anyone tell if there is any patch available for these two lower versions..
<venugopal> ?
<venugopal> can anyone help me with this issue?
<JanC> I'm not sure why you need a system job to launch Firefox?  (you probably can't even be sure that there is an X session with that user logged in at that moment?)
<venugopal> JanC, This how my daemon works. It is responsible of displaying the basic UI and In this case I am sure that there is an X session with that user logged in..
<venugopal> Since this is triggered from user input..
<JanC> and the daemon can't run as the user?
<JanC> actually, why not let the user process that starts the daemon also start the browser?
<venugopal> no daemon can't run as user. since it needs root permissions.
<venugopal> but from the daemon I want to launch the browser with user permissions as seperate process..
<venugopal> JanC, Is there any way to get this working??
<venugopal> But the samething is working finr on ubuntu 11.04 version..
<JanC> so how does the user start the daemon?
<venugopal> daemon is start by "initctl start" command
<venugopal> *started
<venugopal> from /etc/init/script
<JanC> so why not make a script that runs "initctl start", waits until the daemon is started, then starts Firefox?
<venugopal> actuall initctl start is called while installing my debian package in postinst script.
<venugopal> firefox is started from daemon when user selects a button in UI displayed by daemon.
<venugopal> so I have to launch the firefox from the daemon only.. 
<venugopal> JanC, Any way to fix this?
<JanC> ugh
<JanC> venugopal: not sure what you are trying to do, but to me it sounds like you try doing things the wrong way...
<venugopal> JanC, My daemon is started from init scripst using initctl command, responsible for displaying UI and depending on UI events it wants to launch the firefox with user permission using xdg-open command.
<venugopal> Yes, wrong thing here is daemon shouldn't contain any UI.. But that's the way client has request us.. they don't want seperate app for UI.. so we don't other way. 
<JanC> venugopal: tell them they are nuts  :P
<JanC> actually, why does that daemon need root?
<venugopal> It is an antivirus software and need root access to monitor the iptable details and monitor applications trying to access internet..  
<venugopal> but the same logic is working fine on ubuntu 11.04 and only problem is with 10.04, 10.10 versions..
<venugopal> JanC, Any pointers?
<JanC> yes: use separate programs
<JanC> BTW: running GUI apps from postinst scripts is *not done* (because there really is no way to do it properly)
<JanC> for example, you don't know which user installed the package, so you can't know on who's display you have to show it
<JanC> (if there is an X display at all)
<venugopal> but I am sure on whos display I have to show the UI.. 
#upstart 2013-01-01
<njbair> are the .conf files in /etc/init/ a part of upstart?
<stgraber> they are jobs, so those are usually shipped by the individual packages. Some are shipped by upstart though (like the tty* ones for example)
#upstart 2013-01-02
<xnox> "BAD: wrong value for inotify_init (), expected less than 0 got -1" =)))
<xnox> TEST_LT (inotify_init (), 0);
<SpamapS> xnox: ARM?
<xnox> SpamapS: amd64 =)
<SpamapS> weird
<SpamapS> perhaps that assertion is wrong?
<xnox> SpamapS: racy & random for added bonus =)
<SpamapS> ah, perhaps racing with a signal handler?
<xnox> SpamapS: assert is correct, half way through we try to exhaust all available inotify watches to test behaviour with "no inotify support"
<SpamapS> ah
#upstart 2013-01-03
<tzafrir_laptop> If I package a package with a upstart file, should I remove the existing init script?
<tzafrir_laptop> Is there anything wrong with having both of them?
<afournier> disk space ? :p
<afournier> double init ?
<tzafrir_laptop> afournier, yes, double init
<tzafrir_laptop> When I removed the init script and rebuilt the package I got an odd warning from lintian
<tzafrir_laptop> about the init.d script missing
<afournier> lintian ?
<JanC> tzafrir_laptop: Ubuntu packages usually symlink a special init script ('/lib/init/upstart-job') in /etc/init.d/ to replace the original init script
<afournier> it's possible that your package contains pre/post install scripts
<tzafrir_laptop> Looks like dh_installinit automatically generates code in postinst script for the init script
<tzafrir_laptop> Even though I don;t have it.
<tzafrir_laptop> And this causes: W: init.d-script-not-marked-as-conffile and E: init.d-script-not-included-in-package
<tzafrir_laptop> No symlink was created
<tzafrir_laptop> nither in the package nor in a postinst script
<Diranged> hey im fighting with upstart and uwsgi right nowâ¦ when we run our uwsgi service manually (command line) it works perfectly. but when we run the exact same commands in an upstart job, we end up with a threading problem in our django app that causes the app to hang
<Diranged> does upstart do anything strange to the environment, or fork anything in a funny way that might break like this?
<geofft> I don't know a ton here, but upstart ptraces jobs to figure out if a daemon has forked yet, which sounds vaguely relevant. 
<geofft> You might want to play with the 'expect' commands? 
<Diranged> hmm.. 
<geofft> in the job configuration (expect fork, etc.) 
<Diranged> expect fork didnt help.. 
<Diranged> actually it seems to break it.. it starts up, but then i cant kill the app
<SpamapS> Diranged: yeah only use expect fork if your program actually daemonizes
<Diranged> ah yeah.. sorry, uwsgi doesnt in emperor mode..
<SpamapS> if you're not using expect fork, you won't be ptracing
<Diranged> is there a way to "restart" upstart so that it reloads the config? it kind of hangs after this.. 
<SpamapS> upstart will simply fork, and exec. nothing special.
<Diranged> ok.. hrmm
<Diranged> SpamapS: https://gist.github.com/4445532
<SpamapS> Diranged: if you incorrectly specify expect fork, the only way to get rid of the dead pid is to re-exhaust the pid space until that pid exists. Its a well known bug
<Diranged> thats basically our uwsgi config.. (minus the "âmaster " .. that was a test)
<SpamapS> one that I believe has a solution forthcoming.. finally
<SpamapS> Diranged: I suspect there's something in your environment variables or ulimits / umask that makes it work when you run it directly
<Diranged> hmmmm
<SpamapS> Diranged: are you 100% positive you want to run that as root?
<Diranged> SpamapS:  the master process needs to run as root.. but it doesnt spawn any of the children as root
<Diranged> but hmm
<Diranged> you bring up ani nteresting point
<Diranged> (about the ulimits)
<Diranged> i wonder if theres a way to check that.. 
<SpamapS> just change the 'exec' line to 'exec bash -c "ulimit -a"' and look at what it says
<Diranged> there are a few subtle differences.. hmm
<SpamapS> Diranged: is uwsgi logging why it fails?
<Diranged> SpamapS: yeah so the django app starts up under the uwsgi vessal and begins to do its work. it creates a connection with Kazoo to our zookeeper service, and then immediately hangs. the connection fails, and an execption is raised
<Diranged> SpamapS: the connection is handled in a python Threading object.. so my guess is that the object and/or connection is being broken somehow. but as i mentioned, it ONLY happens when we run inside of upstartsâ¦ 
<Diranged> can i set specific limits for my upstart job in the upstart config file?
<SpamapS> Diranged: lots of threaded python stuff runs under upstart, so I can't imagine why that would cause issues.
 * SpamapS points at openstack
<SpamapS> lots of threaded python stuff :)
<Diranged> i know.. im totally stunned by this..
<Diranged> and this isnt the only thread we run.. its just the first one we've seen that does this
<SpamapS> Diranged: does it, by any chance, open stdin and try to select() it or something.. where when its attached to your terminal, thats fine, but in upstart, that might just block
 * SpamapS is grasping at straws
<Diranged> SpamapS:  how messed up is this â¦ zk_watcher (an app we wrote in house) that we run with upstart, leverages nd_service_registry (which is our kazoo management api), and it works perfectly fine
<geofft> Yeah, I'm also surprised. It's just that given that you're having problems, ptrace sounded like an easy thing to blame 
<Diranged> SpamapS:  this only fails under uwsgi, under upstart.. 
<SpamapS> geofft: ptrace is not  used at all without expect fork/daemon
<Diranged> https://gist.github.com/4440744 < the log of the kazoo failure.. it basically hangs at "xid: 1".. and 15 seconds later, a timeout hits and an exception is raised.. 
<Diranged> (not that helpful.. but just in case)
<SpamapS> Diranged: crazy thought, strace the program
<Diranged> ive tried a bit .. but im not a big strace reader.. though, we have  a few devs here who are, so i may get them involved
<SpamapS> its pretty simple
<Diranged> ill run it once via cli and make it work and trace it.. then ill run another time via upstart and trace it.. we'll see what happens
<Diranged> ugh,.. i still think this is upstart+uwsgi related, but im going back to the uwsgi channel to debug this a bit more with them
<geofft> SpamapS: ah, okay. I thought there was a default that involved ptracing, but apparently I was wrong 
<Diranged> this has SOMETHING to do with the way our wsgi app is loading
<Diranged> because if i init *a* kazoo object right inside of our wsgi file (before the application is really loaded), then it initalizes fine.. and THEN our app init's its own kazoo object, and works fine..
<Diranged> (leaving us with 2 connections.. which is bad.. but still.. its some progress)
<Diranged> SpamapS: hey just circling around.. the issue is somewhere in our Django app. If we set the LANG variable in our uwsgi app, it works fine.. if we dont, it fails. Upstart just wasnt getting that environment variable. 
<Diranged> i have no idea why that variable means so much to the way Django handles connections/threadsâ¦ we're sitll digging in â¦ but its not an upstart failure
<SpamapS> Diranged: *ahh LANG*
<SpamapS> Diranged: right, you can't realy assume any environment variables in upstart jobs
<Diranged> yeah.. itrs funny, we dont.. but it must be something burried in the python code somewhere
<SpamapS> Diranged: I suspect its more that some underlying library wants it to be set..perhaps a non-thread-safe-error-handler is the issue
<Diranged> yeah.. im still diggin around trying to understand it..
<SpamapS> Diranged: glad you got some insight though. I'd say 99% of the time when somebody has a problem with an upstart job that works fine in a login shell, its environment variables
<Diranged> makes sense.. well, now its time for me to dig into the python..
<Diranged> i dont mind setting that vairable, but i want to understand WHY i need to
<SpamapS> Diranged: yeah, I would too
<Diranged> thanks again for hte help.. ttyl
#upstart 2013-01-04
<villev_> Any way to debug why my new service in /etc/init doesn't shom up?
<villev_> e.g. in service --status-all
<villev_> this on ubuntu quantal
<villev_> nevermind. the service itself works; it doesn't show up in --status-all
<GeorgeJ> Hello folks!
#upstart 2013-01-05
<GeorgeJ> I'm running Ubuntu 12.10. I've installed deluged and deluge-web. The problem is: deluged comes with an init script in /etc/init.d, which, as long as I can tell tells upstart when the service starts, here's the file: http://paste.ubuntu.com/1497703/. The problem is, I wrote an upstart job for deluge-web as such: http://paste.ubuntu.com/1497681/. However, when I do sudo service deluged start, it does not also start deluged-web. 
<GeorgeJ> What could I be doing wrong? sudo service deluge-web start works just fine.
<xnox> don't use start-stop-daemon
<xnox> setuid/setguid commands are available as upstart stanzas, see upstart cookbook
<xnox> i don't know if umask is needed
<xnox> GeorgeJ: increase upstart verbosity (see cookbook) and then fully stop everything, start deluged and inspect what events are emitted. Maybe deluged fails to start? or is already running (aka -web missed the event already)
<GeorgeJ> xnox: I stopped both services(and checked to make sure). And then just started deluged, to no avail.
<GeorgeJ> I'll check how to increase verbosity.
<GeorgeJ> xnox: I've added --verbose, should the log not be /var/log/syslog?
<xnox> dmesg or syslog, can't remember. And it's with initctl call not "--verbose" =/ how did you increase verbosity?
<xnox> http://upstart.ubuntu.com/cookbook/#initctl-log-priority set to debug level
<xnox> $ sudo initctl log-priority debug
<GeorgeJ> I've added --verbose to the linux line in grub.
<xnox> oh... extreme =)
<GeorgeJ> I've stopped and started ufw(which has an upstart job in /etc/init), but got no events in /var/log/kern.log /var/log/syslog and /var/log/dmesg :(
<GeorgeJ> Even even done sudo initctl log-priority debug
<xnox> GeorgeJ: I got them in $ dmesg
 * xnox ponders why they are there and not elsewhere.
<GeorgeJ> xnox: Yes, it seems that `dmesg` indeed show the events. But not for my script, meh :(
<GeorgeJ> Well, not MY script, that script.
<xnox> and you removed init-script and only have upstart jobs at this point?
<GeorgeJ> No, I have the init script. I don't like to remove files that were installed by packages.
<xnox> but then you have clashing names.... 
<xnox> GeorgeJ: and it's config files under /etc/ you are safe to modify/remove them. If you want audit, install etckeeper that does version control the whole /etc.
<GeorgeJ> xnox: Cool!
<GeorgeJ> Well, the installed init script is at /etc/init.d/deluged and it starts deluged just fine.
 * xnox thought you are rewriting it to be an upstart job?! no?!
<GeorgeJ> I want to start another binary called, deluge-web, so I've added http://paste.ubuntu.com/1497681/ at /etc/init/deluge-web/conf
<xnox> ah.. I see.
<GeorgeJ> Oh no, I'm adding one.
<xnox> I have no clue if sysv scripts emit events that upstart jobs can see.
<GeorgeJ> Well, there's no reason I'd assume so either, but the init script(http://paste.ubuntu.com/1497703/) contains start-stop-daemon, is that not the script telling upstart that the daemon started?
<xnox> GeorgeJ: you can cheat and in `deluge-web` pre-start stanza do `service deluge start`.
<xnox> GeorgeJ: no.
<GeorgeJ> Aha! Then that's completely understandable.
<GeorgeJ> Nah, I just start deluge-web independently, it shouldn't really matter in this case. I'll just bug the package maintainer to remove the init scripts and add the proper upstart jobs!
<xnox> initscripts are big pile of crap, there is an upstart-sysv bridge that can manage and run them in a similar fashion to upstart jobs, but I don't know which events get emitted, if any.
<xnox> GeorgeJ: yeap, file a bug on launchpad requesting an upstart job against that package.
<GeorgeJ> xnox: Hmm, is there a template, or an existing such bug request I could use to make it easier? I've never really filed a bug before. Or, should I just describe my problem?
<xnox> GeorgeJ: `ubuntu-bug deluge` follow promts and type "please provide an upstart job" you may want to say that you have other upstart jobs that depend on that one.
<xnox> Good night!
<GeorgeJ> xnox: Thank you very much! Good night!
<Aeyoun> Hi. I have a problem with deb packaging. Every file in debian/* is copied over to the build-area *except* for the upstart file so it fails to be detected by dh_installinit and is not included in the package. Hoping there is some knowledge overlapp here so I can get some help.
<Aeyoun> I have studied other deb packages and cannot see that any of them are doing anything different from what I am doing.
<SpamapS> Aeyoun: the file should be named packagename.upstart or packagename.jobname.upstart
<Aeyoun> SpamapS, I have tried naming it upstart, packagename.upstart, and packagename.jobname.upstart. all fail. (All are valid, though. The dh_installinit util looks for all of them.)
#upstart 2013-01-06
<highway900> Hi :D
<highway900> Hi, some processes I have started with upstart are causing my machine to hang when shutting down. i.e. shutdown is unable to kill the processes. Any ideas how to debug what is causing this?
#upstart 2013-12-30
<jriddy> herro, i'm having a problem where upstart seems to give up respawning a process, but i need it to continue to try
<xnox> jriddy: crank up the respawn limits?
<xnox> jriddy: see cookbook for details.
<jriddy> xnox: thanks
<crankharder> having a real hard time getting upstart to recognize that this job is no longer running
<crankharder> https://gist.github.com/crankharder/12fcad9ca638b9222c7a
#upstart 2013-12-31
<ion> crankharder: https://github.com/ion1/workaround-upstart-snafu
<saruman_> can you use any word value for an 'emits' stanza and then use it as an event identifier in a 'starts on' stanza ?
<saruman_> so if i wanted to modify mysql.conf and add emits mysql, would i then be able to use that in a different .conf as starts on mysql ?
#upstart 2014-01-02
<comjf_> is there a way to fork a process as a post-stop? my problem is I have a server that is responsible for deploying other servers (when sent a passed message from CI). The problem is, it can't deploy itself... the sidekiq process that controls the deployment is killed when the site is restarted
<comjf_> I'd like to be able to keep the sidekiq process up long enough to finish the deployment of itself... I figured the easiest way for this was to fork it
<comjf_> sorry I meant to say pre-stop
#upstart 2014-01-03
<taharqa> hi folks
<taharqa> I got a weird issue
<taharqa> i've got /etc/init/docker.conf and inside the script I have 
<taharqa>  
<taharqa> DOCKER=/usr/bin/$UPSTART_JOB
<taharqa> if [ -f /etc/default/$UPSTART_JOB ]; then
<taharqa>         . /etc/default/$UPSTART_JOB
<taharqa> fi
<taharqa> "$DOCKER" -d 
<taharqa>  
<taharqa> where UPSTART_JOB is docker and in the /etc/default/docker file I have 
<taharqa>  
<taharqa> tmp1=`rtierut`
<taharqa> export http_proxy="http$tmp1"
<taharqa>  
<taharqa> at the end http_proxy is something like http://myuser:mypassword@myhost.mycompany.com:80/
<taharqa> rtierut is just computing password from crypted source
<taharqa> problem is that when "$DOCKER" -d is executed http_proxy became http://:@myhost.mycompany.com:80/ !
<taharqa> upstart seems to remove myuser and mypassword from variable env. so my program can not work !
<taharqa> how can I remove this behaviour ?
<xnox> taharqa: are you sure the tmp1 results in full proxy? when exectued by the system job?
<taharqa> xnox: yes i'm sure
<taharqa> I execute the exact same script outsite of upstart
<taharqa> and it works properly
<taharqa> user and password are removed by a mysterious force
<taharqa> I mean with upstart
<xnox> taharqa: the environment that upstart runs it under is quite different. Can you try adding: "rtierut > /tmp/test-output" above tmp1 and check again?
<xnox> taharqa: "env >> /tmp/test-output" should also help.
<taharqa> already done ^^
<taharqa> I mean env is already logged
<taharqa> I try to output "rtierut >             â SpamapS
<taharqa> oops sorry
<xnox> ... from within upstart job. not like executing it manually in any way. 
<taharqa> result is I got a cleaned output  
<taharqa> ://:@myhost.mycompany.com:80/
<taharqa> no user nor password
<xnox> so what does your script do?
<xnox> and can you paste full job docker.conf?
<xnox> it's probably a bug in your rtierut script.
<jodh> taharqa: http://upstart.ubuntu.com/cookbook/#determining-why-your-service-fails-to-start, http://upstart.ubuntu.com/cookbook/#see-the-environment-a-job-runs-in
<jodh> , http://upstart.ubuntu.com/cookbook/#checking-how-a-service-might-react-when-run-as-a-job
<xnox> taharqa: note that system jobs run as root, with no HOME set, etc.
<taharqa> xnox: when I run "rtierut > /tmp/test-output" from the command line I got the good output
<taharqa> jodh: I chek your link now
<xnox> taharqa: correct, but upstart does not run that command that way.
<xnox> taharqa: i'm asking you to change things in /etc/default/docker...
<xnox> taharqa: can you paste, (sanitized), contents of rtierut?
<taharqa> xnox: yop
<xnox> (maybe in private to me)
<taharqa> xnox: ok
<taharqa> #!/bin/bash
<taharqa> tmp1=`aya $odalyer`
<taharqa> tmp2=`aya $carmiut`
<taharqa> tmpx="://$tmp1:$tmp2@@myhost.mycompany.com:80/"
<taharqa> echo $tmpx
<taharqa>  
<xnox> taharqa: but odalyer and carmiut variables are not set at alll... hence empty output.
<taharqa> in fact they are in /etc/environment
<xnox> taharqa: it's a global job, so you do need to configure proxy for the whole machine.
<taharqa> xnox: odalyer and carmiut can not be seen even if they are in /etc/environment ?
<xnox> taharqa: add "env > /tmp/upstart-environment" in the /etc/default/docker, then do $ sudo start docker
<xnox> taharqa: and you will see precisely what's the environmet like when your job is run.
<taharqa> xnox: doing this now
<xnox> taharqa: and i don't believe all the variables you expect to be, are available.
<xnox> taharqa: you can probably "fix" it by souring /etc/environment, if it's safe to source.
<xnox> taharqa: why are you doing it in such a way? are those passwords changing dynamically? because it's trivial for anyone to sniff it via /proc/$pid/environ after docker starts.
<taharqa> xnox: yeah this is just a first naive protection
<taharqa> you're right
<taharqa> I can not just write down the password anyway
<taharqa> and yes it changes sometimes
<xnox> taharqa: it's better to e.g. add a "export http_proxy=http://user:pass@foo" into /etc/init/docker.override and mark that file readable by root only.
<xnox> taharqa: and use e.g. puppet to rotate/set the file.
<xnox> taharqa: also you'd want to use "hidepid=2" mount option on /proc such that non-root users cannot read it.
<taharqa> you were right 
<taharqa> there is no odalyer nor carmiut
<xnox> taharqa: if one has root or physical access on the machine they can execute that file those helpers anyway
<taharqa> a source /etc/environement should work though
<xnox> taharqa: hidepid=2 and only readable by root is your best protection, which actually do limit non-root users from finding the proxy password out.
<taharqa> xnox: wow , I try to undestand this one
<taharqa> understand*
<taharqa> xnox: does /etc/init/docker.override is a upstart mechanism ?
<taharqa> xnox: how this will help ?
<xnox> taharqa: docker.conf can stay public / world readable / in puppet configs, yet docker.override can be managed more strictly with mode 600 owned by root.
<xnox> taharqa:  see http://upstart.ubuntu.com/cookbook/ 
<xnox> taharqa: .override allows to overlay stanza by stanza over the .conf configuration.
<xnox> taharqa: but you also must mount or remount /proc with hidepid=2 mount option, which will prevent non-root users from reading /proc/$docker_pid/environ.
<taharqa> xnox: thank you
#upstart 2014-01-04
<pikaren> ~/.config/upstart $ ls
<pikaren> rescuetime.conf
<pikaren> ~/.config/upstart $ start rescuetime
<pikaren> start: Unknown job: rescuetime
<pikaren> system: linux mint  upstart version: 1.10
<pikaren> and i've changed my upstart.conf to http://bazaar.launchpad.net/~upstart-devel/upstart/trunk/view/1301/dbus/Upstart.conf
<pikaren> please help?
<jrib> hello!  If I would like to have a job that is managed by an unprivileged user, what is the best way to do this?  Should I create a user job in ~/.config/upstart?  I need the job to run automatically at boot
<jrib> i guess http://upstart.ubuntu.com/cookbook/#non-graphical-sessions-ubuntu-specific is the way? 
<jrib> it seems somewhat hacky/like it's going to change.  I'm thinking of just using setuid/setgid and setting up sudoers so the user can control the one job.  Thoughts?
<jrib> plus it would make it clunky to control the job
<xnox> pikaren, well you are now gone....
<xnox> jrib: if it's a system job, make it a system job in /etc/init/ and with correct start on it will start on boot.
<xnox> jrib: if you want to allow some users to control it (e.g. start/stop/restart/reload etc.) i believe you can apply policykit rules to allow those actions. Or e.g. create simple setuid scripts around initctl to do that + e.g. change permissions on the job file to allow a group of users to write/modify it.
<xnox> jrib: typically setuid/setguid/export HOME= are sufficent to make a "system" job to run unprivileged.
<bwlang> hi... i'm trying to get an upstart script to respond to a dvd insertion...
<bwlang> i can see the udev event using udevadm monitor --property --udev
<bwlang> but i don't think my script /etc/init/dvd-inserted.conf is being run.
<bwlang> where can i find the logs about this or increase the logs.
<bwlang> ?
<bwlang> i start with start on block-device-added; task; script ; echo 'here' > /tmp/dvd_inserted; end script (s/;/\n/)
#upstart 2014-01-05
<xnox> bwlang: there is upstart-monitor package/script which lets you monitor all events emitted.
<xnox> bwlang: i think that will help.
<bwlang> xnox... hmm i iwas just poking around in the wrong place... so thanks for redirecting me  - great timing ;)
<bwlang> xnox: hmm this script seems broken.  upstart-monitor -n still seem to be trying to find gtk  (which i do not have0
<xnox> bwlang: there is an option to force non-gui mode.
<bwlang> yeah... the man page says -n
<bwlang> but it does not seem to work.
<xnox> bwlang: and in some releases it used to have a bug where it would still try to import python-gi / gtk-gir.
<bwlang> ah... i'll try to find an updated version
<xnox> bwlang: try later one, or just comment out the Gtk imports.
<bwlang> oh... it's just python - i'll try to munge it a bit;
<bwlang> it was a missing dependency on gir1.2-gtk-3.0
<bwlang> xnox: hmm - i see the events but i don't see my echo...  do i need to do something to get my script to be re-read?
<bwlang> xnox: did i do something dumb? https://gist.github.com/bwlang/e815f103ae0cbea1a7ba
<bwlang> rebooting now...
<bwlang> hmm - i get the echo on reboot, but i don't get it when i do eject -T... even though i do see the events using upstart-monitor
<bwlang> ah... s/added/changed/ doh... thanks xnox for pointing me in the right direction, and staying silent while i embarass myself 
<xnox> bwlang: i get a whoops when browsing that. Can you copy&paste to e.g. paste.ubuntu.com ?
<xnox> bwlang: I'm just really busy, and periodically check irc =) i'm glad you sorted your job ;-)
<bwlang> xnox:  thanks... sorry to bug you.
<bwlang> now i'm just sorting out the script conditions, upstart-monitor really helped me track this down.
<xnox> bwlang: no worries =) at least you stayed connect to irc for someone to come back to you... most people drop off rather quick =)
<p3rsist> With upstart, how can I make a job B restart when job A is restarted?
<ion> stop on stopping A, start on started A
<p3rsist> yeah okey thanks :)
#upstart 2014-12-30
<mietek> Hi.
<mietek> Iâm looking for some help with Upstart "start on socket"
<mietek> With initd, there is a "nowait" option
<mietek> With systemd, there is an "Accept=true" option
<mietek> I cannot find a way to do the same thing with Upstart
<mietek> Any hints?
<mietek> With xinetd, there is a "wait = no" option, too
<mietek> s/initd/inetd/
#upstart 2014-12-31
<`jpg> Hey guys.
<`jpg> I am trying to create an Upstart job that tests the config of my daemon before restarting it.
<`jpg> Is there an idiomatic way to do this in say pre-start?
#upstart 2016-01-04
<drags> is it possible to detect when a job is respawning? I'm trying to catch my jobs crashing but I can't find the magic "start on" invocation (also upstart-monitor fails to launch on 14.04 because Gtk is missing, even though it logs a fallback to CLI)
#upstart 2016-01-05
<drags> well, patched around the Gtk thing, but this is all the output I'm seeing from upstart monitor: https://gist.github.com/drags/a4b798734a1639a12d3a
<drags> the hey job is respawning after its script (calling an external script that sleeps and then exits 1), but I don't see any way to distinguish that from the output.. any alternatives?
#upstart 2016-01-08
<m1dnight_> I have an upstart script that needs to use rbenv to use ruby 2.3.0. But I can't seem to get it configured.
<m1dnight_> https://www.refheap.com/113456
<m1dnight_> any ideas?
<m1dnight_> Ive really tried a lot.
<JanC> what did you do to debug?  how does it fail?
<JanC> m1dnight_: ^^^
<m1dnight_> First of all I have made sure that rbenv works properly when logged in. So testing the application (a node app) in my login schell works fine.
<m1dnight_> now i was testing if the env works when i run it without upstart
<m1dnight_> sec pls
<m1dnight_> so `export FOO="bar"` makes the value available in the script
<m1dnight_> (the script is run by a node.js application which is in turn run by the upstart)
<JanC> this doesn't run like a login shell, so AFAIK $HOME won't be set to ~cdetroye etc.
<m1dnight_> hmm setting the home var breaks gulp
<JanC> and it seems like rbenv needs to find stuff in $HOME ?
<JanC> (I don't really use Ruby)
<m1dnight_> neither do I. Its for jekyll.
<JanC> it doesn't work with whatever is the system-installed ruby?
<JanC> also, if I understand correctly, it's gulp that runs the ruby script at some later time?
<m1dnight_> no. gulp runs the node.js app.
<m1dnight_> and from within node, i call a bash script which builds a jekyll website.
<m1dnight_> so upstart( gulp ( node (bash)))
<m1dnight_> if that conveys it properly
<JanC> so you really need to set the rbenv environment in that bash script, I think
<JanC> seems like you can set the environment with a local configuration file too
<m1dnight_> yeah I tried that but it doesnt get read
<m1dnight_> so my guess is that rbenv is not being run properly.
<m1dnight_> the quest is still ongoing
<JanC> I'd say, if gulp runs de node.js app, then the bug is likely not in your upstart script
<JanC> (even if I think sourcing .zshrc there doesn't seem like a good idea)
<JanC> unless you have zsh as /bin/sh ?
<JanC> stupid question: do you really need a node.js process to run that as a hook?
<m1dnight_> JanC: yeah I think so.
<m1dnight_> hmm
<m1dnight_> When I add $HOME it breaks gulp and node.
<m1dnight_> Is that normal?
<m1dnight_> and they are even isntalled in /usr/bin/
<m1dnight_> is there another name for upstart?
<m1dnight_> to google a bit more
<m1dnight_> woohoo I fixed it
<m1dnight_> <3
<JanC> I think most of what you need would be in the cookbook
