/srv/irclogs.ubuntu.com/2010/02/17/#upstart.txt

Alpha1650Hi. I have a little question about upstart: As I understood, "console output" means that this task uses the console for input and output. What happens if two tasks need console for in- and output? Does the second have to wait until the first ended? Or can they run both simultaneously? Then what happens if both want to read something from console the same time?01:19
=== h\h is now known as haraldh
=== Md_ is now known as Md
Alpha1650Hi. I have a little question about upstart: As I understood, "console output" means that this task uses the console for input and output. What happens if two tasks need console for in- and output? Does the second have to wait until the first ended? Or can they run both simultaneously? Then what happens if both want to read something from console the same time?10:52
KeybukAlpha1650: they interleave and steal characters from each other10:54
Keybukdepends who's first to call read()10:54
Alpha1650Keybuk: Okay, that doesn't sound very good. I'm having this ubuntu issue here with mountall and cryptsetup interleaving and breaking the splash and making it a gamble whether the machine will boot or not. I just set mountall's console to "none" what seems to make the machine bootable with splash disabled.11:00
KeybukAlpha1650: on lucid?11:00
Alpha1650Keybuk: Karmic.11:00
Keybukah, yeah11:00
Alpha1650Keybuk: Are there any ideas/chances/intentions to solve the interleaving issues with upstart or is this what the apps will have to solve themselves?11:00
KeybukI don't think it's up to Upstart to arbitrate the console11:02
Keybukthere are already better ways to do that11:02
Keybuke.g. Plymouth11:02
Alpha1650Keybuk: Do you know what mountall needs the console input for? As far as I can see it's first duty is to mount the filesystems when their devices come up. What does it need console (especially input, output might be for fsck or so) for?11:07
cooloAlpha1650: fsck also needs input on errors11:09
Keybukright, fsck error recovery, etc.11:17
Alpha1650Keybuk: coolo: I see, but then this is really an uggly situation where some kind of syncronisation and queuing of console-input/output-events is necessary, no? Maybe something like "interaction_start()" and "interaction_stop()" where scripts can within do input and output that belongs together, for example the password prompt and the following input in cryptsetup. And other tasks reaching a interaction_start() have to wait until the o11:19
Keybukactually it's more than that11:20
Keybukmultiple cryptsetup devices might need to ask for the passphrase at the same time11:20
Keybukyou need something for everything during boot to talk to that deals with the screen11:21
Keybukwhich might be a plain text console or a graphical console11:21
Keybukas I said, Plymouth solves this already11:21
Alpha1650Is there a project site for Plymouth?11:23
Alpha1650I don't understand how Plymouth could solve the multiple tasks interleaving problem without syncronising at least their input11:24
ionKind of. Its API doesn’t seem to allow multiple clients to query things at once, with the user being able to switch focus between them. The API also doesn’t seem to provide asynchronous queries, so that you ask a question, get an answer handle, go do other stuff and get a message over a file descriptor with the handle and the user reply (which should be handled by the plymouth client library by calling a callback you provided when asking the question).11:24
Keybukion: huh? it's API allows exactly this11:25
ionThe latter issue already causes a problem with Upstart: there’s a user that consistently has his startup hang because Upstart just happens to say “didn’t find the device for a mount, what to do?” and blocks on the answer, although the device does appear very soon.11:25
ionkeybuk: Ok, i’ve misinterpreted it then. I didn’t take a good enough look at the plybootclient/whatever headers.11:26
ionIt didn’t seem to provide a way to integrate with an arbitrary main loop, instead it just seemed to provide a way to jump to its main loop until something happens, which isn’t good if you want asynchronous queries.11:28
Keybukplymouth's main loop uses epoll11:28
Keybukwhich is infinitely stackable11:28
Keybukthe mountall integration is a bit poor because I wrote it in a hurry11:29
Keybukneeded it in before Alpha/Feature Freeze11:29
Keybukcan fix it later as "bug fixing" :p11:29
ionYes, it wouldn’t be hard to make plymouth provide an API to do that. Just one function to provide plymouth’s epoll fd and another function to call from your main loop when there’s something on that fd. Perhaps it already does, i might have missed it when skimming through the API.11:30
Alpha1650Keybuk: you wrote on your blog that plymouth will not be used because it relies on kernel mode setting.11:30
ionalpha1650: Many months ago, in the context of another Ubuntu release?11:31
Alpha1650Months ago, yes. Sep 2009.11:31
ionThings change. :-)11:31
Alpha1650Yea, so this already changed. Good. (I have nvidia hardware that will not work with kernel mode setting I think.)11:32
KeybukAlpha1650: that's not what I wrote11:33
Alpha1650Keybuk: Then I misunderstood you. What did you write?11:33
Alpha1650Keybuk: Yea, I got causality wrong.11:35
KeybukAlpha1650: we didn't use plymouth in karmic because we already had usplash11:35
Keybukwhich could already do KMS (it turned out)(11:35
Keybukand there was a strong push to keep with usplash unless there was a truly compelling reason to switch11:35
Keybukespecially since plymouth wouldn't support non-KMS hardware11:36
Keybukfortunately it turned out there were some bugs in usplash that needed fixing11:36
Keybukand one of the key people who was pushing for keeping usplash got involved in fixing them11:36
Keybukand remembered how nasty and ugly the code was11:36
Alpha1650Keybuk: :D11:36
Keybukso I was able to push plymouth again for lucid with the key feature "it means you don't have to fix usplash again" :p11:37
ion:-)11:37
Keybukfor lucid, plymouth was accepted with no resistance11:37
Alpha1650Okay, so my hope can return, that Ubuntu will succeed this time in what it failed for the last 3 years: Making splash and dm-crypto work together properly.11:38
Alpha1650I really had no ubuntu install where dm-crypto and splash worked smooth. Always problems.11:39
Keybukthe release manager himself is caring a lot about cryptsetup11:39
Keybukand working actively on it11:39
Alpha1650:)11:41
Alpha1650So this issue will hopefully be fixed in the future. What about now? How can I make mountall work together properly with my crypto?11:41
Keybukit will be fixed in lucid11:45
Alpha1650Yea, but Lucid will be released in months. Shall I not turn my PC off and on again in that time? ;)11:45
Keybukthere's no plan for an update to karmic11:47
Keybukor, if you prefer, the update is lucid ;)11:47
Alpha1650Keybuk: Well, but until then a workaround for those people like me out there would be nice. You know the issue and know what's happening there. What would happen, if I set the "start on" of mountall from "startup" to the event when my /home-crypt-device was decrypted for example? cryptsetup does in no way depend on what mountall does, right? So why not let mountall depend on what cryptsetup does?11:52
Alpha1650This would maybe delay the mount for a short period of time but I'm sure everyone having this issue is willing to pay this "price" for the solution.11:52
Keybukthere isn't a workaround11:53
Keybuklike you say, it's broken11:53
Keybuka lot of work has gone into karmic to fix it11:54
Keybuknew packages11:54
Keybuknew integration11:54
Keybuketc.11:54
Keybuknone of this is trivial to backport to a stable release11:54
Keybukerr, into lucid11:54
Alpha1650Yea, sure. I do fully understand that there is no reasonable way to fix this by a package update. But to me (correct me if I got something wrong!) this seems to be a syncronisation issue, right? So my hope is that you can find a workaround that will make you loose some of your parallel execution brought by upstart but will ensure that those commands run in the right order and don't interfere.11:57
Keybukwe're not looking for a workaround for karmic at this point11:58
Keybukkarmic was released in October11:58
Keybukthe whole point of a six-monthly release schedule is that you're always working on the *new* release11:58
Keybukonce a release is out of the door, it doesn't tend to get updates11:59
Keybukthe update is the next release11:59
Alpha1650So if it doesn't work, it doesn't work and people should stop using their computer, go outside, enjoy sun (or snow in this case), return in 6 month and try again?12:00
Keybukupdates sometimes break a minority of users12:01
Keybukit's a fact of life12:01
Keybukthis is one of the reasons we recommend backing up a computer before upgrading to a new release12:02
Keybukjust in case the new release has a critical regression for you12:02
Keybukobviously we will do everything we can to fix the regression12:02
Keybukand, especially if it affects a large number of users, or is security-related, even do an update to the release12:02
Keybukbut we can't always do that12:03
Keybuksometimes the fix is so large or fundamental that it has to be "sorry, we'll have that fixed in the next release"12:03
Alpha1650Yea, I have my old install around here, so the backup exists. But I like karmic, so ...12:03
Keybukthat's another reason we have the LTS releases12:04
Keybukthey're a slower, more stable cycle for the kinds of users who can't risk a little downtime12:04
Keybukor a little manual hacking12:04
Keybukand we *do* do big stable updates for them12:04
Alpha1650Well, as I said, I see that fixing this cleanly would be a lot of work.12:04
Keybuke.g. we've not long released 8.04.4 - another update to hardy12:04
Alpha1650But I'm disappointed that there is absolutely no "hacking workaround" for this issue. That's what I don't understand.12:05
KeybukAlpha1650: I don't know cryptsetup well enough12:05
Alpha1650No package update or so, just a "howto live with this bug if you have it".12:06
KeybukI've heard of people hacking their crypttab so that all of the passphrases are asked for in the initramfs12:06
Alpha1650Keybuk: Yea, exactly such things!12:06
Keybukbut such things tend to be different for every person12:06
Alpha1650Already thought about this but couldn't find the options yet.12:06
Keybukit could take a developer a month to research the issue and write a howto12:06
Keybukthat's a third of the development time of lucid!12:06
Alpha1650:P12:06
Keybukit could even mean the bug never gets fixed for lucid12:06
Keybukbecause the only developer who knows enough spent their entire time worrying about the bug in karmic12:07
Keybuknow, often in the process of fixing a workaround is made obvious12:07
Keybukbut in this case, the bug is "we got this completely wrong" and the fix is "redo it all from scratch"12:07
Keybukthus there's no real obvious workaround12:07
Alpha1650No, the crypttab-thing you talked about is the kind of workaround I was looking for.12:08
Alpha1650Dirty but useful.12:08
Keybukso try that12:08
Keybukthe bug reports are probably a useful source of ideasa12:08
Alpha1650is initctl emit the way to emit signals within upstart tasks?12:13
Alpha1650Or are there other ways?12:13
Keybukinitctl emit is the way to emit events12:14
Alpha1650Okay, thank you.12:14
Alpha1650Keybuk: Is mountall the one who shuts down the splash to do fsck?12:15
KeybukAlpha1650: mountall logs to the splash12:15
Keybuknot sure why the splash would vanish12:15
Alpha1650Keybuk: Hm, okay. Something is stopping splash and then the fsck output appears ...12:17
acemowhere should i place a new upstart script(i want it to be executed at start up)?13:39
Keybukacemo: /etc/init13:43
Alpha1650Keybuk: I found "my own little workaround" for the ubuntu mountall-cryptsetup issue: - disable splash screen (as this breaking and reenabling it during boot is quite annoying) - I copied the "cryptroot"-script from initramfs, named it "crypthome" and modified it in a way that it runs directly before cryptroot in initramfs and decrypts the /home. This makes booting a fast and reliable thing again. :)13:48
Alpha1650Thank you all for your help in answering my questions, especially Keybuk.13:48
acemoI have this script http://pastebin.com/m23288b88 at /etc/init/spawn-fcgi-php but it seems to be not getting started. What am i doing wrong?13:54
plautrbaacemo: only 1 "start on" stanza is accepted and you have to rename your job file to have ".conf" suffix14:00
acemoplautrba: thanks, that did the trick =)14:02
acemowould using exec sudo -u username echo 'bla' be the right way to let upstart run a program as a different user?14:09
plautrbaKeybuk: upstart-0.6.5.tar.bz2 is missing. It is intended?15:01
plautrba*Is it15:01
Keybukyes15:03
plautrbaok15:04
Keybukwith libnih out, there's no real difference between the sizes15:04
Keybukand the .tar.gz is more widely accepted15:04
plautrbajust for sure15:05
sadmac2plautrba: why did you update to 0.6.5? the cvsbot hasn't even created a libnih repo yet.15:34
plautrbasadmac2: it's prepared in devel branch15:34
plautrbaf13 was branched out yesterday15:34
sadmac2plautrba: we still can't build it anywhere15:35
plautrbasadmac2: it's not tagged yet15:36
sadmac2plautrba: meh. fair enough :) I think we'll want it for F13 too. Its a minor enough update that we can put it in.15:37
plautrbasadmac2: sure, f13 is goal, but you can check it in devel branch now15:37
plautrbasadmac2: i've figured out that libnih.spec really needs %define _filter_GLIBC_PRIVATE 115:40
plautrbabut libtool-2.2.6a-rpath.patch is not necessary15:40
sadmac2plautrba: I didn't pull either out since the package was reviewed. Figured I'd do it as I checked them in.15:41
sadmac2plautrba: something about the move from /usr/lib{,64} to /lib{,64} must've made the libtool thing go away.15:41
plautrbasadmac2: it's done with first sed in %build15:42
sadmac2plautrba: ah yes.15:42
=== Md_ is now known as Md
acemois using sudo and exec the correct way to run a service as a different user as root?21:18
nottingrunuser should work21:18
acemookay lets see if this works ^.^21:26
acemohmm nope21:27
acemothe part between script and end script.. can i put a normal shell script in there? like this.. http://pastebin.com/m39f4ca91 or is it a whole different sort of script?21:33
sadmac2acemo: yep, its just pumped through /bin/sh21:34
acemoaweasome!21:34
sadmac2acemo: I would use daemonize=false though, so you don't need to mess with expect stanzas21:34
sadmac2acemo: and I'd exec it21:35
sadmac2acemo: and move the chmod to post-start21:35
acemoohh great, ubuntu doesn't has runuser21:39
acemohttp://pastebin.com/m4ab0da0 im so far now, i'll just have to find out how to get runuser on my ubuntu machine and am not sure about the post-stop part.. it has to be chmodded before someone gets to be able to see the site.21:51
nottinghuh. it's part of our coreutils package21:58
notting(our == fedora)21:58
acemonotting: runuser seems to be a stripped down version of su22:00
mxeyis runuser a tool supposed to be used to switch to another user before starting a daemon?22:04
mxeyOr what is the way to achieve that?22:05
acemomxey: not sure.. am trying to mess around with it now22:10
mxeyI think there should be an option for this, like there are options for chdir, chroot and umask.22:10
mxeybtw, I really like the oom option.22:10
acemooom option?22:11
mxeysetting the OOM killer "priority". Helpful for setting critical services like SSH to oom never.22:12
acemoi c22:13

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