#upstart 2007-08-05 <dg> what's the normal way to get a log from something upstart started to go to syslog? <dg> pipe it to logger? <dg> seems to work, although it seems upstart can't kill the processes properly if you do that.. #upstart 2007-08-06 <leeyee> Hi, I just want to look into how upstart works when Linux startup, any suggestion? <leeyee> Simply which directory upstart entered in at first will be okay #upstart 2007-08-07 <Eruantalon> How do I make upstart only startup networking when there is actually a cable in the network card(during boot). It works fine once I am in gnome(running Ubuntu feisty). <wasabi> Well, you write about a dozen scripts, to propigate events such as that. <wasabi> Or you use network manager instead. <Eruantalon> What should Wired Connection be set to for that to work? <wasabi> eh? <Eruantalon> in network manager; do you have any experience with that? <wasabi> Uh huh. What do you mean "what should it be set to?" <wasabi> There's only one option: on/off <Eruantalon> oh, but that was not what I was hoping for #upstart 2007-08-08 <Eruantalon> My problem is that my boot time goes up by 120 seconds(more or less) when no cable is present(laptop) <mbiebl> Eruantalon: If you need a more lightweight solution than NetworkManager, use ifplugd <wasabi> And what causes that to happen? <Eruantalon> wasabi, well bootchart tells me it hangs on dhclient-script which is called by ifup.. I gather that means that it is stuck waiting for network configuring data that never comes <Eruantalon> because of lack of link to the outside world <wasabi> Uh huh. So don't bring up network automatically using Debian tools. <wasabi> Remove 'auto' from /etc/network/interfaces <mbiebl> But only for eth*. You still want your loopback device setup ;-) <wasabi> Yes yes <Eruantalon> wasabi, And put what in its place (I gather that is the same thing as disabling roaming mode in networksettings? <wasabi> Use network manager. <wasabi> Completely bypasses that. <Eruantalon> OK. <Eruantalon> But is there a way to make sure that it still happens upon entering gnome? <Eruantalon> I'd like the roaming features, works great, just not while booting. <wasabi> Hmm? <wasabi> That's what network manager is for. <Eruantalon> Ok, Then tell me should roaming be on or off? <mbiebl> Eruantalon: What do you mean by "roaming mode", switching automatically between available wireless networks? <Eruantalon> mbiebl, yes. But it is not my expression it says that in network settings <wasabi> I don't even know what screen you are refering to. <mbiebl> Eruantalon: If you are using wireless, network-manager is indeed the best choice for you. <Eruantalon> Ok just to make sure that we are talking about the same thing... What network manager are you talking about? <mbiebl> Just make sure, you comment all all eth* entries in /etc/network/interfaces <wasabi> apt-get install network-manager-gnome <wasabi> The only one of all of the solutions named "network manager" <Eruantalon> and what command opens it? <wasabi> It adds itself to your session. Install it, log out, then back in. <Eruantalon> mbiebl, I am using both wireless and wired( because sometimes wireles is to slow) <wasabi> Or run "nm-applet" <mbiebl> Better: "nm-applet --sm-disable" <wasabi> What's sm-disable do? <Eruantalon> wasabi, Ok, That is the same thing as what i've already got <mbiebl> Otherwise you will have two nm-applet instances nextt time you log in. <wasabi> Eruantalon: Okay, and what's wrong with it? <mbiebl> Eruantalon: Have you read /usr/share/doc/network-manager/README.Debian? <Eruantalon> Well Nothing. It is the startup scritpt during boot that wants to start networking when there is no cable which is a problem <wasabi> Nope, it's not. <wasabi> It does not block boot. <wasabi> Again, Debian network infrastructure does that. <wasabi> Again, comment out the auto lines for eth* in /etc/network/interfaces <Eruantalon> wasabi, And put nothing instead? <mbiebl> yes. <wasabi> I'm about done with this. <Eruantalon> And that will make sure nothing network related is started until gnome is? <wasabi> No. It will not make sure of that. <Eruantalon> Thanks a bunch anyway <wasabi> It will not use Debian's network infrastructure to start dhclient and block on it. That is all it will do. <wasabi> If you have other pieces of software which block on the network, you'll need to fix those. <wasabi> Such as for instance mounting network file systems in fstab. <wasabi> Also, as soon as the network manager daemon is started, it goes off and starts dhclient, in the background. <Eruantalon> Well I've commented out the two auto's and I guess I will have to restart to see what happens. Thanks. <wasabi> Do not comment out auto lo <wasabi> As mbiebl said earlier. <Eruantalon> I haven't :-) <mbiebl> Eruantalon: please pastebin your /etc/network/interfaces <Eruantalon> ok two seconds <Eruantalon> http://paste.ubuntu-nl.org/32977/ <Eruantalon> Ok? <wasabi> You have the wireless interfaces set to auto also. <wasabi> You'll want to disable them too. <wasabi> The idea is whatever you set to auto and dhcp results in dhclient being started at boot, and waiting. <Eruantalon> everything but lo ? <wasabi> Correct. <Eruantalon> thanks <mbiebl> Eruantalon: you can remove everything besides <mbiebl> auto lo <mbiebl> iface lo inet loopback <Eruantalon> without screwing anything up? <mbiebl> If you have NM, you are fine. <mbiebl> But this is getting mighty OT now. <Eruantalon> Well I don't know if I will be going back so I'll leave it be. Never know when I want to have network during again? <Eruantalon> mbiebl, Sorry, But I thought it was something upstart would be able to do simply- <Eruantalon> Thanks. That did the trick <mbiebl> Eruantalon: the main idea behind upstart is, that it is event based. <Eruantalon> yep <mbiebl> You still need sources, which generate these events. <mbiebl> NM could be such a source for network events. <Eruantalon> mbiebl, I just thought that upstart was the underlying thing that drove network manager <Eruantalon> Do you know then where I should go to file a bug about this problem then. I gather it is the startupscripts in ubuntu and not a bug in upstart itself <mbiebl> Well, upstart is mainly a event queue and dispatcher. <mbiebl> It has no knowledge about network and stuff. <mbiebl> That's what I meant, when I said these kind of events have to be feed into upstart from external sources. <Eruantalon> Hmm I gotta reboot to check something. It seems that network manager lost any information about my wireless card... <AlexExtreme> Keybuk, do you know if the ubuntu server guys are planning to have the whole of EBox packaged in gutsy? i tried out tribe3 the other day, and did an aptitude update/upgrade, but still only a few of the ebox modules are there <Keybuk> AlexExtreme: no idea, sorry <Keybuk> I would imagine so <AlexExtreme> ok, thanks <AlexExtreme> also, one more Q: do you plan to get native upstart jobs into gutsy? <Keybuk> no * Starting logfile irclogs/upstart.log #upstart 2007-08-10 * Starting logfile irclogs/upstart.log <pawalls> Hello. I'm trying to make sure something executes *before* ttys start getting spawned, but rcX.d priorities seem to be ignored. Any way to accomplish this w/ /etc/event.d instead? <pawalls> I should mention that I am attempting this on a Gutsy install. #upstart 2007-08-12 <ion_> My plate is buggy. http://heh.fi/tmp/buggy_plate * Starting logfile irclogs/upstart.log * Starting logfile irclogs/upstart.log <aleix> hi, i have a little question i don't seem to be able to find anywhere... if upstart replaces init how does the kernel know it has to execute upstart and when does this happen? <mbiebl> The kernel starts /sbin/init by default. <aleix> so upstart has a "program" also called init? <mbiebl> Right. <aleix> ok, that makes sense, thanks a lot! <mbiebl> You can change the default by passing init=/path/to/init to the kernel on boot. <mbiebl> So you can install upstart to /opt/upstart, if you don't want to overwrite your sysv init. <aleix> so i've read! i'll give it a try! thanks #upstart 2007-08-13 <newpers> what's the program that shows you your mouse buttons <newpers> it may be an xorg application <newpers> like if i click left button it prints 1 <newpers> wrong channel #upstart 2007-08-15 * Starting logfile irclogs/upstart.log <vlt> Hello. I just upgraded from Ubuntu Edgy (which was a fresh install with upstart) to Feisty using aptitude. Now the system only boots to runlevel "unknown". I always have to login and run `telinit 3` (sic!) to start all the daemons and the dm. `telinit 2` results in `runlevel` => "unknown", too. What is missing here? <vlt> I there a way to reconfigure upstart to the default behavior? <vlt> s/I /Is / * Starting logfile irclogs/upstart.log #upstart 2007-08-16 <eXosypher> hellu <eXosypher> anyone alive? <eXosypher> :( <vlt> Hello. I just upgraded from Ubuntu Edgy (which was a fresh install with upstart) to Feisty. Now the system only boots to runlevel "unknown". I always have to login and run `telinit 3` (sic!) to start all the daemons and the dm. `telinit 2` results in `runlevel` => "unknown", too. There's no /etc/inittab file and no "single" or similar argument in /proc/cmdline. What is wrong here? <ion_> Id suggest sending the question to the mailing list. <vlt> ion_: Ok, thank you. <docwhat> Hello! Is logd supposed to be running all the time? <docwhat> This is ubuntu.... <Keybuk> in edgy it does, in feisty it doesn't <docwhat> Ah. <docwhat> Where does it log output to? <docwhat> I'm sort of expecting behaviour like in supervise or runit..... <docwhat> I love the way the logging works there (ie, it uses stdout/stderr not magic logging functions). <Keybuk> /var/log/boot <Keybuk> logd captures stdout/stderr of running jobs <docwhat> Keybuk: Are you familiar with how supervise does it? <Keybuk> no <docwhat> It's similar.... There is a processes (one per daemon to be logged) that is kept always running (respawn). This process just adds a timestamp to each line and writes it to a file with buffering options you set. It's nice because your daemon doesn't need: sysklogd libraries, fancy logging routines, or behave differently depending on if you're testing it or running it production. <docwhat> logd with 'console logged' sounds similar. Except for the running one per daemon. <Keybuk> though it does mean you end up with lots and lots and lots of processes <Keybuk> consuming lots and lots of resources <docwhat> The other neat thing is that the daemon can segfault without loosing logging output. Equally, you can change the logging or role the log without restarting the daemon! <docwhat> The loging processes usually don't consume much resources. A logging process is cheap compared to a daemon. It just takes input and sends it to disk. <docwhat> You probably pay a small context switch cost vs. a single logging daemon (like sysklogd), but it is much much much simpler and easier to debug, configure and fix (and make secure!). <Keybuk> and much more difficult to restart when you do find a bug ;) <docwhat> Oh no, very easy. As I said, the logger and the daemon are separate. You can restart either/or without impacting the other. <Keybuk> yes, but you have to restart a couple of dozen logging daemons rather than just one <docwhat> Ah, I see what you mean. Sure. But the shell script for that would be: for i in /var/services/*/log; do sv restart $i ; done <docwhat> or something similar. <docwhat> actually, I think there is a command other than restart to do a cond-restart.... <docwhat> (ie, restart if up) <docwhat> *shrug* another alternative is just make the init.d for the daemon include the logger there, but I figured since upstart already had a runit/supervise feel to it that this would be a nice addition. <Keybuk> it's pretty much what we already do, no? <docwhat> Thanks for the chat, Keybuk! I have to go. Have a good day. :-) <docwhat> Yup. #upstart 2007-08-17 <vlt> Hello. How can I re-activate logging to /var/log/boot in Feisty? <AlexExtreme> you can't, logd is broken <AlexExtreme> see https://bugs.launchpad.net/upstart/+bug/98955 <vlt> hmmm <vlt> Any idea how to find out then why system boots to runlevel "unknown" only? <AlexExtreme> nope <vlt> AlexExtreme: And any idea how to fix it (maybe something like `dpkg-reconfigure -plow upstart`)? <AlexExtreme> sorry, i'm not really a debian/ubuntu expert (i don't use them, i just use upstart :)) <vlt> ok <kylem> /wkU/WIN 30 #upstart 2007-08-18 * Starting logfile irclogs/upstart.log <vlt> Md: OT: Should your quit message be right-to-left and does only my client (irssi) display it wrong? <Md> vlt: yes <ion_> Probably more like irssi not supporting RTL and the terminal not supporting combining characters. * vlt_kde waiting for Md leaving again ;-) #upstart 2007-08-20 * Starting logfile irclogs/upstart.log <mbiebl> Keybuk: it's been very quite around upstart lately. What's the current status? Are you just busy with other things? <vlt> Hello. Afer an upgrade from Edgy to Feisty the system only boots to runlevel "unknown". I have to run `telinit 3` (sic!) to run all the daemons listed in /etc/rc3.d/ -- `telinit 2` leads to "unknown", too. apt-get dist-upgrade returns "0 ..., 0 ..., 0 ..., 0 ..." so everything should be in a proper state. Any idea how to fix upstart? #upstart 2008-08-29 <keesj> Hi <keesj> I am hitting a old bug that the env are not taken into account on restart <keesj> I am searching for a bug report for that but can't seem to find it (/me need ammo to upgrade to 0.5) <keesj> where is Keybuk? <Md> BTW, a debian user too reported that $REMOVE_CMD is broken <Millox> is it possible to act on custom events sent by initctl emit in upstart 0.3.9 (the one included in hoary) <sadmac> Millox: yes <sadmac> Millox: no settup. Just initctl emit anystringyoucanthinkof <sadmac> and start on thatstring <Millox> well, i'm trying just that but somehow it doesnt work <Millox> in the configfile I have "start on blah" but "initctl emit blah" doesn't start the service <Millox> actually it sometimes say Unknown stanza <sadmac> Millox: pastebin your entire job definition <Millox> hmm, should I use several stop on .. or should I use stop on blah or bleh? <sadmac> depends <sadmac> in 0.3.9 several stop on will work <sadmac> in 0.5 it won't <Millox> okay <Millox> this is the start on and stop on definitions: <Millox> start on (quagga and firewall) or router-up <Millox> stop on router-down <Millox> stop on runlevel 0 <Millox> stop on runlevel 1 <Millox> stop on runlevel 6 <Millox> there is also a post-start script which enables routing and a post-stop which disables routing <Millox> start router and stop router works fine <Millox> sorry about the spamming <Millox> log says: <Millox> init: /etc/event.d/router: unable to read: Invalid argument <sadmac> dunno that 0.3.9 has an and operator <sadmac> or parens <sadmac> not too sure though :O <Millox> maybe it doesn't <Millox> I just removed them and now the invalid argument isn't seen anymore <Millox> however, it still doesn't work <sadmac> hm <Millox> okay, now i managed to get the bounce example working but I still havn't the foggiest why the other doesn't work <Millox> hmm <Millox> just tried adding a script stanza containg just /bin/true (and exec as well) but it still doen't work <sadmac> try doing it without any and or or operators or parens at all <Millox> tried with only one start on and one stop on but nothing <Millox> hmm <Millox> hsuccess! <Millox> unfortunately i managed to shut down my router in the process ;-) <Millox> apparently you can't have dash in signal names <Millox> changing only the signal names is the difference between invalid argument and succes <Millox> s <Millox> unfortunately the start process doesn't return <Millox> now <sadmac> hm <Millox> ah, service solved that <Millox> okay, now I'm confused <Millox> I've changed everything so much now that I dont know what I changed anymore <Millox> but now it works as it should <sadmac> heh <Millox> okay, another question: the way to emit a signal from a job description is executing /sbin/initctl emit, right or wrong? <sadmac> right <Millox> isn't the job supposed to not run if any of the pre,post-start,stop scripts return nonzero? <sadmac> pre-start maybe <sadmac> the rest of those I think it keeps going <Millox> seems like it yes <sadmac> post-start things are already running, so its too late <sadmac> post stop things are already stopped, so...now what? <sadmac> pre-stop, well you don't want to make it impossible to stop something ever really <Millox> no, that seems reasonable <Millox> I just hadn't thought about it really <Millox> and I suppose, it would be better to spell correctly so that the script doesn't return nonzero :-/ <Millox> hmm, I don't feel that the service jobs works correctly... <Millox> i had a problem just now with jobs not starting <Millox> i have a "bogus" job called network which is basically a placeholder for all network starting, and i had only an emitted signal in this job <Millox> firewall and quagga had start on starting network in their job description <Millox> when I had script or exec /sbin/initctl the network first started and then stopped immideately whereas if I used pre-start and no exec or script stanza the network started <Millox> may <Millox> maybe I've completely misunderstood the stanzas <Millox> how is the environment set up for scripts, for instance is pid available through a variable in post-start/pre-stop? #upstart 2008-08-30 <Millox> will later versions of upstart be able to handle several daemons to monitor for one service? <ion_> Well, i already supports instances. <ion_> it <Millox> yep, got that part <Millox> but what I currently need is a way to oversee several daemons at once, preferably with only one job definition file to keep clutter to a minimum <Millox> i.e. nfsd starts i believe 4 different daemons to handle authentication, mounting, locking and uid translation <Millox> it would have been nice to have just one job description file for these daemons since they logically is only one service <Millox> ah, well maybe later #upstart 2009-08-01 <oly> anyone around who can help me get a script running <oly> or point me at how to debug what is going wrong <oly> are there any log files etc, or anything like thta <oly> currently when i start my process i seem to get 4 processes for some reason <oly> currently looking like i am going to have to stick to using rc.d to launch apps as nothing i try in upstart seems to work <oly> and it never tells me why, <sadmac2> oly: /var/log/messages <oly> thanks for the tip sadmac2 <oly> when i set up a script and run sudo start script it shows 4 processes is that normal <oly> or is it actualy launching 4 instances of the process for some reason ? <oly> http://ubuntu.pastebin.com/m5edd07f2 <oly> if anyone can tell me if that is correct it shows no processes the script then the processes after its started <oly> as you can see there are 4 processes at the end instead of 1 <sadmac2> oly: the logs indicate upstart only spawned the first one <sadmac2> oly: it must be forking <oly> you mean the fact that the start test3 command only printed one pid <oly> just confusing because if i start it using /etc/init.d inadyn start <oly> it would only show a single process <oly> i was wondering if it was my lack of knowledge or something <oly> been trying allsorts for ages <oly> nothing appears in /var/log/messages by the way from starting that <sadmac2> hmm. not sure then. doesn't look like upstart is running more than oe <sadmac2> *one <sadmac2> maybe yoru init.d script passes more arguments <oly> well, if i start inadyn from the terminal it starts fine and shows only one process <oly> perhaps i will try and write some scripts for my own applications and see if i get the same behavior <Keybuk> wow <Keybuk> just confirmed an old mysterious 0.3 bug on 0.6 <sadmac2> Keybuk: details <Keybuk> assert() bug <Keybuk> you need two jobs to replicate it, so it shows up for people who've tried to do native boots <Keybuk> e.g. <Keybuk> foo: <Keybuk> exec foo <Keybuk> bar: <Keybuk> start on stopping foo <Keybuk> exec killall foo <Keybuk> then "stop foo" <Keybuk> Upstart will assert() <Keybuk> ie. if you stop a job, and another job that reacts to its "stopping" event *causes* the original job's process to exit <sadmac2> hmm <sadmac2> NetworkManager-vpnc's error messages are for shit. <sadmac2> "Failed." <sadmac2> "Reason: 6" <sadmac2> thanks a lot. <sadmac2> off-topic, but still infuriating <Keybuk> :-) <Keybuk> anyway, I've done a patch and will probably do a 0.6.3 early next week <sadmac2> sweet <Keybuk> *hints that you might want to upgrade from 0.3.x now :p* <sadmac2> Keybuk: we can't take the regression on that state-transfer thing, even as ugly as it is. Not having that pretty much kills the distro (Thanks Jakub!). <Keybuk> it was your patch ;) <Keybuk> this is why you should work to get all your patches upstream <Keybuk> and why hoarding patches by yourself and not working to get them upstream is bad <Keybuk> m'kay? :p <sadmac2> Keybuk: I thought upstream was dead as far as 0.3.* <Keybuk> it is <sadmac2> Keybuk: 0.3.10 was a shock to me <Keybuk> it's doubly dead now <Keybuk> as in I will now actively *not* fix critical bugs in it <sadmac2> what about LTS? <Keybuk> what about it? <sadmac2> you shipped 0.3 with it didn't you? <Keybuk> yes? <Keybuk> this doesn't affect the Support team's ability to provide telephone Support for it? <Keybuk> and the Security team will still provide Security fixes <Keybuk> we don't do what you guys do <Keybuk> once our releases are out, we largely *don't* backport non-security bug fixes to them <Keybuk> instead we suggest people update <sadmac2> oh god. the thought! <sadmac2> our customers expect us to time travel and make the bug not appear in the release they depolyed rather than upgrade a single package <Keybuk> :-) <Keybuk> yes, well <Keybuk> ;-) <sadmac2> life is long and hard <Keybuk> then you die <Keybuk> aka. life's too short to provide support for older releases <g> <sadmac2> Keybuk: you haven't seen the ongoing support plan for RHEL 2.1 <sadmac2> Keybuk: the cost grows exponentially. If 3 customers keep that thing for 2 years RH will purchase a country #upstart 2009-08-02 * Keybuk changed the topic of #upstart to: Upstart 0.6.3 "Our last, best hope for peace" | http://upstart.ubuntu.com/ <arekm> if jobs.d and conf.d were dropped then this means that upstart 0.6 is incompatible with 0.5, right? Is there some migration "guide"? <Keybuk> correct <Keybuk> from 0.5 -> 0.6 mostly just <Keybuk> - move your files into /etc/init <Keybuk> - give them a ".conf" extension <Keybuk> - drop "session leader" if you put it in your conf file (probably not) <Keybuk> 0.6 is a stable branch based off 0.5 basically <Keybuk> NEWS always contains notices of changes <Keybuk> (getting on plane now, back tomorrow) #upstart 2009-08-03 <sadmac> Keybuk: how was your flight? <Keybuk> sadmac: short and uneventful <Keybuk> just the way I like them ;) <sadmac> Keybuk: sweet <sadmac> Keybuk: so after hacking n-ary event operators together, I'm getting a segfault inside nih_ref <sadmac> Keybuk: specifically in a call to nih_list_add_after <Keybuk> is the pointer freed? <sadmac> Keybuk: I don't believe so. If so its an error outside my code. <sadmac> or maybe not... yeah it could be in the parse_job changes <Keybuk> one of the obvious issues with nih_alloc <Keybuk> x = nih_alloc (NULL, ...) <Keybuk> nih_ref (y, x) <Keybuk> nih_unref (y, x) <Keybuk> // x is now free <sadmac> Keybuk: it also bugs me that you have to declare nih_local in a certain place or you get a leak <sadmac> nih_local int *foo; while {} vs while {nih_local int *foo } <sadmac> Keybuk: I have a solution for that. I would propose a macro that would create a local /parent/ rather than a local object. So when you did locally scoped allocations, you'd just give them that parent and they'd all go cisneroselizabeth@example.net. <sadmac> its a bit harder to screw up, and its not mutually exclusive with nih_local so we can keep bot. <sadmac> *both <Keybuk> not sure I follow <sadmac> Keybuk: so where you had this: <sadmac> nih_local obj *foo = nih_alloc (null, sizeof obj); <sadmac> Keybuk: you'd have this <Keybuk> yes, you can do that ;) <sadmac> NIH_DECLARE_LOCAL_ANCHOR (anchor) <Keybuk> nih_local void *foo = nih_alloc (NULL, 0); <sadmac> obj *foo = nih_alloc (anchor, sizeof obj); <sadmac> Keybuk: nih_alloc doesn't assert there? <sadmac> Keybuk: because otherwise yes, that'd pretty much be it <sadmac> Keybuk: though I'd recommend the type be struct dummy * so it screams a bit if you try to use it as an object. <Keybuk> not that I know of <sadmac> Keybuk: well that works out nicely then <Keybuk> though I don't see that that helps you <sadmac> Keybuk: it makes it a bit harder to lose objects <sadmac> Keybuk: anything that has that as a parent at the end of the function /will/ get an unref <sadmac> Keybuk: regardless of whether its address is stored at a particular local pointer. <sadmac> Keybuk: it also offers a performance advantage <sadmac> NIH_DECLARE_LOCAL_ANCHOR (anchor) <sadmac> while (...) { /* use anchor for allocating */ } <sadmac> return; <sadmac> the stuff the loop created isn't freed til return. The loop now never passes through allocation code. The program gets faster. <sadmac> *never passes through free code <Keybuk> why is that different than the alternative? <Keybuk> the loop can instead consume large amounts of memory <sadmac> Keybuk: unlikely for most use patterns. Deferring garbage collection should be a big win in 99.9% of cases. The other way is still there. Furthermore, the old C maxim that variable declarations belong at the top of the function (and that's not a crazy assertion whether you agree or not) is no longer punished with a memory leak. <sadmac> Keybuk: and what's more, you no longer treat objects specially based on what variables they're held in. Less semantic confusion <Keybuk> but why can't you put them in the while loop? <sadmac> Keybuk: you can, its just gross. <Keybuk> sure <Keybuk> which is why I tend to attach them to something else outside it <sadmac> not following <Keybuk> well, I do what you do in those situations <Keybuk> have something at the top-level of the function and attach things to it <sadmac> makes sense <Milan-BV> Keybuk: hi! #upstart 2009-08-04 <Keybuk> random of the day * Keybuk wonders whether this works <Keybuk> int <Keybuk> foo (nih_local void *ptr) <Keybuk> { <Keybuk> nih_ref (ptr, NULL); <Keybuk> // use ptr safe in the knowledge that it won't get unreferenced <Keybuk> } <Keybuk> no <Keybuk> boo <Keybuk> I'm trying to come up with a clever way of doing something and failing :-( <wasabi_> Try harder. <Keybuk> lol <Keybuk> basically for the tests/test_*.c files, I want to have a function per test case <wasabi_> You can do it! <Keybuk> and want the list of test case functions auto-generated <Keybuk> but can't figure out a clean way to do it :-/ <wasabi_> Ahh. Got me. Since I use C# I'd just use reflection. ;) <Keybuk> lol #upstart 2009-08-07 <foolano> hi <foolano> hi <foolano> im using upstart in karmic <foolano> is there any reason why an event script is not showed with initctl list, but if i change its name it is listed? <sadmac2> foolano: so if you have a script with a particular name it won't show up? <foolano> sadmac2: it was really weird. I had this script and it didnt show up, i just copied with another name and it showed up <foolano> sadmac2: kill -HUP 1 fixed it though <foolano> but it was really strange <sadmac2> foolano: inotify glitch? <foolano> prolly <foolano> i was like wtf is wrong with that name :) <sadmac2> heh <foolano> sadmac2: anyway, im gonna repeat the same tests a few times cuz im testing new packages, so if it happens again, I'll let you guys know <foolano> i can even recordmydesktop to prove it :P <sadmac2> foolano: sweet <foolano> i was wondering if i should include the "kill -HUP 1" after copying the scripts <foolano> or it should *always* work without that? <swathanthran> just started reading about upstart. <swathanthran> does it have another command for update-rc.d? <sadmac2> swathanthran: not heard of that command <sadmac2> foolano: it should always work without HUP <swathanthran> thats the usual command to update sys-v init script.. like update-rc.d -f gdm remove disables gdm.. <swathanthran> sadmac2: ^ <swathanthran> upstart doesn't have an intersection to that area? <swathanthran> like, as i read upstart as a replacement to usual init scripts, i was checking about ways to configure that.. <swathanthran> ah i just see ubuntu having update-rc.d itself for updating init scripts.. and at the same time having upstart for init! <swathanthran> where am i wrong? <sadmac2> swathanthran: for the upstart jobs themselves there's no equivalent really right now. If upstart is acting as a layer over sysv, the sysv jobs should be manipulable by all the old mechanisms <sadmac2> swathanthran: yes, upstart has a set of jobs that basically act like sysv so you can use old-style sysv scripts. <swathanthran> oh thats cool..so its really an intersection;-) <swathanthran> ah what ever..;-) anyway thats cool.. #upstart 2009-08-08 <sadmac> wow, malloc_usable_size is reeeely undocumented #upstart 2009-08-09 <Stevee> hello, i'm looking for example jobs or a how to <Stevee> to shutdown or reboot the system with upstart <Stevee> without compatiblity mode ( no runlevels ) <Stevee> the only thing i found was the example job for ctrl-alt-del, shipped by upstart self <Stevee> but when i start this job, the system will not reboot or power off <Stevee> how can i do that ? <Guest34321> whats upstart equivalent of /etc/inittab? <Guest34321> i was trying to set autologin <Guest34321> nevermind.. got it.. #upstart 2009-08-10 <wasabi_> Heh. Nice. B5. <sadmac2> bingo? <wasabi_> Naw. The upstart 0.6.3 tagline. <sadmac2> ah yes * sadmac2 debates whether this is a bug: http://fpaste.org/xyZQ/ * sadmac2 debates whether at 2am he really saw that... <Stevee> good evening, i've problems with upstart and the shutdown/reboot of the system ( without compatiblity mode ) <sadmac2> Stevee: going to tell us about it or just dropping in to let us know? :P <Stevee> okay, my problem is i try to start the job shutdown <Stevee> but no services will be stopped <Stevee> at the end of the script <Stevee> i add the following: <Stevee> post-stop script <Stevee> halt -p <Stevee> end script <Stevee> the system halts correctly <Stevee> but no services / running jobs will be stopped <sadmac2> Stevee: what makes you think they would? <Stevee> here you can see the script <Stevee> v <Stevee> v <Stevee> http://nopaste.com/p/aUGp6c1ngb <Stevee> and the jobs stop on shutdown <sadmac2> Stevee: emits just says "this job may emit this event, so beware of race conditions." It doesn't actually cause the job to emit the event <sadmac2> Stevee: add a task stanza and an "exec initctl emit shutdown" <sadmac2> "exec initctl emit --no-wait shutdown" <Stevee> oh, okay <Stevee> so i didn't understand the emits command correctly <Stevee> thanks a lot <sadmac2> np <Stevee> now it woks, the jobs get killed on shutdown <Stevee> one more question <Stevee> the shutdown binary shipped by upstart <Stevee> can i also use that for shutdown <Stevee> ? <Stevee> or do i have to "start shutdown" on the shell ? <sadmac2> it won't run your shutdown job. <sadmac2> afaik <sadmac2> it does the sysv-compatible runlevel transition <Stevee> oh, okay <Stevee> the reboot biniary is the same for reboot or <Stevee> so i also need it ? <Stevee> don't need it #upstart 2009-08-11 <btm> so after upgrading from jaunty to karmic, upstart is imploding a bit with "init: rc-sysinit main process (862) terminated with status 134". /etc/init has only four files, while apt seems to believe there should be more. if there's something I should poke at or preserve specifically that would help diagnose what happened here please let me know. <btm> starting up in recovery mode: "init: rc-sysinit main process (863) killed by TERM signal" <btm> rc-sysinit.conf:58 sets DEFAULT_RUNLEVEL to true if inittab lacks an initdefault line which I assume breaks the telinit call at the end of the script. commenting out the 'check for default runlevel in /etc/inittab' section fixes my bootup. <sadmac2> btm: there was a fix for something in that area in recent trunk <plautrba> http://bazaar.launchpad.net/%7Escott/upstart/0.6/revision/1206/conf/rc-sysinit.conf this? <sadmac2> yeah. I'm kind of splitting my attention right now but that's the first bell that rang <btm> sadmac2: word. Bug #405847 too. Don't know why I missed that one last night. <btm> (in ubuntu) #upstart 2009-08-12 <Keybuk> http://bazaar.launchpad.net/~upstart-devel/upstart/trunk-translations/revision/1212 <Keybuk> that's kinda cute ;) <plautrba> nih_config_token doesn't accept token with any expansion <plautrba> is there another function or this should be fixed? <plautrba> ehm back <plautrba> nih_config_next_arg is that function which calls nih_config_token with NIH_CONFIG_CNLWS delimiters <plautrba> idea is in parse_job.c - stanza_utmp() get utmp arg with nih_config_next_arg() and then expand it with environ_expand() <soren> 7win 21 <soren> Doh. <Keybuk> plautrba: not sure what you mean? <plautrba> Keybuk: I call nih_config_next_arg() on positition where is "${TTY#tty}\n" <plautrba> and it returns "${TTY" <plautrba> because there is '#' in delimiters <Keybuk> really, even though it's in quotes? <plautrba> quotes are mine, just that is string <Keybuk> oh, right <Keybuk> that sounds likely <Keybuk> nih_config_token() would probably need to be extended to ignore # inside { .. } <plautrba> so I think nih_config_token() should also take care about ${ .. } <plautrba> yes <plautrba> not just ignore # but work with everything in ${ } in same way as it would be quoted or so <Keybuk> could probably argue inside [ ... ] and ( ... ) too <Keybuk> dunno whether you'd treat ${ specially <plautrba> utmp ${TTY#tty} <Keybuk> I mean compared to just { ... } <Keybuk> author <foo@#bar.com> <Keybuk> should that # be a comment? :) <plautrba> i see <plautrba> but that would be simply quoted <Keybuk> one could argue that the utmp example should be quoted <plautrba> or maybe escaped - ${TTY\#tty} <Keybuk> right, either of those works <Keybuk> that's kinda ugly though <Keybuk> the reason obviously is that $... and ${...} aren't part of the config grammar <Keybuk> they're expansions selectively applied to certain arguments <Keybuk> well after config parsing <sadmac2> Keybuk: responded to your comments <Keybuk> sadmac2: great, will take a look in a second <Keybuk> sadmac2: could you forward them to the LP review system if you haven't already? <Keybuk> cisneroselizabeth@example.net <sadmac2> Keybuk: ok.. <sadmac2> Keybuk: I should have a patch for most of the stuff tonight. <Keybuk> thanks #upstart 2009-08-13 <mneptok> does Upstart now privide for running jobs as a user other than root without su execs? <mneptok> *provide #upstart 2009-08-14 <sadmac2> Keybuk: do you know if Marcel's presentation/thoughts/anything on AF_DBUS are online? #upstart 2009-08-17 <kindjal> I have upstart 0.6.2 successfully starting up and running rc.sysinit, but for some reason, tty1.conf won't start mingetty on runlevel 3. mingetty on tty1 only works if I "start on startup". <kindjal> Is this to be expected? <kindjal> maybe something about rc-sysinit.conf having "console owner"? <sadmac2> kindjal: could be that <kindjal> Is there a known "standard" tty1.conf job file? <sadmac2> kindjal: I thought 0.6 shipped with examples for one <kindjal> nope <kindjal> ./conf dir has a few .conf files... <kindjal> none for gettys <sadmac2> kindjal: look at what ubuntu has then <kindjal> Alright <kindjal> does it matter that they have upstart 0.3.9 vs. 0.6.2 <kindjal> I have an ubuntu 9.04 box... <sadmac2> kindjal: it does, but they should be in a hurry to get 0.6. Check their upstream on launchpad. <kindjal> yeah I found them <kindjal> thanks for the tip <sadmac2> np <sadmac2> Keybuk: around? #upstart 2009-08-18 <sadmac2> ion: you wouldn't happen to know where Keybuk is, would you? seems he vanished. <sadmac2> Karmic has a freeze in 9 days... <ion> Iâm afraid i have no idea. <sadmac2> well damn. #upstart 2009-08-20 <keesj> Hi <keesj> I am trying to cross compile upstart, for that I would need the nih-dbus-tools to be compiled for the host target and not the target target. did anybody corss compile 0.6.3? <Hatrix> Keybuk: hello keybuk, i was reading some time ago an email from yours where you explain that actually in septembre upstart will be in a state to act as a supervise daemon, is this right on track? As I have to make some decisions regarding a client and what I am going to use to daemon supervising, as I really HATE the djb supervise tool thingy i would LOVE to use upstart <ion> Upstart can already do that for simple cases. <ion> It always has. It just hasnât been ready for booting the entire system as Upstart jobs. <Hatrix> i can not use it for daemons which forks into the background ... ? <ion> 0.6 has somewhat working support for it, although 0.10 will do it much better. <Hatrix> hmmm, how do i use it for this forking daemons? i could not get it to work as as soon as the daemon forked, upstart did not now anything about it (state, pid, ...) <plautrba_> Hatrix: you can use expect stanza with daemon or fork, then proccess should be traced for forks by ptrace() <Hatrix> hmmmm <Hatrix> i did not know about the expect stanza, where is the docu for the current stanzas anyway, anyone knows? (besides of the source ...) <Keybuk> Hatrix: man 5 upstart <Hatrix> ray@dev-01:~$ man 5 upstart <Hatrix> No manual entry for upstart in section 5 <Hatrix> hmm, seams in my debian upstart 06.2.1-1 package are no manpages ... hmmm <Hatrix> nope, section 5 missing ... ok, i'l grab the source, thanks <Keybuk> err, man 5 init sorry <ion> Which reminds me, i should finish my Upstart manpage changes and post a patch. <sadmac2> Keybuk: you're alive! er.. hi. <Hatrix> got it now ... so expect daemon is if it's running from an init-script, and therefore forks twice and expect fork is a direct call to the daemon, am i right? <Hatrix> and, fearing being kicked of the channel, but, when will the 0.10 be useable, any ideas? <ion> keybuk: Would you mind reformatting all the manpages with your editor (ctrl-meta-z-7-skull-and-crossbones-Ã¥-5 or whatever) and committing that change, so i can emulate the proper formatting in my changes? <sadmac2> ion: nobody spells it out like that. C-M-z-7-â -Ã¥-5 <ion> Ah <ion> Forgive my lack of emacs-fu <sadmac2> ion: in vim its just :piratedance <ion> One can come up with somewhat obscure things with vim, too. :-P 2006-06-02 17:16:13 < _ion> Vip:norm W"xyE$T_D"xp;gU$ <ion> Looking at the IRC log, i typed the line " normal = Gtk33ec:265c:71fe:e26d:2682:4ec2:aaa1:99abSTATE_NORMAL", duplicated it a few times, replacing normal with active, insensitive, prelight etc. and then wrote that command to replace the Gtk33ec:265c:71fe:e26d:2682:4ec2:aaa1:99abSTATE_* entries with the respective equivalents. <sadmac2> ion: I can't make it work <sadmac2> where did you start? <ion> Vip should âpaintâ the whole block first, then :norm should do the list of normal-mode commands for each selected line. <sadmac2> ion: that can't be right... maybe I need to be in C++ mode or it doesn't work. <ion> V should start selecting lines, and ip should select the current âparagraphâ. <sadmac2> yep <ion> Then :norm applies to that selection <sadmac2> yep <sadmac2> and the results are borked <ion> Did you have the indentation? Without it, you need to drop the W <sadmac2> ah. <sadmac2> ion: this is what macros are for btw. <sadmac2> probably would have just typed out the inital words and then started with '<,'>s/.*/\0 = Gtk33ec:265c:71fe:e26d:2682:4ec2:aaa1:99abSTATE_\0/ <ion> Not much difference between :norm and macros. The difference only starts to show when the changes are so complex you need to see them happening while typing the commands. <sadmac2> then gone about uppercasing <sadmac2> ion: for your method I probably would have had a macro to do it to one line then done :norm @q <ion> In fact, you could have uppercased them within the expression. :s/.*/\0 = Gtk33ec:265c:71fe:e26d:2682:4ec2:aaa1:99abSTATE_\U\0/ <sadmac2> oh that's right. <ion> But that would have missed the <ion> somethinglong = blah <ion> short = blah <ion> formatting :-P <sadmac2> not big on that anyway. I end up spending more time on whitespace than code. <sadmac2> ls <sadmac2> ...well its been awhile since that's happened <ion> rm -fr ~ <sadmac2> ion: ...you seem to be confused as to how this works <wasabi> byxnet.net <wasabi> Oops #upstart 2009-08-22 <Stevee> hello, iÂ´ve some problems with upstart and shutdown the system <Stevee> iÂ´ve written some jobs for that, but I think there is something missing <Stevee> the shutdown itself takes just some seconds <Stevee> and the system powerd off <Stevee> iÂ´m using upstart 0.6.3 without compatiblity mode <Stevee> hello, iÂ´ve a question about upstart and the variables <Stevee> especially UPSTART_JOB and UPSTART_EVENTS #upstart 2009-08-23 <Stevee> hello, iÂ´ve a question on upstart and the variables UPSTART_JOB and UPSTART_EVENTS <Stevee> is it possible to check with job or events started an other job <Stevee> and to put this information into an if function ? <Stevee> i need that at the end of the shutdown job <Stevee> so reboot or to shutdown the system <Stevee> hello, anybody here at the moment ? #upstart 2009-08-24 <Keybuk> sadmac: I'm here now ;-) <Keybuk> I didn't vanish, I had a holiday <Keybuk> and tried to mostly keep away from the computer <g> <Keybuk> ion: I didn't really make any attempt to format the manpages in any way consistently ;) <sadmac2> Keybuk: ah. good to have you back. Most of what I had to say is on the mailing list. Other than that, how do we feel about a release at LPC? I don't see much of 0.10 coming together <Keybuk> sadmac2: yeah I'm a bit behind :-) <Keybuk> 0.6 has worked too well <Keybuk> which isn't a bad thing, of course <sadmac2> yes. When gears aren't flying out the urgency goes out of fixing it <Keybuk> it's more that part of the "rush" for 0.10 was that 0.5 couldn't supervise daemon processes <Keybuk> and that is really essential for going native <Keybuk> but that got fixed for 0.6, so you *can* already do a native boot with 0.6 <sadmac2> I'm in the middle of what is turning out to be a marathon rewrite (see the "triggers" thing on the mailing list) <Keybuk> I'm way behind on e-mail, but will read with huge interest :-) <sadmac2> sweet #upstart 2009-08-25 <sadmac2> Keybuk: how do you feel about Dracut? Is Ubuntu interested? <Keybuk> yes <sadmac2> Keybuk: ah cool. I haven't done much with it yet myself. Fedora's test day for that feature is Thursday <Stevee> good evening <Stevee> iÂ´ve some problems with upstart and shutting down the system <sadmac2> Stevee: go ahead <Stevee> good evening <Stevee> yes <Stevee> iÂ´m using the current version 0.6.3 <Stevee> without compatiblity mode <Stevee> on reboot iÂ´m using reboot with the flag -f <Stevee> and it works correctly <Stevee> but halt with -f doesnt work <Stevee> if i try other flags like -n for now <Stevee> the services are stopping <Stevee> by the shutdown event <Stevee> but the system doesnt power off <Stevee> here is my shutdown script <Stevee> http://git.ipfire.org/?p=ipfire-3.x.git;a=blob;f=src/initscripts/core/shutdown.conf;h=63d04acbb0a1a74b40c79f4c76a02e939b88447c;hb=master <sadmac2> Stevee: your start on stanzas are wrong for one. you can only have one start on stanza now <sadmac2> Stevee: start on shutdown or reboot <Stevee> oh <Stevee> okay, but the system reboot correctly <sadmac2> Stevee: if you have two start on stanzas only the second one works <Stevee> oh okay <Stevee> okay, here is the link to the new file <Stevee> http://git.ipfire.org/?p=ipfire-3.x.git;a=blob;f=src/initscripts/core/shutdown.conf;h=394b2274636e58ed9bef1b58150b87a2b0ad3079;hb=1237e47913328b79e5908d0d2c77f855c054ac04 <sadmac2> that looks like it should work <Stevee> do i need the poweroff binary <Stevee> ? <Stevee> and the shutdown binary ? <sadmac2> I don't believe so <Stevee> atm they are deleted, because shutdown is for the compatiblity mode <ion> keybuk: Btw, anything new with the mount daemon? <Stevee> okay, now it wokrs <Stevee> iÂ´ve got a message System halted. <Stevee> thanks for the help sadmac2 <sadmac2> np <ion> http://www.microsoft.com/businessproductivity/default.mspx http://www.microsoft.com/poland/businessproductivity/default.mspx <Stevee> is upstart also going to replace cron ( frcon ) <sadmac2> Stevee: it probably will grow cron or cron-like functionality. <Stevee> when is this feature planned ? <Stevee> or is it already implemented ? <sadmac2> Stevee: its kind of in the air <sadmac2> Stevee: maybe Keybuk knows <Stevee> is there a chance for this feature or is it only some kinde in the air ? <_|ms|_> good evening <ion> https://fedoraproject.org/wiki/Initrdrewrite#Initial_ideas seems against the idea of making initrd as tiny as possible for speed. <ion> ...regarding Dracut <sadmac2> ion: what parts? <ion> âInclude all driversâ mainly <sadmac2> ion: well.. dumb question <sadmac2> ion: if you couple it with the "just build everything in" philosophy it could work out. <sadmac2> I haven't pulled it apart yet. I dunno what to expect. <_|ms|_> dracut seems to be a nice idea... but some kind of hard to build in :( <Stevee> sadmac2: do you know if there is a real change to replace cron with upstart or is it just a nice idea ? <sadmac2> Stevee: I'm betting it will happen. When and what it will look like... Scott has the only roadmap in his head (his FOSDEM talk might have some strong hints though). <Stevee> oh, thats fine <Stevee> hopefully it will be soon <_|ms|_> is there a link to the talk? <_|ms|_> may be a video link?! <sadmac2> _|ms|_: yes... <sadmac2> ftp.heanet.ie/mirrors/fosdem-video/2009/maintracks/upstart.xvid.avi <sadmac2> whew that was hard to find <_|ms|_> thanks :D <_|ms|_> I have missed some info about the fosdem talks... <_|ms|_> guys, I have to leave now... see you soon... gn8 <Stevee> guys, iÂ´ve to go now, see you soon, thanks again for your help sadmac2 <Stevee> good night #upstart 2009-08-26 <Stevee> good evening <keesj> hi <Stevee> iÂ´ve a problem with upstart und shutdown the system <Stevee> i emit the shutdown event <Stevee> the job stats and some jobs stops <Stevee> but then the the system halts and not all services are stopped clearly <Stevee> is there way to check if all services are stopped bevore upstart power of the system ? <Stevee> keesj: do you have any idea for this problem ? <sadmac2> Stevee: 1) are you sure there's reason to do that? For a lot of services its just a waste of time. 2) what do your job definitions look like now? <Stevee> my job file looks like that <Stevee> http://git.ipfire.org/?p=ipfire-3.x.git;a=blob;f=src/initscripts/core/shutdown.conf;h=394b2274636e58ed9bef1b58150b87a2b0ad3079;hb=1237e47913328b79e5908d0d2c77f855c054ac04 <Stevee> if i remove the whole script <Stevee> i got messages from als services that they have stopped on the console <Stevee> if i start the job with the script section <Stevee> i only get a message of 2 or 3 jobs <Stevee> after that, the system powered off <Stevee> and all other jobs arenÂ´t killed clearly <sadmac2> Stevee: yes, that's going to halt the system as soon as it gets shutdown, with no regard to what else is going on <sadmac2> Stevee: do your other services have "stop on shutdown" and that is how they shut down? <Stevee> yes, they have stop on shutdown or reboot <sadmac2> Stevee: yes. this won't work :) <Stevee> mhm okay, why ? <sadmac2> Stevee: make them stop on some other event (stop-all say) and then add an emits stop-all stanza to your shutdown job, and in the script do initctl emit stop-all <Stevee> and why i canÂ´t use stop on shutdown or reboot ? <sadmac2> Stevee: everything that happens on shutdown or reboot will happen at the same time. <Stevee> so if emits a stop-all, all services will be stopped <Stevee> and than, the system will halt ? <Stevee> or reboot ? <sadmac2> yes. <keesj> Stevee do you always have the same behaviour or not? <Stevee> yes <Stevee> allways the same <keesj> and do all your job directly depend or stop on "starting" shutdown? <keesj> (what version btw?) <Stevee> no only on stop on shutdown or reboot <Stevee> version is 0.6.3 <Stevee> also the current one <keesj> on thing that can happen is that one script fails and this makes the rest fail <Stevee> but without compatiblity ( no runlevels ) <keesj> Stevee: also I think you need stop on starting <keesj> the ohter problem I see is that your even is names after the job name <keesj> so shoulden't it be "stop on starting shutdow" so first everything is started before the schutdown script is executed <sadmac2> Stevee: he's right. Stop on starting shutdown will let you avoid having to do the emits/initctl emit <keesj> (I have not played much with 0.6.3 yet) <Stevee> stop on starting shutdown or reboot, is that correct <Stevee> or do i need <Stevee> stop on starting shutdown <Stevee> stop on starting reboot <Stevee> i two lines ? <keesj> you are no longer allowed to have two lines any more <Stevee> okay <keesj> stop on starting shutdown or starting reboot(I would guess) <Stevee> okay, and do i have to change the job name to something other than shutdown like "anything" <Stevee> ? <Stevee> do you know a distribution that uses upstart fully event based ? <sadmac2> Stevee: you don't /have/ to rename the job, but its probably better practice to not have jobs and events with the same name <Stevee> okay so if i name the event halt and the job shutdown, i add to all other jobfiles stop on starting halt or starting reboot <Stevee> everything should work fine ? <sadmac2> you'll want stop on starting shutdown <sadmac2> starting <jobname> <Stevee> oh, the jobname, okay <sadmac2> the other jobs will then stop whenever something tries to start your shutdown job, and they will block that shutdown
{'channel': 'upstart', 'month': 8}