/srv/irclogs.ubuntu.com/2010/03/09/#upstart.txt

=== robbiew is now known as robbiew_
=== oojah_ is now known as oojah
=== robbiew_ is now known as robbiew
jonwoodHello?16:39
KeybukHello16:39
jonwoodDoes anyone mind if I ask a few questions about Upstart's scope?16:39
Keybuksure16:39
Keybukask away16:40
jonwoodI'm trying to work out where the init scripts in /etc/init.d fit into things.16:40
Keybukthey're supported for compatibility with the LSB, and also to make migration easier for distributions16:40
Keybukthe usual way it works is that you run the old "rc" script as an Upstart job16:40
Keybukjust as the old sysvinit ran it from inittab16:40
Keybukwhere or how you run it, and at which point in the boot, etc. will depend on distro16:40
Keybukand the distro's own needs16:40
jonwoodOk, so when creting init scripts for new things, the recomended way would be to create upstart scripts for them?16:41
Keybuke.g. a distro that hasn't migrated to Upstart fully might consider the /etc/init.d scripts still authorative and run Upstart jobs around/before/after them16:41
Keybukwhere a distro that's migrated the bulk of its boot to Upstart might consider them an afterthought16:41
Keybuka fully native embedded system might not support them at all16:41
jonwoodI'm talking specifically in the context of Ubuntu Karmic16:41
Keybukit depends16:41
KeybukUpstart is still very much in development, so the config file format is expected to change16:42
Keybukso it's ok to ship Upstart jobs, as long as you keep up with Upstart changes16:42
Keybukshipping an Upstart job that refers to "runlevels" is rarely correct of course16:42
jonwoodI'm only planning to distribute them internally anyway, so that's not a huge problem.16:42
JanCin that case upstart scripts give you more power  ☺16:43
jonwoodI'm also wondering how far it currently goes with process supervision. Should it be restarting services that get killed for example?16:43
JanCyou can specify whether or not it should do that16:44
Keybukjonwood: it has a basic support for process supervision, and can respawn processes if they die unexpectedly, along with telling it what exit codes and signals are expected16:44
jonwoodWhere abouts can I find documentation on that?16:45
Keybukin the man pages, of course16:45
jonwoodHeh, I guess I asked for that :P16:46
JanCinit(5) mostly 16:46
jonwoodThanks :)16:48
sadmac2Keybuk: I've thought about making the task stanza an extension of the expect stanza17:05
sadmac2Keybuk: "expect exit"17:05
Keybukit doesn't just change that though17:06
sadmac2Keybuk: internally its a bit different. Trying to decide whether from a user perspective the metaphor makes sense17:07
sadmac2Keybuk: was that a crash? did you catch everything?17:12
Keybuksadmac2: I can't tell whether I caught everything, can I? :p17:13
sadmac212:06 < Keybuk> it doesn't just change that though17:13
sadmac212:07 < sadmac2> Keybuk: internally its a bit different. Trying to decide whether from a user perspective the metaphor makes sense17:13
sadmac212:10 -!- Keybuk [~scott@quest.netsplit.com] has quit [Quit: 夠荒唐]17:13
Keybukwasn't a crash - updated IRC client to restore my notification icon patch17:13
sadmac2oic17:13
KeybukI was thinking that task vs. service is fairly well expressed by whether the job uses "while" or "on"17:14
sadmac2Keybuk: services with no dependencies would just use on17:14
Keybukno they won't17:15
sadmac2Keybuk: it also might make sense for a task to have dependencies17:15
Keybukyes, but they'll just combine while and on ;)17:16
sadmac2Keybuk: while postgres every 3 hours exec trivial-database-task17:16
Keybukthat'd be a task17:16
Keybuk"every" is kinda like "on"17:16
sadmac2Keybuk: so you're saying a service will /never/ use on.17:16
KeybukI can't think of one17:17
wasabiwhile system-running17:17
sadmac2Keybuk: you may be right, but it takes a bit of thinking to ferret out. I'm not sure the principle of least surprise would encourage us figuring out task vs service automagically that way.17:18
wasabidon't make the user need to know task/service as a distinction.17:18
wasabijust instruct them to describe how they want the executable to be invoked.17:18
Keybukthe primary distinction between a service and a task is how it affects the event it's run by17:19
wasabiblocking it or not?17:19
Keybukblocking it from completing, right17:19
Keybukso a better way to look at it =>17:19
Keybuk - is the a reason that something run "on <event>" should not ordinarily block it from completing17:19
Keybuk - is there a reason that a service run "while" something should block that condition from ever being true17:20
Keybuk(reading the latter should reveal it's a logical impossibility :p)17:20
sadmac2yes, I prefere while/before to be a first-order implication style relationship17:21
sadmac2prefere? In spanish apparently17:21
Keybukright17:22
sadmac2Yo preferé que durante/antes son implicaciónes del <<order> uno17:22
sadmac2not so bad, and I never took discrete math in spanish, so17:22
sadmac2except I mixed tenses.17:25
sadmac2what were we talking about?17:25
Keybuktask vs. service17:31
Keybukon vs. while17:31
sadmac2surprised you answered that seriously... anyway I'm not seeing an approach here that has much real advantage over having a task stanza17:35
Keybukmore DWIM17:36
sadmac2Keybuk: I'm not sure people necessarily "mean" task when they imply "on". Just because I always use them together doesn't mean they're synonymous17:37
sadmac2s/imply/say/17:37
Keybukso let's think of a few examples17:38
Keybuk  on service pre-start17:38
Keybuk  script17:38
Keybuk    ...17:38
Keybuk  end script17:38
Keybukwould you ever not want that to block?17:38
sadmac2Keybuk: true, but there's another question17:39
sadmac2Keybuk: would I expect it to block anyway?17:39
sadmac2Keybuk: its a strange argument I'm making here. Doing what the user expects is better even if its /not/ what they want.17:39
sadmac2Keybuk: look at the example this way:17:41
sadmac2on service event17:41
sadmac2would I expect that to change the semantics of the job?17:41
Keybuksince it always does in Upstart, yes :p17:42
sadmac2poor choice of words17:43
Keybukor, another way17:44
Keybuk  on shutdown17:44
Keybuk  exec save-my-files17:44
Keybukwould you expect it to wait until your files were saved before shutting down? :p17:44
sadmac2that's a good point17:45
sadmac2Keybuk: where does this leave from ... until ... ?17:48
Keybukdunno yet17:48
sadmac2alright I'm sold17:49
sadmac2Keybuk: I think we need from...until to turn events we get from outside into upstart states17:54
sadmac2Keybuk: netdevice from udev-thingie until other-udev-thingie17:54
sadmac2feeling articulate today17:54
sadmac2also it would be nice to have a syntax like that somewhere where we could just define a whole bunch of states in a row17:55
Keybukyes, I think we need it17:57
KeybukI'm just not sure whether we consider it like-while or like-on17:57
Keybukhunch says like-while, but would need to think about it17:57
sadmac2Keybuk: like on would mean from A until B would block A until B occurred?17:58
sadmac2Keybuk: doesn't sound right17:58
wasabiI don't think I'd expect shutdown to complete until the tasks associated with it completed18:18
wasabiafter all, if shutdown completes, the system is off.18:18
wasabiheh18:18
=== rberger_ is now known as rberger
=== rberger_ is now known as rberger

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