/srv/irclogs.ubuntu.com/2009/12/21/#upstart.txt

=== robbiew is now known as robbiew_
creatureHow can I find out the order in which upstart processes are run? Is there a tool that will draw me a tree or print me a summary? 16:33
Keybukthere is no such thing as an "order"16:36
Keybukit's an event-driven system16:36
Keybukthat means the boot can be different every time16:36
creatureWell, there's a dependency tree, right? Even if you can't give a deterministic order, you should be able to show various 'levels'. 16:37
Keybukno, there's no "dependency tree", it's an event based system16:37
creature(A, B, C) first, then D (due to dependency on B), then (E, F) (which require C, D) to be started, etc...16:37
KeybukUpstart is an event-based system16:38
creatureApparently I understand this even less than I thought. So what happens when I boot my system? How do services get started? 16:38
Keybukit does not do dependencies16:38
wasabi_creature, events are raised. services are defined as starting on those events, or stopping on others.16:41
wasabi_jobs starting emit their own events.16:42
creatureOK. Well, let me ask another question, which might seem a little off-topic. http://pastebin.com/m1c51bf9c contains the details; in summary, I'm having trouble getting my encrypted disks to start without user intervention at boot. 16:43
creatureThe best that I can determine is that this is some weird interaction between cryptsetup, udev, and upstart. 16:44
creatureBut I have no idea how to debug this. 16:44
creatureMy current hypothesis is that udev (or dbus) is trying to do something, and because there's no /tmp yet there's no dbus-socket, which is causing it. But I don't know how to test this, or alter my boot 'order' (or event triggers) to see if that helps. 16:45
wasabi_i don't think dbus is required for any of that, is it?16:46
wasabi_dbus shouldn't start until tmp is mounted.16:46
creatureI don't know how to find out at what point dbus attempts to start.  I wouldn't be surprised if Ubuntu presumes that /tmp is available as soon as / is. 16:47
wasabi_Okay, I'm going blind with the cryptoloop stuff, because I've never used it.16:49
wasabi_I'm assuming it has some initrd components that should do the work.16:49
creatureThis isn't cryptoloop, it's dm-crypt. And I think it's working via upstart too. There's a cryptdisks-enable.conf in /etc/init, at least. 16:49
wasabi_Actually, this is post initramfs isn't it16:50
creatureYes, it is, AFAIK. 16:50
creatureThe key things to know are: there's a tool called cryptsetup that does the hard work. Neither of these partitions should require user input. cryptsetup handles the encryption, and makes a /dev/mapper device available, which is then mounted as usual through the fstab. (There's an /etc/crypttab for the crytpo setup.) 16:51
Keybukyeah16:51
Keybukcryptsetup in Ubuntu is busted16:51
creatureThe crypttab says "Partition /dev/sdaX should be used as swap," which doesn't require a filesystem, so it's essentially transparent redirection. System writes to swap device, dm-crypt handles encrypting/decrypting the data that's written to disk. 16:52
creatureFor tmp it's pretty much the same, but it says "This is a tmp filesystem", so it creates a new ext2 filesystem on it at boot. 16:52
=== robbiew_ is now known as robbiew
=== robbiew is now known as robbiew_
magciusKeybuk, ping.17:10
Keybukmagcius: what's up?17:11
magciusKeybuk, creature's having some issues with Upstart and encrypted disks.17:11
Keybukdon't care17:11
Keybukcryptsetup is busted in Upstart17:12
Keybukerr17:12
Keybukin Ubuntu17:12
magciusIs that a known bug?17:12
Keybukyes17:12
creatureI did try and tell magcius that you were aware of this, but... well. He's an eager beaver. 17:12
Keybukand nothing to do with me17:12
magciusKeybuk, okay.17:12
creatureI'd be interested in seeing a link to "known busted", as I've not come across anything saying that so far. 17:12
magciusKeybuk, so it's the rules?17:12
Keybuk"the rules" ?17:12
Keybukas far as I know, cryptsetup is a piece of crap that nobody should ever expect to work :p17:12
KeybukI looked at it, I barfed17:13
magciusYes. It's OpenBSD code IIRC17:13
Keybukas far as I'm concerned, if I ever have to care about it, I shall solve it by removing it from the archive17:13
magciusso what do you recommend for encrypted disks?17:14
KeybukI don't recommend encrypted disks17:14
KeybukI think it's silly17:14
creatureSo. I don't want dbus to start until my encrypted disks are started. How do I express this in upstart? 17:19
Keybukdbus already won't be started until local filesystems are mounted17:21
Keybukwhich will include your encrypted disks if they're listed in /etc/fstab as mounted on particular mount points17:21
Mdwhat is the ubuntu-approved solution for secure storage then?17:22
KeybukMd: this isn't an Ubuntu channel17:22
Keybukthat question isn't appropriate here17:22
Keybukask people in #ubuntu-devel17:22
Mdwhat is the Keybuk-approved solution for secure storage then? :-)17:22
KeybukMd: Don't Do That Then17:22
creatureOK, well, 'status dbus' shows me that its status is 'stop/waiting'. So much for my dbus-wants-/tmp-but-doesn't-have-it-yet theory. 17:24
Keybukdepends whats in your fstab17:24
Keybukis /tmp in your fstab?17:25
creatureIt is. 17:25
creature/dev/mapper/ctmp    /tmp/    ext4    defaults,bootwait    0    017:25
Keybukthen mountall will wait for it17:25
Keybukyou don't need the bootwait technically17:25
creatureIt should be ext2, but as the hang is on swap creation I don't think that's the problem. 17:26
creatureOh, wait, I've got a new theory. 17:27
creatureI'm going to test this, but if I'm right you'll love it. 17:28
creatureFuck yes. I am right. That took some thinking. 17:29
creatureThe problem: cswap and ctmp have random keys, because you never need to decrypt them, right? They had /dev/random as their keyfile. 17:30
creature/dev/random is high-quality randomness. It blocks if sufficient entropy is missing. 17:30
creatureThe solution: replace /dev/random with /dev/urandom. 17:30
Keybukso you were starving your entropy pool?17:31
creatureIt was just after boot. There wasn't much entropy by that point. 17:32
creatureThe keyboard-slapping was giving it enough entropy to unblock. 17:32
MattCampbellWhat distinguishes upstart from runit?19:10
MattCampbellI'm trying to choose between the two for an appliance project in which fast booting is highly desirable.19:11
magciusI've never heard of runit.19:19
MattCampbellIt's another sysvinit replacement with service supervision.19:20
MattCampbellhttp://smarden.org/runit19:20
magciusMattCampbell, what's the advantage of runit over sysv?19:21
ionAs long as it doesn’t run as pid 1, it can’t reap parentless child processes.19:22
MattCampbellmagcius: Services are restarted if they crash.  Each service gets a consistent, clean process state (environment, open files, etc.).  Services are started in parallel.19:23
Keybukhow does runit help eliminate race conditions during boot?19:24
Keybukif everything is started in parallel, how do you wait to start things until they *can* be started?19:24
MattCampbellit has service dependencies, and there's a sequential initialization stage (a single shell script) before services are started in parallel.19:25
MattCampbellMy guess was that upstart's developers knew about runit and had some reason for developing upstart anyway.19:25
Keybukhow does a job depend on the existance of a device?19:27
MattCampbelloh, good question19:28
MattCampbellupstart supports that?19:28
Keybukthat's the entire point of upstart's existence19:30
MattCampbellOh, I thought the point of upstart was to start services in parallel for faster boot, and restart services if they crash, like runit.  But that was just my assumption.  And the upstart home page said nothing about devices.19:31
Keybukit's all about "events"19:31
MattCampbellPerhaps I misunderstood in part because I observed how fast Ubuntu 9.10 and Chromium OS can boot, and thought that was what upstart was all about.19:31
Keybukpartly19:32
Keybukif you have an event-based system19:32
Keybukyou can eliminate race conditions19:32
Keybukyou can eliminate the need for busy loops19:32
Keybukyou can eliminate the need for sleeps19:32
Keybukand you can start everything in parallel19:32
Keybukand bits carry on when they can19:32
Keybukso you end up faster as a result19:32
MattCampbellThanks for the clarification.19:33
MattCampbellI haven't yet chosen a base distro for my current project (a server appliance, with some unusual requirements), but I wanted to decide on an init system first.  I'll definitely use upstart.  Thanks for being patient with a newcomer.19:36

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