/srv/irclogs.ubuntu.com/2010/11/23/#upstart.txt

twbIs /lib/init/fstab an upstartism?05:53
twblxc-ubuntu creates it, but I'm not sure what uses it05:53
ectospasmthis channel seems underpopulated, and the Upstart documentation seems woefully inadequate.05:54
ectospasm...I never see any adequate answers to questions like that here.05:55
twbectospasm: I know, but it costs me little to try05:57
ectospasmtrue enough05:58
twbIf I'm running upstart inside a container, how do I pass --debug to it?08:36
twb(container as in LXC)08:36
mbiebltwb: to be precise, /lib/init/upstart is used by mountall08:36
mbieblbut yes, it is upstart specific (as is mountall)08:37
twbOK.08:37
twbI'm trying to run lucid in an LXC container, but unless I rip out most of /lib/init/fstab, it doesn't start a getty on /dev/console and there's no other output on /dev/console, and I don't know how to work out why -- short of bisecting over /lib/init/fstab08:38
mbieblwhich directories fail to mount under lxc?08:39
twbmbiebl: I don't know08:40
twbI don't know *how* to know08:40
twbIn /lib/init/fstab, is "showthrough" a mountallism?09:43
twbi.e. if I'm moving those mountpoints to pre-upstart code, do I just strip that option out?09:43
mbieblshowthrough from what I know allows you to mount /var/run early during boot09:45
mbiebland later /var 09:45
mbiebland /var/run won't be shadowed09:45
twbOh, I see.09:45
twbThat means I don't need it for my specific use case09:46
=== azul_ is now known as jodh
mbiebltwb: if you don't have a separate /var, yes09:49
mbiebl(not sure if that is even possible within an lxc container)09:49
twbYeah, but I happen to not be doing it :-)09:50
twbDumb question: does that mean ubuntu/upstart ignores RAMRUN=yes RAMLOCK=yes in /etc/default/rcS?10:10
mbieblyes10:11
twbHum.10:11
twbDue to the way LXC operates, I want to instrument wherever the upstart calls the "real" (hard) halt11:17
twbI can't see where that's happening in /etc/init -- is it done elsewhere?11:17
mbiebl/etc/init/rc.conf11:18
mbieblit calls /etc/init/rc 0|6 on shutdown/reboot11:18
twbAh, and the hard halting is done by it11:19
mbieblit is done in S90reboot resp. S90halt11:20
twbRight, I juts found it11:20
twbIs it just me, or does upstart get pissy if its pid isn't 111:52
twbkill -9 1 wasn't working, so my first idea was to make upstart the not-quite-first init11:52
mbieblit needs to be pid 111:52
ectospasmtwb: init is always 111:53
twbBecause the kerenl gives special treatment to 1?11:53
ectospasminit is the parent process of everything11:53
ectospasminit cannot be a child of some other process11:53
ectospasmold school UNIXy design, IIRC11:53
mbieblpid 1 has special semantics11:53
mbieblre-parenting of child processes etc11:54
twbIs there a way to get "kill -9 1" or similar to work?11:54
ectospasmtwb: what are you trying to achieve with "kill -9 1"?11:54
mbieblkilling pid 1 will result in a kernel panic11:55
twbI'm in a container, and halt/reboot -f doesn't work quite right, but I'm told LXC will do the right thing if I instea terminate the init process11:55
twbmbiebl: short of HTFS, is there a way to tell upstart "I know better than you, please let me kernel panic"?11:58
mbiebltwb: I know there were problems in the past related to openvz and upstart12:00
mbieblI can't tell you more, sorry12:00
Keybukthere's nothing about Upstart that would cause kill -9 1 to not work12:00
Keybukif kill isn't working, you have a kernel problem12:01
Keybuk(which was implied by you saying you were using LXC, I realise)12:01
twbKeybuk: my host OS is 10.04 (running stock lucid 2.6.32) -- could I fix this with a different / newer kernel?12:01
Keybukno idea12:01
twbOr are you saying that "LXC is just wrong"?12:02
KeybukI was ;)12:03
twbGrmph12:04
KeybukI'm not a fan12:04
twbmbiebl: in case you don't know, lxc is basically openvz cleaned up and accepted into mainline12:05
twbWell, lucid doesn't boot if /var/run isn't a tmpfs, and lxc doesn't detect the guest halting if /var/run is a tmpfs, so it looks like I'll have to give up and use KVM, taking the performance hit that emulating an entire peecee for every daemon implies12:07
twb(If lxc doesn't see the domU pid 1 terminate, it does a dirty hack by watching /var/run/utmp for a restart event, but it can't see it when there's a tmpfs mapped over the top.)12:08
Keybukthat sounds like a bug in lxc12:09
twbmjt (in #lxcontainers) said: well, the prob can be solved in two places.  Either proper (for a container) sys_reboot in kernel (this is what halt -f is using), or in init.  So far kernel folks tells us "it can be done in userspace" (in init), and init folks say "kernel is wrong".12:12
twbmjt said -9 might be special12:20
twbSo I just tried everything from -1 up, and -8 worked12:20
twbSo I *think* I can just edit /etc/init.d/S90halt to call "kill -8 1" instead of "halt -f"12:21
Keybukif kill -9 1 is being treated as special, it's being treated as special by the kernel ;-)12:24
Keybukso again, the fix for that should go in the kernel12:24
twbI guess so.  Sorry for losing my temper.12:24
Keybukso the discord is because when you write software on any platform, you agree to a contract between yourself and things like the kernel for how you should operate12:25
Keybuksomething like init is even more important, it has special behaviours that aren't granted to ordinary processes12:25
Keybukso the contract (ie. API/SDK) between you and the kernel is very important12:25
Keybukthe reason init authors tend to dislike things like LXC is that it makes the kernel break that contract12:26
Keybukand the LXC folks seem to think it's our fault12:26
Keybuknow, if container authors could agree on an alternate contract12:26
Keybuk*and* provide ways for init to be told which contract we should use12:27
Keybukthings would be better12:27
Keybukbut historically they've been unwilling to do that12:27
twbI suppose they argue the whole point is you shouldn't be able to tell you're in a container12:27
Keybuk(OpenVZ, LXC, etc. have all randomly changed their APIs and which kernel features they support between releases)12:27
Keybukand right, they argue that a call to tell whether you're in a container defeats the point12:27
Keybukand our counter-argument is that we *CAN* tell we're in a container12:27
Keybukwe can tell because the kernel is not obeying its interface contract to userspace12:28
twbhaha12:28
Keybukthey can't have their cake and eat it12:28
Keybukif a container should be invisible, it should also be invisible to init12:28
Keybukif init should handle containers specially, so should all user space processes be able to12:28
twbOK, I think I have it actually working12:36
twbNow a kill -2 to lxc-start (or upstart) from the dom0 will make upstart see a ctrl-alt-del, and at the end of that, /etc/init.d/reboot (or halt) will kill -SEGV 1, which lxc-start "sees" and handles the cleanup of stuff above upstart.12:37

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