=== robbiew is now known as robbiew_ [16:33] How 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:36] there is no such thing as an "order" [16:36] it's an event-driven system [16:36] that means the boot can be different every time [16:37] Well, 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] no, there's no "dependency tree", it's an event based system [16:37] (A, B, C) first, then D (due to dependency on B), then (E, F) (which require C, D) to be started, etc... [16:38] Upstart is an event-based system [16:38] Apparently I understand this even less than I thought. So what happens when I boot my system? How do services get started? [16:38] it does not do dependencies [16:41] creature, events are raised. services are defined as starting on those events, or stopping on others. [16:42] jobs starting emit their own events. [16:43] OK. 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:44] The best that I can determine is that this is some weird interaction between cryptsetup, udev, and upstart. [16:44] But I have no idea how to debug this. [16:45] My 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:46] i don't think dbus is required for any of that, is it? [16:46] dbus shouldn't start until tmp is mounted. [16:47] I 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:49] Okay, I'm going blind with the cryptoloop stuff, because I've never used it. [16:49] I'm assuming it has some initrd components that should do the work. [16:49] This 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:50] Actually, this is post initramfs isn't it [16:50] Yes, it is, AFAIK. [16:51] The 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] yeah [16:51] cryptsetup in Ubuntu is busted [16:52] The 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] For 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. === robbiew_ is now known as robbiew === robbiew is now known as robbiew_ [17:10] Keybuk, ping. [17:11] magcius: what's up? [17:11] Keybuk, creature's having some issues with Upstart and encrypted disks. [17:11] don't care [17:12] cryptsetup is busted in Upstart [17:12] err [17:12] in Ubuntu [17:12] Is that a known bug? [17:12] yes [17:12] I did try and tell magcius that you were aware of this, but... well. He's an eager beaver. [17:12] and nothing to do with me [17:12] Keybuk, okay. [17:12] I'd be interested in seeing a link to "known busted", as I've not come across anything saying that so far. [17:12] Keybuk, so it's the rules? [17:12] "the rules" ? [17:12] as far as I know, cryptsetup is a piece of crap that nobody should ever expect to work :p [17:13] I looked at it, I barfed [17:13] Yes. It's OpenBSD code IIRC [17:13] as far as I'm concerned, if I ever have to care about it, I shall solve it by removing it from the archive [17:14] so what do you recommend for encrypted disks? [17:14] I don't recommend encrypted disks [17:14] I think it's silly [17:19] So. I don't want dbus to start until my encrypted disks are started. How do I express this in upstart? [17:21] dbus already won't be started until local filesystems are mounted [17:21] which will include your encrypted disks if they're listed in /etc/fstab as mounted on particular mount points [17:22] what is the ubuntu-approved solution for secure storage then? [17:22] Md: this isn't an Ubuntu channel [17:22] that question isn't appropriate here [17:22] ask people in #ubuntu-devel [17:22] what is the Keybuk-approved solution for secure storage then? :-) [17:22] Md: Don't Do That Then [17:24] OK, 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] depends whats in your fstab [17:25] is /tmp in your fstab? [17:25] It is. [17:25] /dev/mapper/ctmp /tmp/ ext4 defaults,bootwait 0 0 [17:25] then mountall will wait for it [17:25] you don't need the bootwait technically [17:26] It should be ext2, but as the hang is on swap creation I don't think that's the problem. [17:27] Oh, wait, I've got a new theory. [17:28] I'm going to test this, but if I'm right you'll love it. [17:29] Fuck yes. I am right. That took some thinking. [17:30] The problem: cswap and ctmp have random keys, because you never need to decrypt them, right? They had /dev/random as their keyfile. [17:30] /dev/random is high-quality randomness. It blocks if sufficient entropy is missing. [17:30] The solution: replace /dev/random with /dev/urandom. [17:31] so you were starving your entropy pool? [17:32] It was just after boot. There wasn't much entropy by that point. [17:32] The keyboard-slapping was giving it enough entropy to unblock. [19:10] What distinguishes upstart from runit? [19:11] I'm trying to choose between the two for an appliance project in which fast booting is highly desirable. [19:19] I've never heard of runit. [19:20] It's another sysvinit replacement with service supervision. [19:20] http://smarden.org/runit [19:21] MattCampbell, what's the advantage of runit over sysv? [19:22] As long as it doesn’t run as pid 1, it can’t reap parentless child processes. [19:23] magcius: Services are restarted if they crash. Each service gets a consistent, clean process state (environment, open files, etc.). Services are started in parallel. [19:24] how does runit help eliminate race conditions during boot? [19:24] if everything is started in parallel, how do you wait to start things until they *can* be started? [19:25] it has service dependencies, and there's a sequential initialization stage (a single shell script) before services are started in parallel. [19:25] My guess was that upstart's developers knew about runit and had some reason for developing upstart anyway. [19:27] how does a job depend on the existance of a device? [19:28] oh, good question [19:28] upstart supports that? [19:30] that's the entire point of upstart's existence [19:31] Oh, 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] it's all about "events" [19:31] Perhaps 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:32] partly [19:32] if you have an event-based system [19:32] you can eliminate race conditions [19:32] you can eliminate the need for busy loops [19:32] you can eliminate the need for sleeps [19:32] and you can start everything in parallel [19:32] and bits carry on when they can [19:32] so you end up faster as a result [19:33] Thanks for the clarification. [19:36] I 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.