/srv/irclogs.ubuntu.com/2009/09/14/#upstart.txt

=== h\h is now known as haraldh
KeybukI discovered a really nice Upstart feature over the weekend13:43
Keybukit wasn't one I designed, but it's a wonderful emergent feature13:43
ion:-)13:44
ionThe mountall patches should be in a working condition now, btw. The bug i noticed the last time you were around was the last one i’ve been able to find so far.13:45
ionPlease describe the feature. :-)13:46
Keybukbecause of the blocking behaviour of event operators13:49
Keybukyou can use events as checkpoints13:49
Keybukfor example13:49
Keybukstarting a GNOME session13:49
Keybukplace "initctl emit gnome-session-start" in the /etc/gdm/PreSession/Default script13:50
Keybukyou now have an event for gdm starting a gnome session13:50
Keybukall well and good13:50
Keybukbut let's say you want to defer some boot operation until the gnome session has started13:50
Keybuk  start on gnome-session-start13:50
Keybukpretty obvious really13:51
Keybukbut now let's say you not only want to defer the boot operation, but you don't want the gnome-session to start unless it's been done13:51
Keybukturns out to be the exact same command ;)13:51
ionNeat :-)13:51
Keybukwhat about something which could happen earlier, but must happen before session start ?13:51
Keybuk  start on filesystem or (filesystem and gnome-session-start)13:52
Keybukif g-s-s happens before filesystem, g-s-s will *block*13:52
Keybukas soon as filesystem happens, either way, the start condition becomes true13:52
Keybukif filesystem beats g-s-s, g-s-s never blocks13:52
* Keybuk likes this13:53
Keybukneed to reboot, brb13:55
Keybukoh, and I forgot13:57
Keybuksay you need gnome-session-start to block if a service is still running:13:57
Keybukjust put a job file with nothing else in it except13:57
Keybuk  start on stopped mountall and gnome-session-start13:57
Keybuk  task13:57
Keybuknow gdm will wait for mountall to complete before starting the login session13:58
ionNice13:59
Keybukion: am still trying to think of how to handle remote mounts in mountall14:11
Keybukalmost tempted to say that mountall should simply exit when all it has left are remote mounts14:11
Keybukand re-run mountall on ifup14:11
Keybuke.g. mountall --network or something14:11
Keybukif mountall is already running, that could prod it14:12
ionHow is that different than leaving it running and using USR1? I mean, of course it’s *different*, but what does that achieve better?14:14
Keybukno different, was just wondering about whether or not it was a good idea14:17
ionIt seems to me it would be simpler to leave it running and trigger (re)mounts from an external message, be it signal or something else.14:19
ionIf mountall --network has to prod a previous instance if one exists, you have to implement that *anyway*. Might as well only use it that way.14:20
Keybukyeah14:28
Keybukjust thinking about the fact that you may end up with mountall always running14:28
Keybukbecause you have some insignificant network mount that never mounts14:28
Keybukbut I guess that's ok too14:28
ionThat’s not too bad IMO.14:30
ionIf you want to get rid of the mountall process, simply get rid of the fstab entry that never mounts. :-)14:30
KeybukI think that remote mounts are going to have to be allowed to fail14:56
Keybuksince it may need a different network interface14:56
ionIndeed14:57
Keybukwhich means if you have /usr on NFS, and it fails to mount, you'll have a hung boot14:57
ionUntil the correct interface comes up and mountall retries?14:57
Keybukwell, it could be that, for example, the remote machine isn't up14:57
KeybukI think this is solveable though with the progress functionalith14:58
Keybuke.g. usplash comes up because we're still waiting14:58
ionYeah14:58
Keybukand we put a message there saying what FHS-critical filesystems we're still waiting for14:58
ionWould something like this look okay? (No test cases or anything else yet.) http://heh.fi/patches/libnih-abort-msg15:01
sadmac2Keybuk: I thought you ditched usplash in favor of $fooshiny15:01
ion(http://launchpadlibrarian.net/31650305/glib2.0_2.21.6-0ubuntu1_2.21.6-0ubuntu2.diff.gz)15:04
Keybuksadmac2: no15:05
sadmac2Keybuk: hmm. where'd I read that then...15:06
Keybukion: ooh, you patched that <g>15:06
Keybukion: what's the abort_msg_parent thing for?15:07
Keybukion: isn't it possible to do this in nih_assert() itself?15:07
ionI could drop the parent, and e.g. nih_strdup the message and put that to __abort_msg. Whichever’s better.15:08
Keybukdunno15:09
ionnih_assert is just a macro that does nih_log_message and abort. It leaves the printf processing to nih_log_message, so i pretty much have to set __abort_msg in nih_log_message, unless the whole thing is modified a lot.15:09
Keybukyeah, I guess it does tend to offload everything to nih_log_message15:10
ionI could move the parent inside nih_log_message, of course. http://heh.fi/patches/libnih-abort-msg15:11
sadmac2ion: the first conditional in that parent looks unnecessary15:11
sadmac2s/parent/patch15:11
sadmac2ion: you assign the variable to NULL and then check for NULL15:12
Keybukion: why does it need a parent at all?15:12
ionOk, using strdup now. http://heh.fi/patches/libnih-abort-msg15:13
ionWhoops, forgot the parent parameter to nih_strdup.15:14
KeybukI guess one easier thing to do would be to add another log level15:16
KeybukNIH_LOG_ASSERT15:16
Keybukabove NIH_LOG_FATAL15:16
Keybukand call abort() inside nih_log_message, after setting __abort_msg ?15:16
Keybukmaybe that's too convoluted to save a strdup though ;)15:16
ion:-)15:17
Keybukbut could you open a bug with that patch on libnih for me?15:17
* sadmac2 reminds himself to add backtracing to libnih15:17
ionWill do15:18
Keybuksadmac2: the confusion is exactly what xsplash is15:19
Keybukxsplash is basically just a splash screen that sits between X loading, the gdm login screen and the user's desktop15:20
KeybukX-gdm login because gdm takes seconds to start its login screen15:20
Keybukgdm login-user's desktop because GNOME is shit15:20
Keybuk(X-user's desktop in the case of auto-login)15:20
Keybukwe're also starting X very early comparatively, so it's worthwhile having the longer splash screen15:20
Keybukin fact, I'm using those event tricks I was talking about here15:21
Keybukso xsplash appears, then there's an Upstart event15:21
Keybukthat Upstart event is used to "finish up" things that we need started before GDM or the user's desktop15:21
Keybukwithout them needing to delay X15:21
sadmac2Keybuk: we just have fades between those points15:23
Keybukfades between what and what though? :)15:24
sadmac2Keybuk: also your checkpointing thing scares me :(15:24
Keybukyou have plymouth from initramfs to X15:24
Keybukfade into some kind of splash screen15:24
Keybukfade into gdm15:24
Keybukfade into some other kind of splash screen15:24
Keybukfade into user's desktop15:25
Keybuk?15:25
sadmac2plymouth onscreen, fade to gdm, fade to users desktop15:25
Keybukso what's on screen after you've logged into gdm?15:25
ionhttps://bugs.edge.launchpad.net/libnih/+bug/42941115:25
sadmac2Keybuk: gdm15:26
Keybukyou press enter at the password prompt, what stays on screen until the user's desktop?15:26
sadmac2Keybuk: it stays visible15:26
sadmac2Keybuk: I think gdm goes to a waiting-to-log-you-in thing before quitting, so it should be that15:26
* sadmac2 would know if he rebooted more often15:26
Keybukright15:26
Keybukthat stuff isn't upstream15:26
Keybuklikewise, you've never contributed the X patches upstream that allow plymouth to stay on screen while gdm starts ;)15:27
sadmac2Keybuk: ...should be...15:27
ionsadmac: Btw, the code was { static foo *bar = NULL; if (! bar) bar = baz (); }. Thus bar is kept between function calls and only initialized once.15:27
* soren notes that there's no ubottu or anything in here.. Is that intentional?15:27
sadmac2Keybuk: wat?15:27
Keybuk(though iirc, plymouth looks completely frozen while gdm starts because obviously it can't animated once X takes over the framebuffer)15:27
sadmac2Keybuk: plymouth always stops in a state where that makes snese15:27
Keybuksoren: this isn't an Ubuntu channel15:27
sorenKeybuk: Indeed. Nevertheless, the lp bug resolution magic is really convenient :)15:28
sadmac2Keybuk: our X server should be totally upstream...15:28
sadmac2Keybuk: granted it may be 12 revisions ahead of the released branch....]15:29
Keybuksadmac2: it isn't15:29
Keybukyou have about 200 patches which aren't upstream15:29
sadmac2Keybuk: you should beat on airlied at LPC then :)15:31
sadmac2ajax is probably more appropriate, but beating on him is a health hazard15:31
Keybukit doesn't overly bother me :)15:32
KeybukI like knowing projects that Fedora has special patches for15:32
Keybukso every time spatula starts on his "we contribute everything upstream" rant, I start sending him URLs15:32
KeybukI know that the *reality* of developing a distro is that you have patches to glue things together that aren't really ready for sending upstream15:32
Keybukor make assumptions that upstream won't accept15:32
Keybukhell, even when you're upstream yourself, you know that the patch is ok for your distro because it assumes something but not ok for upstream15:33
sadmac2Keybuk: I don't know of any Fedora devs that aren't moreso upstream Xfolk, so yeah...15:34
sadmac2*Fedora X devs15:35
ionIt *would* be kind of nice to use plymouth instead of usplash for the pre-X fsck messages, so there would be no need to maintain usplash. But i guess that has been considered and discarded.15:37
Keybukno15:37
Keybukif someone wanted to do the work to get Plymouth working in Ubuntu15:38
Keybukthen sure ;)15:38
Keybukthe reason we've stuck with usplash is that it works, and the cost of sticking is zero15:38
sadmac2Keybuk: I'm sure rstrode would be supportive.15:38
Keybukwhereas we don't know that Plymouth works, and it needs new themes written, and needs integrating (all those usplash_writes need replacing, etc.), so the cost of changing is high15:38
KeybukI can't imagine that we'll forever stick with and maintain usplash15:39
ionIt works FSVO works. It never has been able to use the correct resolution on any of my computers; the logo has always had wrong proportions. ;-)15:39
sadmac2Keybuk: don't forget the initrd hook15:39
Keybukbut right now, we don't have anybody who can do plymouth15:39
Keybukion: right, we briefly tested it and it didn't get something right like that on one machine15:39
Keybukon another it didn't display graphics at all, just a text bar at the bottom15:39
Keybukand on the third, it fell back to 16 colours or something15:40
Keybukso of the three test machines, it failed on all three15:40
sadmac2Keybuk: the text bar thing will be an ongoing thing. plymouth uses KMS. KMS doesn't work everywhere.15:40
ionI mean, usplash fails to use the correct resolution here.15:40
Keybuksadmac2: I've been *assured* that Plymouth works on non-KMS graphics cards15:40
Keybuk(graphically)15:40
KeybukI think this is a lie15:40
sadmac2Keybuk: who assured you this?15:40
sadmac2Keybuk: it is a lie.15:41
sadmac2Keybuk: graphics are KMS-only15:41
Keybuksadmac2: various people on http://www.netsplit.com/2009/09/02/making-a-splash/ comments15:41
Keybuk(may have to click "Older comments")15:41
Keybukneo says:15:41
KeybukSeptember 2, 2009 at 12:18 pm  (Edit)15:41
KeybukI am sorry but Usplash and Plymouth are very different. Plymouth can work on the non KMS case using frame-buffer.15:41
Keybukec.15:41
sadmac2Keybuk: well if it can, it can't do it in F1115:42
KeybukI think that this person doesn't know what he's talking about15:42
Keybukthe whole point of KMS is that it provides a framebuffer15:43
sadmac2Keybuk: beware the words of people named for Matrix characters15:43
Keybukin the non-KMS case, you *do not have a framebuffer*15:43
Keybuk(unless you use vesafb of course, in which case, hello sixteen colours glory)15:43
sadmac2Keybuk: fuck yeeeeeah!15:43
sadmac2Keybuk: regardless of where ubuntu goes you should really sit down with rstrode and talk about the whole splash thing. He's the only one I'd trust on Plymouth15:44
Keybukthere's no point me sitting down with him this year15:48
KeybukI won't have any time until at least June ;)15:48
Keybukprobably not until 2011 in practice15:48
Keybuksadmac2: why does the checkpointing thing scare you?17:31
=== robbiew1 is now known as robbiew
sadmac2Keybuk: its making use of the internal state held by and, which is scary because there's no way to really observe it from userspace. Its using the syntax in a way that makes no sense given what the stanzas mean... its hackish.19:08
Keybukthe syntax makes it odd19:09
Keybukbut I don't think it's hackish19:09
Keybukit's doing exactly what this stuff was *designed* to do19:09
Keybukallow you, through their blocking behaviour, to use simple events to produce complex dependency and ordering behaviours19:09
sadmac2Keybuk: I was actually disappointed when I noticed triggers /didn't/ remove this behavior. Guess I'm glad now.19:09
Keybukit's an emergent behaviour of the "before" stanza19:11
Keybukie.19:11
Keybuk  before foo and before bar19:11
Keybukimplies that foo and bar will both be delayed until *after* your service is run19:11
Keybukeven if before they were not19:11
sadmac2Keybuk: I got to the point yesterday where I had to replace event operator related stuff in parse_job, which got me thinking about replacing parse_job/nih_parse again19:14
Keybukany particular reason?19:15
sadmac2I need to look at other L1 parsers. bison was good but not quite up to snuff for a grammar as out there as job definitions.19:15
=== robbiew is now known as robbiew-akf
=== robbiew-akf is now known as robbiew-afk
=== robbiew-afk is now known as robbiew
mbieblKeybuk: there is a funny typo in netbase's postinst23:05
mbieblupstart-rc.d ;-)23:06
Keybukheh23:07
KeybukI do that quite a lot23:07
Keybukand I try and install udevs on the installer23:07
Keybukudev-udeb just kills me23:07
ion:-)23:08
mbieblin the ubuntu-boot ppa, i.e.23:09
Keybukalready fixed23:09
=== robbiew is now known as robbiew-afk

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