/srv/irclogs.ubuntu.com/2009/10/13/#upstart.txt

mugwumpsadmac2: re: committing printf's, doesn't bzr have an equivalent of 'darcs record' / 'git add -p'00:43
mugwump?00:43
mugwumpassuming upstart is in bzr..00:43
sadmac2mugwump: its a bit too interleaved for that to be easy00:48
mugwumpI tend to rebase a lot with git to preen my changes down00:48
mugwumpit's a longer path, but hugely satisfying once you've travelled a while down it...00:49
mugwumpeg, knowing that no change breaks the test suite makes finding regressions pretty easy00:50
ionYeah, i constantly use rebase -i for unpushed changes.00:52
sadmac2ion: any idea why the macruby interpreter rakefile would run dtrace01:00
sadmac2?01:00
ionsadmac: I have no idea.01:41
ionSomething to do with unit tests maybe?01:42
sadmac2ion: something to do with probe points I think01:42
DavieyWhat is the best way of having an upstart job depends/requires on another process, that is still sysv?09:17
DavieyAm i correct in saying that upstart checks "start on starting xyz" sagainst upstart jobs only?09:18
DavieyAdditionally, does anyone have an example of a job that sources variables from a conf file, for the exec line?09:22
Davieyis it as trival as you would expect?09:23
=== h\h is now known as haraldh
=== robbiew_ is now known as robbiew
sadmacDaviey: you can add "initctl emit" lines to your sysv scripts to make them emit events, which offers upstart a way to interact with them14:59
ionkeybuk: A random thought about prioritizing fscks and mounts: with the current system, if we’re already running fsck for /notimportant and then a partition for /important on the same device appears, it’s not possible to get /important queued any sooner than after the /notimportant check. How about this instead: don’t lock anything and start everything in parallel, but for each device, have only one fsck (the one deemed most important at any moment) running ...16:30
ion... with normal ionice prioritiy, and ionice all other instances ‘idle’. If we’re running a fsck for /notimportant and /important appears, the fsck for /notimportant would be changed to idle priority until the check for /important finishes.16:30
ionkeybuk: I take it that change would be too big for karmic at this point?16:37
ionif i came up with a patch, say, today :-P16:37
Keybukcan you change the io priority of other processes?16:40
Keybukif you can make the patch work, I can merge it16:40
Keybukstill have the fsck progress patch to merge16:41
ion/usr/bin/ionice has a -p PID parameter, so it should be possible.16:42
Keybukneat16:49
sadmaceither something's wrong with my git tree, or somethings wrong with cscope, or sys_ioprio_set is weird16:52
sadmacKeybuk, ion: sys_ioprio_set(int which, int who, int ioprio)16:52
sadmacI could disambiguate that a bit if I could find the actual definition16:53
sadmac... is it written in ASM?!16:55
sadmacno, its just missing...weird...16:58
Keybukit's probably under arch/17:03
sadmacKeybuk: I've grepped. its nowhere17:05
sadmacKeybuk: every entry.S mentions it. syscalls.h mentions it. No source file mentions it.17:05
ionThe ioprio_set manpage is clear enough. :-)17:07
Keybuksadmac: fs/ioprio.c:75 no?17:08
sadmacKeybuk: ah. figured it was something like that.17:09
sadmacworthless macros making the world a better place.17:09
ionkeybuk: Is a simple check for (mnt->tag > TAG_OTHER) a good rule for prioritizing running fsck instances?17:27
Keybukion: yes17:27
=== tclineks is now known as lpdn
=== lpdn is now known as tclineks
=== notting_ is now known as notting
=== pocek_ is now known as pocek
TomJaegerBug #439138 is getting to be real frustrating.  Could someone explain what the deal with console owner is?23:15
Keybukok23:19
Keybukit's about time I wrote this down23:19
Keybukand please do feel free to tidy up what I write and paste it liberally ;)23:19
Keybukin Linux, we have consoles23:20
Keybukbut really we mean Virtual Terminals (VTs)23:20
Keybukand we have TTYs too23:20
Keybuknot to mention Pseudo-Terminals23:20
Keybuk(PTYs)23:20
Keybukit's all a bit of the kind of jumble sale you get after 40 years of different solutions to different problems23:20
Keybukwe can lump them together under the description "terminals" for the next bit23:21
Keybukwe also have processes23:21
TomJaegerokay, so far so good23:23
=== robbiew is now known as robbiew-afk
Keybuknow, processes have a lot of odd little details23:26
Keybukthey have a parent23:26
Keybukthey have a session23:26
Keybukand a session has a foreground process group23:26
Keybukand a background process group23:26
Keybuknow Stevens devotes an entire chapter for this23:27
Keybukand nobody but me apparently understands it ;)23:27
Keybuk(and hopefully the guy who maintains the kernel side)23:28
Keybukbut it works something like that23:28
Keybukeach process is part of a session23:28
Keybuka process may begin a new session by calling setsid()23:28
Keybukevery process that init creates is in its own session23:28
Keybukthe process is also then the leader of the foreground process group of that session23:28
Keybuknew processes are also in that session23:28
Keybukand in that process group23:28
Keybukunless otherwise placed into a new process group23:28
Keybuk(setpgrp)23:29
Keybukany new process group is a background process group23:29
Keybukso now, you have a bunch of sessions23:29
Keybukeach session has a bunch of process groups, one of which is the foreground process group23:29
Keybukeach process group has a bunch of processes, one of which is the leader23:29
Keybukwith me so far?23:29
TomJaegerokay23:29
Keybukright23:30
Keybukso this all has to do, fundamentally, with terminals23:30
Keybukand who gets the signals23:31
Keybukwhen the leader of the foreground process group of a session opens a terminal device (without O_NOCTTY) that becomes the CONTROLLING TERMINAL of that process group23:31
Keybuk(in fact of that session)23:31
Keybukthe terminal and the session become bound to each other23:32
Keybukyou can fake this another way by opening a terminal device without O_NOCTTY (or having one passed to you) and then calling the TIOCSCTTY ioctl23:32
Keybukok23:33
Keybukso23:33
Keybukterminals, controlling terminals and processes23:33
Keybukhere's where this gets fun23:33
Keybukif the controlling terminal is hung up, SIGHUP is sent to the foreground process group23:33
Keybukif ^C is pressed on the controlling terminal, SIGINT is sent to the foreground process group23:33
Keybukif ^Z is pressed on the controlling terminal, SIGTSTP is sent to the foreground process group23:33
Keybuk(you're getting the idea here I guess)23:34
TomJaegeryup23:34
Keybukso this is how the relationship between magic key presses and signals gets established23:34
Keybukshells care about this a lot23:34
Keybuk(and yes, when you use & that becomes a background process group :p)23:35
Keybuk(and when you use | they are all in the same process group)23:35
Keybukanyhoo23:35
Keybukonwards23:35
Keybuknow23:35
Keybukthis controlling terminal business applies to all terminals23:35
Keybukwhether they be true terminals (which linux doesn't have)23:35
Keybukor virtual terminals23:35
Keybukor pseudo terminals23:36
Keybukso this is as true for your ssh login as VT123:36
TomJaegerokay23:36
Keybukyou can always access your *controlling terminal* using /dev/tty23:36
Keybukit's a badly named device node23:36
Keybukit may also be called /dev/ttyS0 or /dev/pts/4 etc.23:36
Keybukso right23:37
KeybukLinux has a bunch of virtual terminals23:37
Keybukthese are the things we think of when we say "console" but we're using that wrong23:37
Keybukvirtual terminals behave just like ordinary terminals23:37
Keybukthey can be the controlling terminal for a process group23:37
Keybukbut, unfortunately, stacked on top is the linux vt API23:38
Keybuk(they didn't think to make it separate)23:38
Keybukso the stuff to set fonts23:38
Keybukto place it in raw or graphics mode23:38
Keybukto create new vts23:38
Keybukto switch vts23:38
Keybuketc.23:38
Keybukis all loaded into the tty api23:38
Keybukso, in order for X to function, it needs a VT23:39
TomJaegerright23:39
Keybukand it needs access to that VT in interesting and familiar ways to place it into raw and graphics mode23:39
Keybukand so on23:39
Keybukit also needs to know if the *current VT* is switched23:39
Keybukso it opens the VT device it wants (/dev/tty7)23:39
Keybukand that becomes its controlling terminal23:39
Keybukso if you were to delete VT7, X would get SIGHUP :)23:39
Keybuknow, on VT1-6 you have getty23:40
Keybukon VT8 you have usplash23:40
Keybukand so on23:40
Keybukthis is all fine and dandy23:40
Keybukexcept there's this last mystical piece23:40
Keybuk/dev/console23:40
Keybuk/dev/console is, like /dev/tty, a fake device23:40
Keybukit points at the currently active VT23:41
Keybukwhatever that is23:41
Keybukbut it *behaves* like a terminal in its own right23:41
Keybuk(whereas /dev/tty just behaves as a proxy for the underlying terminal)23:41
Keybuknow, Upstart has a few knobs to customise the standard input, output & error file descriptors23:41
Keybuknormally it just starts all jobs with them as /dev/null23:41
Keybukbut for *emulation of sysvinit* it has two other options23:42
Keybuk 1. set them to /dev/console23:42
Keybuk 2. set them to /dev/console and issue the TIOCSCTTY ioctl()23:42
Keybuk(console output, console owner)23:42
Keybuknow, if your current VT is 7 (X)23:42
Keybukand you start a job that has console owner in it23:42
Keybukthe new process will *take the terminal away from X*23:43
KeybukX gets SIGHUP23:43
Keybukand either hits 100% CPU or crashes23:43
Keybukso this is clearly BAD23:43
Keybukthe problem really is that things need a "console" at all23:44
Keybukjobs that require interaction should DO IT THEMSELVES23:44
Keybukthey should open a VT, switch to it, and ask there23:45
Keybukor they should use usplash to do it23:45
Keybukor they should use X23:45
TomJaegerhmm23:47
TomJaegerthis (switching to an unused VT, asking for a pass, and then switching back) doesn't sound too hard23:50
Keybuk"start usplash"23:50
Keybukyou can do that under X23:50
Keybuk(please don't try it unless you have an Intel card right now <g>)23:50
TomJaeger"start usplash" doesn't do anything here (i965)23:52
Keybukreally?23:54
Keybukthat's odd :)23:54
TomJaegerI get this: usplash stop/pre-start, process 235723:55
TomJaegerbut either way, that doesn't seem to be an option right now if it breaks on non-intel hardware.23:56
Keybukthat's a bug we have to fix for release anyway23:58

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