/srv/irclogs.ubuntu.com/2015/03/17/#cloud-init.txt

=== harlowja is now known as harlowja_away
nk121Hi #cloud-init. Question about upstart jobs -- is it safe to assume that after all of cloud init stuff is done, it starts the service?06:25
Odd_Blokenk121: "The service"?10:53
nk121i mean the upstart job10:53
Odd_Blokenk121: Which job are you referring to?10:54
nk121an upstart job included in the cloud-init configuration10:54
nk121does it get started at the end of everything being run?10:55
nk121it seems to, but i'm not sure when in the lifecycle its started (like is it the last thing that happens when cloud init is run?)10:55
nk121(so should runcmd and user data scripts assume that the upstart job is not running)10:56
nk121Odd_Bloke: ^10:58
Odd_Blokenk121: I'm not sure how the ordering is determined, I'm afraid.10:58
nk121Odd_Bloke: That's ok, of course. :)10:59
Odd_Blokesmoser might be able to help out, but he's on EST so won't be around for a few hours.10:59
Odd_Blokenk121: Examining the code, it looks like there isn't a defined ordering; so things will be executed in the order Python's dict implementation spits them out.11:00
Odd_BlokeBut it just takes me missing one line for that to be completely wrong. :)11:00
nk121Yeah11:00
nk121hmm, so then its probably not safe to have a dependency on write_files and runcmd (i have a script that is written out in write_files and then executed as a specific user in runcmd)11:02
nk121so far, it seems to run my runcmd block after the file is created11:02
Odd_Blokenk121: Aha, OK, I think the ordering is defined by cloud.cfg.11:25
nk121is that a section?11:26
nk121or you mean, a file in the source11:26
Odd_Blokenk121: That'll (probably) live in /etc/cloud; it should be installed by your cloud-init package.11:26
nk121hmm11:28
nk121cloud_config_modules:11:28
nk121# Emit the cloud config ready event11:28
nk121# this can be used by upstart jobs for 'start on cloud-config'.11:28
nk121 - emit_upstart11:28
Odd_Blokenk121: So I think the upstart job is written out before any of these things run.11:29
nk121okay i'll have to continue this in the morning, its way past my bed time (i'm in PST). thanks for your help tonight11:30
Odd_Blokenk121: Sleep well! :)11:31
Odd_Blokesmoser: Daily reminder for https://code.launchpad.net/~daniel-thewatkins/cloud-init/fix-smartos/+merge/252874 :)11:48
smoserOdd_Bloke, is that python2 safe ?12:59
smoserdoes ser.readline() return something that can be .decode()ed in python2 ?12:59
smosernk121, the job will be written pretty early in boot.13:00
smoserso unless you're upstart job is set to run really early, it will be started by upstart.13:00
smoserbut cloud-init lets upstart take care of that.13:01
smoserthe 'emit upstart' isn't waht does it.13:01
smosermerged13:09
Odd_Blokesmoser: You can decode() anything in Python 2.13:11
Odd_Bloke>>> "".decode().decode().decode()13:11
Odd_Blokeu''13:11
smoseryeah, just tested that locally.13:11
=== harlowja_away is now known as harlowja
suro-patzlogger url16:51
suro-patzlogger: url16:57
harlowjasuro-patz there is no logger in most public channels; thats typically a y! concept ;)17:08
suro-patzis there a archive for cloud-init, I do not see that in pipermail17:09
Odd_Blokesuro-patz: It is logged to irclogs.ubuntu.com (e.g. http://irclogs.ubuntu.com/2015/03/17/%23cloud-init.html)17:10
Odd_BlokeI _think_ that is updated hourly.17:10
suro-patzcool! thanks Odd_Bloke17:10
nk121smoser: thanks. Could you clarify/confirm: 1) Is it a safe assumption to be run a file written in a write_files section in a runcmd or user data script? 2) If an upstart job is added via cloud-init, can you assume that its been installed into /etc/init and started before code in runcmd/user_data_script is run?19:08
smosernk121, http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/config/cloud.cfg19:09
smoserwrite-files writes the files. 19:10
smoserscripts-user in cloud_final_modules is what runs your 'runcmd' provided stuff.19:11
smoserso yes. 1 is safe and guaranteed.19:11
nk121ok, so for 1) write_files is in init, and runcmd is in config and user-data is in final, so that seems correct19:11
smoser2 is guaranteed except for if init system is not upstart (which... in vivid it is not and wont be in 16.04)19:12
nk121oh not, not run-cmd itself?19:12
smoserrun-cmd itself actually just writes the command to a script that will later get run. interestingly :)19:12
nk121sorry i mean run-cmd doesn't run run-cmd19:12
nk121ah19:12
nk121ok, so you are saying though i should not assume in the long run that my upstart job will be running when my runcmd/user-data script is run as that will change in a future ubuntu19:13
nk121within a stage, is that the order htey are run in?19:13
nk121err, you are implying ubuntu is moving away from upstart?19:14
smoseryes. within a stage they're run in that order.19:15
nk121oh, systemd replacement19:15
smoseryes, 15.04 will use systemd by default.19:15
smoserand thus 16.04.19:15
nk121okay, got it. thank you.19:16
smoseri'm not planningon making cloud-init in any version magically convert upstart to systemd jobs19:16
smoserbut there will likelyi be in a future cloud-init a way to write systemd jobs like you can write the upstart jobs now.19:17
suro-patzsmoser: there?22:35
smosersuro-patz, here for 3 minutes maybe23:32
harlowja_hmmm, i think he just wanted your feedback on https://code.launchpad.net/~suro-patz/cloud-init/vm-clone-ip-reusage-issue23:43
harlowja_if u get some time; u seem to have thoughts on that idea; so i'm gonna let u decide if thats ok to let in, lol23:44
suro-patzthanks harlowja_ ! 23:45
harlowja_np23:46
harlowja_although i think i missed him to, lol23:46
harlowja_was 10 minutes to late23:46
smoser... 23:48
smoseroh man.23:48
smoserthat is just a mess.23:48
smoser(not your code, but the whole non-deterministic network state behavior of cloud-init)23:48
smosermagic fixes in 2.023:48
smoseri have to read/think more than i hve time for now. will try to look tomorrow23:49
suro-patzsure smoser23:49
smoserlater. 23:50
smoserand happy st. patricks day :)23:50

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