/srv/irclogs.ubuntu.com/2007/02/20/#upstart.txt

_ionHm, Keybuk hasn't been here for three days.12:42
=== j_ack [n=rudi@p508DB835.dip0.t-ipconnect.de] has joined #upstart
=== osx5 [n=danielka@c-24-3-201-47.hsd1.mn.comcast.net] has joined #upstart
osx5hello02:16
osx5anyone from freenode staff here?02:18
AStormMd?02:18
osx5k02:19
=== osx5 [n=danielka@c-24-3-201-47.hsd1.mn.comcast.net] has joined #upstart
osx5 Md must be afk02:26
_ionHow may we help you with upstart?02:27
osx5I want a hostname cloak02:27
osx5but thanks 02:27
osx5is upstart better/02:28
osx5?02:28
_ionWell, yes. :-)02:28
osx5what makes it better?02:29
osx5I use darwin on mac osx02:29
_ionSee the "How does it differ from launchd?" heading at http://www.netsplit.com/blog/articles/2006/08/26/upstart-in-universe02:32
_ion(Seems like the page's markup is broken)02:32
osx5k02:32
osx5I'm new to unix02:32
osx5and linux02:32
=== AStorm [n=astralst@host-81-190-179-124.gorzow.mm.pl] has joined #upstart
=== AStorm [n=astralst@host-81-190-179-124.gorzow.mm.pl] has joined #upstart
=== osx5 [n=danielka@c-24-3-201-47.hsd1.pa.comcast.net] has joined #upstart
=== space-m0nkey_ [n=chatzill@client-82-3-73-143.manc.adsl.virgin.net] has joined #upstart
=== space-m0nkey_ is now known as space-m0nkey
osx5will MD ever return?03:08
_ionLet me check his wereabouts from my surveillance equipment...03:09
osx5lol03:09
=== osx5 [n=danielka@c-24-3-201-47.hsd1.pa.comcast.net] has left #upstart []
=== osx5 [n=danielka@c-24-3-201-47.hsd1.pa.comcast.net] has joined #upstart
osx5oh he left03:11
osx5wonderful03:11
osx5lol03:11
=== Amaranth [n=travis@ubuntu/member/Amaranth] has joined #upstart
=== Amaranth [n=travis@ubuntu/member/Amaranth] has joined #upstart
=== AStorm [n=astralst@host-81-190-179-124.gorzow.mm.pl] has joined #upstart
=== wasabi [n=jhaltom@ubuntu/member/wasabi] has joined #upstart
=== wasabi__ [n=wasabi@cpe-76-184-96-5.tx.res.rr.com] has joined #upstart
=== AlexExtreme [n=AlexExtr@frugalware/developer/AlexExtreme] has joined #upstart
=== Md_ [i=md@freenode/staff/md] has joined #upstart
=== Keybuk [n=scott@quest.netsplit.com] has joined #upstart
=== Md_ is now known as Md
_ionWelcome back, Keybuk :-)10:35
Keybukheyhey10:36
Keybuk"welcome back" ? :P10:36
Keybukdid I go somewhere?10:36
_ionFor almost 3 days you did. ;-)10:37
Keybukwe call that a "weekend" :p10:38
_ionHehe10:38
Keybuk"until" is causing me issues11:05
_ionWhy is that?11:07
Keybukwell, how it should behave11:07
Keybuksimplest example:11:07
Keybuk  foo until bar11:07
KeybukI think it's pretty obvious that the job is running when foo happens, and stops running when bar happens11:07
Keybukhowever ... if foo happens again after bar has happened, should the job be started again or not?11:08
_ionI do think it should.11:08
KeybukI agree, simply on the basis that upstart shouldn't consider anything to be permanent11:09
Keybuke.g. in an upstart system, you should be able to kill all processes, then issue the "startup" event again as a kind of soft reboot11:09
_ionAlso, '(foo and baz) until bar': IMHO after bar, *both* foo and baz should happen again.11:10
Keybukhang on, getting to that ;p11:10
Keybukso, with the above example, we can implement until simply11:10
Keybukit's just a tree node that is TRUE when the left becomes TRUE, and FALSE when the right becomes TRUE11:11
Keybukno further handling is needed11:11
Keybukso right, more complex example as you said11:11
Keybuk  (foo or bar) until baz11:11
KeybukI think that's pretty obvious; either foo or bar must happen for it to be started, baz stops it, and either foo or baz can start it again11:11
_ionYeah, with the 'and' case the implementation definitely becomes more complex.11:12
Keybukright11:13
Keybuk  foo until (bar or baz)11:13
Keybukthat's still simple11:13
Keybukand makes it more complex11:13
Keybuk  (foo and bar) until baz11:13
Keybuknow, I think this should behave thus:11:13
Keybuk foo and bar need to happen in any order for the job to be started11:13
Keybuk baz happening stops it11:13
Keybuk after which, both foo and bar need to happen again11:14
Keybuk(rather than just one or the other happening)11:14
_ionIndeed.11:14
Keybukso that makes the implementation a little more complex11:15
Keybukwhen the right hand side is set to TRUE, the until node becomes FALSE *and* sets the left hand tree to FALSE11:16
Keybuk(ie. all nodes in the left hand tree)11:17
Keybukdoes that sound sane?11:18
_ionIs '(foo until bar) until baz' supported? (I can't think of any use cases for it  wouldn't it be exactly equivalent to 'foo until baz'?)11:22
Keybukwe'll get to that in a bit, thinking this one step at a time11:22
Keybuk  foo until (bar and baz)11:22
Keybukthat's somewhat interesting11:23
Keybukfoo starts it, but bar and baz both need to happen to stop it11:23
Keybukonce stopped, only foo needs to happen to start it again; but both bar and baz need to happen again to stop it11:23
Keybukso that implies that when the left hand side is set to TRUE, the until node becomes TRUE *and* sets all nodes on the right hand side to FALSE11:23
_ionYes, it seems to me that nodes should be able to recursively set children to FALSE.11:25
Keybukright11:25
Keybukso (foo until bar) until baz11:25
Keybuk     until11:26
Keybuk  until  baz11:26
Keybukfoo  bar11:26
Keybukfoo has to happen for the tree to be TRUE11:26
Keybukif either bar or baz happens, the tree becomes FALSE11:26
_ionAh, right.11:27
Keybukin either case, only foo needs to happen again for it to become TRUE again11:27
Keybukso it's exactly equivalent to foo until (bar or baz)11:27
_ionSo when baz happens, the topmost 'until' asks the child 'until' to set itself as FALSE, which doesn't need to do anything else than ask all its children to set themselves FALSE.11:29
Keybuktight11:30
Keybukright11:30
_ion(Thinking like OOP and recursive programming, of course the actual implementation doesn't need to be either object-oriented or recursive.)11:30
Keybuk*nods*11:32
KeybukI actually have a non-recursive tree iterator in libnih11:32
Keybukbut anyway11:32
Keybukright11:32
Keybukso until is quite simple provided that all operators and operands are simple11:32
_ionYeah, i remember skimming through that change.11:33
Keybuklets introduce a less simple operator/operand11:33
Keybukwith JOB11:33
Keybukhow do we define that?11:33
Keybukeither its TRUE when the job's goal is START and FALSE when the job's goal is STOP11:33
KeybukOR11:33
Keybukits TRUE when the job's state is RUNNING and FALSE otherwise11:33
KeybukOR11:33
Keybukits FALSE when the job's state is WAITING and TRUE otherwise11:34
Keybuk<g>11:34
_ion:-)11:34
_ionIts use cases should probably be listed to find the answer.11:34
Keybukthe problem is it was defined over hot thai food11:34
Keybukwhile we were crying and sweating11:34
_ionHehe11:35
Keybukand before we came up with the idea that "starting" and "stopping" should be blocking events11:35
_ionSo, *are* there use cases for it that can't be done with the already existing things?11:35
Keybukwell...11:35
Keybukobviously you can use until and the job events11:35
Keybuk  starting JOB until stopped JOB11:36
Keybuk  started JOB until stopping JOB11:36
Keybukwith the advantage that those retain the blocking behaviour11:36
Keybukthe actual use case for "with" was that you could place complex stanzas in a file that could be shared11:36
Keybukand then just say "do whatever that one says"11:37
Keybukit also happens to provide a "running with another job without blocking it" kind of syntax11:38
_ionWhat are the use cases for that? I.e. what are the jobs that should run 'with' another job without blocking it?11:43
Keybukdunno11:44
Keybukthe main use case seems to be putting syntax in another file11:44
_ionFor example, if there's a dummy job 'networking' with nothing but 'on' stanzas, i think it is good for a job using 'started networking until stopping networking' to block whatever 'networking' blocks.11:47
Keybuka reasonable point11:47
Keybukok, so let's skip with for now11:58
Keybukand think ahead to temporary events11:58
Keybuk"every hour" for example11:58
Keybukevery hour and network-up until network-down11:58
Keybukpretty obvious; the "every hour" event triggers once an hour11:58
Keybukand and combines that with the until, so it only gets used if the network is up11:58
Keybuk...11:58
Keybuk  every hour until some-event11:59
Keybukthat one is a bastard :p11:59
_ionHmm... :-)11:59
KeybukI think some of the problem is the words we're using12:00
_ionI can't think of anything else than starting it at every hour and stopping it when some-event happens.12:00
_ionSorry, i mean:12:01
Keybukif "foo until bar and frodo until bilbo" was actually "between foo and bar while between frodo and bilbo", it makes more sense12:01
Keybukso it'd be obvious that "between every hour and some-event" behaves as you describe (which is how it would behave)12:01
_ionStart it at 00:00. Nothing changes until 03:12, when some-event happens. Start it at 04:00, until some-event happens again12:01
Keybukright12:01
KeybukEnglish and Logic don't collide adequately12:02
_ionHeh12:02
Keybuk(the fact that in English, "foo until bar and frodo until bilbo" describes a period where either of the two is active (where logically it's when both are active)12:03
Keybukand "foo until bar or frodo until bilbo" describes a period where only one of the two is active (when logically it's when either are active))12:03
_ionWould substituting 'or', 'and', 'until' with |, &, -> respectively be too ugly?12:06
_ionThe Finnish keymap also has  :-)12:07
_ionAlthough i don't use it for anything else than writing Finnish specifically, it sucks for general use. :-)12:08
KeybukI don't think the punctuation changes anything, as you'd still read it in English12:10
Keybukhttp://upstart.ubuntu.com/wiki/ComplexEventConfig12:11
Keybuk^ so that's a reworked draft12:11
_ionTrue.12:11
=== reppel [n=reppel@213-140-11-128.fastres.net] has joined #upstart
_ionLooks nice.02:30
=== space-m0nkey [n=chatzill@client-82-3-73-143.manc.adsl.virgin.net] has joined #upstart
=== cortana [n=sam@62-31-146-25.cable.ubr12.azte.blueyonder.co.uk] has joined #upstart
=== j_ack [n=rudi@p508D9227.dip0.t-ipconnect.de] has joined #upstart
=== AStorm [n=astralst@chello084010114027.chello.pl] has joined #upstart
_ionkeybuk: Have you had time to hack more on replacement-initscripts yet?06:51
Keybuknot yet06:52
Keybukwell06:52
Keybukhave been thinking and experimenting deeply with mounting filesystems06:52
Keybukmy original plan had been an instance job fired up each time a drive was mounted06:52
_ionThat's actually what i wanted to ask about...06:52
Keybukand the job was just to mount that path06:52
Keybukand have a similar one for unmounting06:52
Keybukbut that doesn't work in the face of needing to mount /usr/local after /usr06:53
_ionExactly. Have you got a solution yet?06:53
=== j_ack [n=rudi@p508D9227.dip0.t-ipconnect.de] has joined #upstart
=== juergbi [n=juerg@80-219-17-102.dclient.hispeed.ch] has joined #upstart
_ionAn idea, probably filled with race conditions :-) : a file on RAM disk that contains the list of filesystems ready to be mounted. The 'fsck' job could contain 'echo "$DEVICE" | locked-write --append /ramdiskpath/mount; /sbin/initctl emit filesystem-checked -eDEVICE' and the 'mount' job would start on filesystem-checked and contain 'locked-read /ramdiskpath/mount | while read device ... ... for device in $ok_to_mount; do [mount them] '06:59
_ionFeel free to punch holes in it. :-)07:00
_ionwhatever starts on block-device-removed would have to remove the devices from the list while locking it.07:02
_ionThat's what the mount job should do on successful mount, too.07:03
AStormKeybuk, what about using dependencies to do this? :>07:09
AStormJust add parametrised dependencies (e.g. use of $VALUE in deps)07:10
KeybukI'm vaguely leaning towards just having a "mount -a" job and make sure that fails if at least one filesystem could not be mounted07:30
_ionHow about ones being fsck'd?07:32
Keybukaye, tricky07:33
MdKeybuk: check what suse does, I know that for a long time they have been running fsck/mount on demand triggered by uevents07:34
KeybukMd: good point07:40
Mdif all else fails, sleep for a while in a loop if the mount point does not exist07:43
_ionmountd? :-)07:45
KeybukHAL!07:46
Keybuksometimes I wish I worked for Apple07:46
Keybukthen I'd know everything was on the one filesystem07:47
Keybuk:p07:47
_ionHeh07:47
KeybukSUBSYSTEM=="block", ACTION=="add", KERNEL=="sd*[0-9] |hd*[0-9] ", RUN+="mount.sh"07:49
_ionmount.sh does the fscking, too?07:49
Keybukyup07:49
Keybuk(not that I had a handy vmware instance of opensuse around or anything ...)07:50
_ionAnd what does it do when there's /usr/local waiting for /usr?07:50
Keybukit just runs mount -a after each fsck07:50
_ionI take it udev has a command queue, multiple mount.shs are never started simultaneously?07:52
Mdno, they are07:53
_ionDoes mount.sh contain locking then?07:53
_ionI probably should just grab the script from somewhere myself. :-)07:53
=== jonib1 [n=jonas@ua-83-227-144-18.cust.bredbandsbolaget.se] has joined #upstart
=== thotz [n=thomas@d86-33-125-87.cust.tele2.at] has joined #upstart
=== thotz [n=thomas@d86-33-125-87.cust.tele2.at] has left #upstart []
=== space-m0nkey [n=chatzill@client-82-3-73-143.manc.adsl.virgin.net] has joined #upstart
=== phsdv [n=paul@dyn-83-152-232-59.ppp.tiscali.fr] has joined #upstart
=== Md [i=md@freenode/staff/md] has joined #upstart
Keybuk_ion: it calls mount -a $DEVNAME09:14
Keybukwhich is interesting09:14
Keybukit doesn't seem to account for mountpoint not existing at all09:14
=== AStorm [n=astralst@chello084010114027.chello.pl] has joined #upstart
=== mbiebl [n=michael@e180076146.adsl.alicedsl.de] has joined #upstart
=== pkt [n=pantelis@athedsl-131388.otenet.gr] has joined #upstart
=== j_ack [n=rudi@p508DA63E.dip0.t-ipconnect.de] has joined #upstart

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