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

ion#6  0xb7ff3eee in nih_file_read (parent=0x0, 00:21
ion    path=0xb800b094 "/sys/dev/block/8:1/../dev", length=0xbffff53c) at file.c:13400:21
ionmountall:file.c:134: Unhandled error from nih_file_read: Invalid or incomplete multibyte or wide character00:21
ionWtf? :-P00:21
ionkeybuk: A bug in nih_file_read: various errors cause a ‘goto error’, some of which set errno and some don’t. The error handler does nih_error_raise_system, potentially leading to nonsensical error messages.00:38
ionkeybuk: I was trying to nih_file_read a sysfs file. Its stat says its size is 4096, whereas read actually returns 4 bytes. That caused the ‘Invalid or incomplete multibyte or wide character’ message.00:40
ionkeybuk: Ah, you do set errno manually. I missed that.00:41
ionkeybuk: I still think the error message for this case isn’t very helpful. :-)00:42
ionTo ensure Keybuk notices this: hey, look at what i said on the other channel. :-P And now for some sleep.05:12
=== sadmac_ is now known as sadmac
=== h\h is now known as haraldh
ionMorning12:04
ionkeybuk: Online? :-)12:04
Keybukyup12:04
ionAny comments about my patch?12:04
Keybukpatch?12:04
ionti052526 < ion> keybuk: Here’s an untested implementation. It probably breaks your system and leaks memory, but it’s a start. Hey, at least it compiles without warnings. :-P  http://heh.fi/patches/mountall/12:05
ionti052620 < ion> keybuk: I’ll have a better capability to test mountall patches as soon as i can get my system to run *some* version of mountall. ;-)12:05
ionti052638 < ion> keybuk: As in, boot using it12:05
Keybukoh cool12:05
Keybukat a quick glance, isn't there a libudev way of doing this rather than dealing with sysfs by hand?12:06
Keybukyou have mnt->udev_device ;)12:06
ionGood point. I’ll take a look at that struct.12:06
Keybukhttp://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/12:06
Keybuke.g. while (dev = udev_device_get_parent ())12:07
Keybuk        if (dev is what you're looking for)12:07
Keybuk            break;12:07
Keybuketc.12:07
ionHow about slaves?12:08
ionudevadm info --export-db doesn’t seem to contain slave information.12:22
Keybukyou can still get things like that as properties, attributes, etc.12:23
ionudevadm info --query=all --name=/dev/alku-main/root: http://pastebin.com/f49b5a4b12:25
ionudevadm info --attribute-walk --name=/dev/alku-main/root: http://pastebin.com/f5c3b19a12:26
ionI fail to notice any mention of the md slave.12:26
ionI made made the physical_dev_ids function work on Mount * directly, patch updated. I didn’t implement the udev thing yet. I’ll have to research more.12:38
ionkeybuk: Whoops, forgot to add the entry to the list in queue_fsck. Patch updated.12:49
ionIt would be nice to see whether the actually code works in the current form.13:00
Keybukam figuring out why it doesn't now ;)13:01
ionHehe13:01
ionAny debug output?13:09
KeybukOMG13:13
KeybukIT BUILT13:13
Keybukion: --debug ;)13:13
ionI mean, when you tested it13:20
Keybuk?13:22
ionYou said you’re figuring out why it doesn’t work. Does it print debug output i could take a look at?13:23
Keybukoh, I mean mountall in general13:27
ionAh13:29
[psy]so whats is the RightWay(tm) to turn off a service on boot?14:15
[psy]and: how do i make my ldap-service start automaticly when the user wants to start apache, for example?14:17
[psy]we wanna rewrite our daemontools based distro to upstart14:17
[psy]oh and: how do i make everything that 'depends' on ldap, stop, and start again automaticly, when the user wants to restart ldap?14:19
[psy](just like gentoo's init system does)14:19
[psy]i've read the wiki, but i'm not sure how to do it with events.14:20
Keybukif you're thinking in terms of "depends", you need to take a few steps backwards14:27
=== mbiebl_ is now known as mbiebl
[psy]right14:54
* [psy] steps back14:54
[psy]back to daemontools you mean? :)14:54
Keybukno, just your way of thinking14:55
KeybukUpstart isn't a dependency-based system14:55
[psy]its event based, right?14:55
Keybukif you're interested in Upstart, you need to learn not to think in terms of dependencies14:55
Keybukexecatly14:55
[psy]my question was how to do it with events..is it possible?14:56
Keybukyes14:56
[psy]e.g.: user wants to start apache, so ldap is started first14:56
Keybukbut you're still thinking in terms of dependencies14:56
Keybukyou need to unlearn that14:56
Keybukthat's not how Upstart works14:56
[psy]ok14:56
Keybukin Upstart, we would say that apache is started when ldap is started14:57
Keybuk*not* the other way around14:57
[psy]so i need to but a start on ldap in the apache event-config14:57
[psy]however: i dont want apache to be started as soon as ldap is started all the time14:58
[psy]sometimes i just wanna start ldap, without apache14:58
Keybukwhy?14:58
[psy]dont think in terms of why14:58
[psy]ldap+apache is just an example14:58
Keybukwhat are the conditions in which apache would not be started at boot?14:58
Keybukwe don't do hypothetical examples here, only real world ones14:59
[psy]ok14:59
[psy]so i cant have ldap start automaticly as soon as i try to start apache? e.g. in the pre-start script of apache or something?15:00
[psy]dont tell me i need to unlearn dependencys15:00
[psy]maybe its time for upstart to implement dependencys 15:01
sadmac2[psy]: why?15:02
[psy]why?15:02
sadmac2yeah, why do you need them?15:03
[psy]for example: winbindd cant start if smbd isnt running yet15:03
[psy]currently with daemontools it keeps restarting until smbd is started15:04
[psy]what i want is a way to start smbd automaticly if winbindd is started15:04
[psy]and stop winbindd automaticly when smbd is stopped15:04
[psy]by the sysadmin15:04
sadmac2ok. upstart does that...15:04
[psy]how?15:05
sadmac2have smbd start winbind15:05
[psy]thats the wrong way around15:06
[psy]package-maintainer-wise15:06
sadmac2ok15:06
[psy]now this will happen: for some reason ldap is started. ldap starts smbd, and smbd starts winbindd15:07
sadmac2have winbind be started by smbd15:07
sadmac2yes. that will happen. so?15:07
[psy]but the sysad doesnt want smbd and winbindd running!15:07
sadmac2why not?15:07
[psy]he only wants ldap15:07
[psy]you wont get peace with that attidue15:08
[psy]attitude 15:08
sadmac2its not a rhetorical question15:08
[psy]i just told you: samba IS installed, but the sysad doesnt need it or use it. however, ldap IS needed for something15:08
sadmac2so he should uninstall samba15:09
ionkeybuk: Patch updated. Using libudev now. It still needs to be tested, i only know it compiles. :-P15:09
[psy]furthermore: the package maintainer of openldap doesnt want all kinds of references to smbd in his ldap-event script15:09
sadmac2[psy]: the references can go in the other scripts15:09
sadmac2start on starting ldap15:09
[psy]ah ok15:10
[psy]well let me ask another question: how do i keep a service down without removeing or moving the event definition?15:10
Keybukyou'd place the service in manual mode (0.10 era)15:11
sadmac2[psy]: at the moment you don't. solution coming.15:11
[psy]oki 15:11
[psy]i'll wait a while then15:11
[psy]i dont see any advantages to daemontools at the moment15:12
sadmac2Keybuk: one more 3-day weekend and event_operator will be gone from my tree :)15:12
[psy]some new features i dont need, some missing features i do need :)15:12
Keybuksadmac2: I know I still have your mail to review :-/15:12
* Keybuk is behind with lots of things atm15:12
[psy]and you really should implement dependencies15:13
sadmac2Keybuk: considering that changing event_operator was a precursor to that proposal, the fact that I figured out how to get rid of it entirely is kind of surprising.15:13
[psy]yeah..you could life without them...but then we you could say: hey..who needs packages, just ./confiugre;make install everything by hand because 'thats how we see it'15:13
sadmac2[psy]: there are some more powerful relationships coming. I won't say "dependencies" though.15:14
[psy]oki15:14
[psy]well the most important thing is the ability for the sysad to shutdown something permanently15:19
[psy]but we could work around that by using symlinks like /etc/event.d/servicename -> /etc/events/realservicescript15:20
[psy]sysv init style syslink ;)15:20
[psy]m15:20
sadmac2[psy]: that's a good for-now solution. Nicer things are coming.15:21
[psy]yup15:21
ionkeybuk: Another small update, better debug logging in add_device.15:46
ionkeybuk: The dev_ids code seems to work on a box that has lvm over md over two HDDs. I haven’t managed to test the fsck queue code yet.15:47
ionkeybuk: I still had to call udev_device_get_syspath, add "/slaves" to its result and call udev_device_new_from_syspath for each entry under that path. I didn’t figure out a way to traverse the slaves using plain libudev API.15:50
sadmac2ion: what is this you're working on?15:52
ionsadmac: Keybuk implemented mountall, a program that handles the fscking and mounting of fstab entries in the proper order, parallelizing fsck as much as possible. Well, too much, since all fsck instances run in parallel, with a /* FIXME */ for having each fsck instance use a lock for each underlying physical device to avoid thrashing. My patch fixes the FIXME.15:55
sadmac2ion: oic15:58
ionkeybuk: How does the patch look now?16:26
Keybukion: haven't looked yet ;)16:27
ionkeybuk: I created the file /looptest, made an ext2 filesystem on it and added ‘/looptest /mnt ext2 loop 0 2’ to fstab. Mountall seems to end up waiting forever in the main loop select().17:12
sadmac2ion: missing an nih_main_loop_interrupt ?17:16
Keybukion: isn't it just waiting for the root filesystem to be ready?17:17
Keybukudevadm trigger --subsystem-match=block17:17
ionhttp://pastebin.com/f2483aa5a17:18
ionIt says mountpoint_ready: /17:19
ionOh, now would be a good idea to test without my patch. :-P17:20
ionNope, it still does the same thing.17:20
=== notting_ is now known as notting
ionThe same issue with a swapfile: i created the file /swaptest, did mkswap and added ‘swaptest none swap sw 0 0’ to fstab. Mountall says mountpoint_ready: / and then blocks forever in select().17:28
ion‘/swaptest none swap sw 0 0’17:29
ion(having commented out the /looptest entry)17:29
sadmac2Keybuk: strange thought. What if instead of start on started <name> <env> it was start on started <env>, where the first item in <env> was always UPSTART_EVENT_NAME= ?17:32
Keybuksadmac2: ugh17:32
Keybukbesides, 0.10 that's start on <job> started again ;)17:32
sadmac2Keybuk: yeah, I was wondering about the semantics for that. Is event.name == job.name and started is an argument?17:33
Keybukjobs, states and events are the same fundamental thing17:34
Keybukevent is just an edge of a state17:34
Keybukit's not so much an argument, as a sub-state if that makes sense17:34
sadmac2the edge of a state is not the same fundamental thing as a state.17:34
KeybukI think it is17:34
sadmac2Keybuk: if you buy an apple and I give you the core of an apple are you happy>17:35
Keybuk*baffled*17:35
sadmac2Keybuk: better: if you buy a table and I give you the edge of a table, are you happy?17:35
Keybukyou're being silly17:35
Keybukstop it17:35
sadmac2Keybuk: what does muddling states and events gain us?17:37
Keybuksymmetry17:37
sadmac2Keybuk: why not make states and malloc'd regions the same too then?17:38
Keybukyou're still being silly17:38
sadmac2If I'm being silly by following your logic to its conclusion...17:39
Keybukfor example:17:39
Keybukone job17:39
Keybuk  while network-device eth0 up17:39
Keybukanother job17:39
Keybuk  while apache running17:39
Keybuk  on network-device eth0 up17:39
Keybukthat's why it makes sense for events and states to be symmetric17:40
Keybukit's simple, obvious and elegant17:40
sadmac2does network-device eth0 up correspond to starting, started, stopping, stopped, or something in the middle?17:42
Keybukto whatever you want17:42
sadmac2and how do you specify which?17:44
sadmac2Keybuk: I see what you're doing, but I think you describe it poorly. I think this model has no events at all (at least not ones visible to the user)17:46
Keybukon is an event17:47
sadmac2on itself?17:47
Keybukno17:48
Keybukon matches events17:48
Keybukwhile matches states17:48
Keybukstates are either true or false17:48
sadmac2but events are states17:48
sadmac2or so you say17:48
Keybukevents do not have any value17:48
Keybukevents are when states change17:48
sadmac2so are events the same as states or different?17:49
Keybukevents occur when states change17:49
sadmac2ok, so events aren't states17:50
sadmac2that kind of ruins your explanation of on's arguments17:53
Keybukwhy?17:55
sadmac2Keybuk: because that explanation began "events are states"17:56
sadmac2Keybuk: and we've now arrived at "events aren't states"17:56
Keybukonly the way you describe them17:56
Keybukto me they're one and the same thing17:56
sadmac2Keybuk: then why do we have two words for it?17:57
sadmac2not a rhetorical question.17:57
Keybukbecause I haven't thought of a better word yet17:57
sadmac2Keybuk: I could follow you if there were no events at all, just states17:58
KeybukI don't like the word "states"17:58
sadmac2Keybuk: on apache started => start at the earliest point in time at which apache started is true17:58
Keybukright17:59
sadmac2Keybuk: if you're into the true/false thing, "conditions" would be the next point.17:59
KeybukI'm not as much of a fan of PhD level logic problems are you are ;)17:59
sadmac2Keybuk: all of this makes 0.6 compatibility reeeely grody. Are you still interested in 0.6 compatibility?17:59
KeybukI don't see it as a problem17:59
sadmac2Keybuk: I think "conditions" is a fairly sane word17:59
sadmac2Keybuk: information coded as conditions/states for 0.10 as you describe is coded as environment variables in 0.6. That gets scary fast.18:00
sadmac2unless these two things don't interact seamlessly18:01
ionkeybuk: What’s missing from the ubuntu-boot PPA so that one could upgrade to it and have a booting system? Perhaps i could do something.18:01
sadmac2Keybuk: I actually prefer conditions precisely because its /less/ prominent in PhD-land. States is a reeeeely loaded word from the formalist side of things. Especially when we talk about "state machines"18:02
sadmac2which are rarely what "state machines" really are when we're talking about them.18:02
sadmac2Keybuk: also I wonder about the usefulness of your example. What wants to start "on network-device"? If it needs the network device to start why doesn't it care if it goes away halfway through initialization?18:06
sadmac2so if on x means "at the earliest point when x is true," then I'd assume we'd have an after x for "the earliest point when x is false"18:08
sadmac2from...until would want a from after...until, and a from...through counterpart as well18:08
Keybukion: figuring out why it's not working ;)18:14
Keybukit works on one mini18:14
Keybukbut packaged up it doesn't18:14
Keybuktrying to figure out what step I've missed18:14
Keybuksadmac2: ntpdate is started when a network device comes up18:14
KeybukI don't think your "after" case is invalid, I've been thinking the same thing18:15
sadmac2Keybuk: beyond that, I'd keep the term states. It has heritage in the project and its not really "wrong" just yet. (Events I'd stop saying for awhile. They're still present here, but they're hidden."18:17
sadmac2honestly I'd be ok with calling them jobs.18:27
sadmac2that's what the code calls them now (or what will become them)18:27
Keybukright, I suspect that's what the code will always call them ;)18:29
sadmac2Keybuk: so in the phrase "on foo" foo is a state, but on infers an event from it. "after" would take the same state and infer a different event.18:31
Keybukdon't know18:31
KeybukI've used after for temporary events18:31
Keybuk<time period> after <event>18:31
sadmac2Keybuk: either way. Point is events don't really have names and arguments anymore. We don't talk about them directly in the config. We mention states, and an event is implied by context.18:33
sadmac2Keybuk: I'd also imagine initctl emit doesn't make much sense anymore. Things like udev can just start states for their devices.18:34
Keybukno it still makes sense I think18:37
Keybukthere are still events that don't have attached states18:37
Keybukevents used as commands18:37
sadmac2Keybuk: how do we talk about them in job definitions. Do we just put them in the same namespace as states so "on fooevent" works too?18:38
Keybukthat's a pretty good question18:47
KeybukI can't find my notes on this18:47
Keybukbut basically you have events that are really states18:47
* sadmac2 gets nervous18:47
sadmac2how long do they last?18:48
sadmac2also you should publish these "notes" :P18:48
KeybukI mean in the current scheme18:48
sadmac2were we all perfect :)18:48
Keybukto publish involves typing18:49
* Keybuk writes a lot with pen, paper and whiteboards18:49
Keybukso18:49
Keybukevents that are states18:49
Keybuk"job started" type things18:49
Keybukthere are events that are real events that would never have states18:49
Keybukcontrol-alt-delete being a good example18:49
Keybukand there are events that we use a bit like commands18:50
Keybukwhere the *completion* is important to the emitter18:50
Keybukmaybe hooks is more appropriate than commands as a description18:50
Keybuk"I'm going to reboot, does anyone need to do anything first?"18:50
sadmac2Keybuk: so theres still the question of this time-interval (state) => point-in-time (event) mapping.18:52
sadmac2For the first case, job started clearly maps to an interval. if we need an event we say "The earliest point at which 'job started'"18:53
sadmac2for case two... that's hard.18:53
KeybukI don't think it's earliest point at which18:53
sadmac2for case three, that looks a lot like injecting case 1.18:53
Keybukit's "after 'job started' has happened"18:53
Keybukthe key point is that 'job started' may no longer be true anymore18:53
sadmac2Keybuk: so when the job stops18:53
Keybukbecoming false doesn't cancel the fact that the event is still queued18:53
sadmac2Keybuk: I would say job started is a convenience alias for job running18:54
Keybukright, so that's the interesting bit19:09
Keybukisn't "job running" just "job" ? :)19:09
Keybukor is "job" true when the job *should* be running, but "job running" true when the job *is* running19:10
Keybuketc.19:10
sadmac2Keybuk: assuming "job foo" can't be true unless "job" is true, then just job would have to be job starting U job running U job stopping19:10
sadmac2Keybuk: which means job is true when it should be running19:11
sadmac2Keybuk: which I like19:11
Keybukright19:11
Keybukthat's pretty much the direction I was thinking19:11
sadmac2Keybuk: the idea that on tests for presence also gets around the "what if you start on started but its already running when you insert your job" thing.19:12
Keybukhuh?19:12
sadmac2Keybuk: suppose I have a running system, where apache is running. If I add a new job and have "on apache started" in it, if on is looking for an event, my job won't be running, because the "apache started" event has already passed. If on checks for earliest point at which a state is true, though, it can figure out to start my job right away.19:13
sadmac2when I say new job I mean new job and class. Completely new .conf19:14
Keybukerr19:14
Keybukbut you don't *want* that to be started19:15
Keybukthat's the whole point19:15
Keybukif you're using "on" it should NOT look-behind like that19:15
Keybukyour "on apache started" job should only be run *when* apache is started19:15
Keybuknot if apache happens to be running19:15
sadmac2yeah. out-moded problem.19:15
Keybukthis is exactly how it differs from "while" :)19:15
Keybuk(and that while also implies a stop condition)19:15
=== robbiew is now known as robbiew-afk

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