/srv/irclogs.ubuntu.com/2010/03/16/#upstart.txt

edgecaselast hope, oh my!00:40
Keybukheh00:43
edgecaseok semantic question, on ubuntu mountall.conf takes care of mounting root fs rw, other fs, etc,00:43
Keybukyes00:44
edgecasebut, could it be assumed, that by definition, starting /sbin/init, means the rootfs is already mounted, possibly read-only?00:44
Keybukyes00:45
edgecasei mean either a monolithic kernel, or an initrd's pivot_root, or say lxc container starting...00:45
Keybuk        /* Sanity check, the root filesystem should be already mounted */00:45
Keybuk        root = find_mount ("/");00:45
Keybuk        if (! root->mounted) {00:45
Keybuk                nih_fatal ("%s", _("root filesystem isn't mounted"));00:45
Keybuk                exit (EXIT_ERROR);00:45
Keybuk        }00:45
Keybukeven mountall assumes that :p00:45
edgecaseso "start on startup" implies certain parts of FHS are available, yes?00:45
Keybukedgecase: it implies that the root filesystem is read-only00:45
Keybukwe tend to assume that means you have /bin, /sbin, /lib and /etc00:46
edgecasebut not /usr or /var00:46
Keybukright00:46
Keybukdefinitely not /usr, /var, /boot, /home, /proc, /sys, /dev, etc.00:46
Keybukalthough with Upstart, you can assume /proc and /sys are mounted00:46
edgecasei'm just pondering the sysctl.conf race problem00:47
Keybukand with recent kernels, /dev should be a devtmpfs00:47
Keybuksysctl.conf race problem?00:47
edgecaserace of setting things vs network interfaces coming up.  in Karmic for example00:47
edgecasethere's a couple launchpad bug IDs00:48
edgecasei drew out an elaborate map of the issues, but let me try and focus on one aspect00:48
edgecaseok, with sysctl parameters, there are some that affect parts of the kernel which is only compiled in (not a module)00:50
edgecasebut with many, it could be a module or compiled in, so there's no *right* place for sysctl.conf to be loaded00:50
Keybukright00:52
Keybukthis is why I keep trying to eradicate that silly directory00:53
Keybukbut people keep insisting I put it back :p00:53
edgecasei wonder if the whole sysctl paradigm doesn't work so well 00:53
KeybukI tend to think that, since we have the kernel source, changing a sysctl default is best done by changing the default in the kernel00:54
Keybukotherwise you have races like "the sysctl doesn't get set until after ssh is running and there's a security hole for a while"00:54
edgecasei'm thinking of network configs here, default isn't enough00:54
edgecasethe system needs to be configurable00:54
Keybuksure00:55
Keybukbut you can do one off-things like that with udev00:55
edgecasethere's a couple real problems with sysctl tho,00:55
KeybukSUBSYSTEM=="module", KERNEL=="i915", RUN+="echo 4 > /proc/sys/..."00:56
edgecasea NIC module could be compiled in, loaded by udev, or by the initrd... hard to put it's settings in one place had have it affect all 300:56
Keybukyou should still get module events for them00:57
edgecasewill that read sysctl.conf ?00:57
Keybukyou only don't get module events for built-ins with no parameters00:57
Keybukno00:57
edgecasehence the sticky issue00:57
Keybukand reading sysctl.conf 800 times during boot is out of the question, before you ask ;)00:57
edgecaseworkaround for the parameters i need is to set in /etc/network/interfaces and avoid the issue00:58
edgecasebut i'm also interested in the bigger picture of upstart00:58
edgecasemaybe just agree that sysctl isn't good for things not compiled-in00:59
KeybukI don't think there's a picture of sysctl in the upstart painting yet01:00
Keybukit's probably in the big white space off to the right with a doodle of someone's dog in it01:00
Keybuksorry, have to run now01:01
Keybukit's 1am here01:02
edgecaseyeah, that's ok, i can workaround for the network stuff  i need01:02
Keybukfeel free to mail suggestions for how this could work to the ML01:03
Keybukupstart is very much still under development01:03
Keybukso lots of things can be improved01:03
edgecased'oh!01:03
edgecasebe around tomorrow?01:03
Keybukyes, though earlier!01:04
Keybuknite01:04
edgecaseok01:04
edgecasethx01:04
edgecasehmm hostname.conf, nothing depends on it, 01:15
NoReflex hello! I'm having some problems with upstart in karmic server 64bit. It won't start postgresql. I tried http://superuser.com/questions/98702/how-to-make-postgresql-start-at-boot-time-in-ubuntu but it didn't work. can I remove upstart? I'm afraid to test it because the machine is at a remote location and if I mess it up I won't be able to connect to it anymore07:38
NoReflexI can start postgresql using /etc/init.d/postgresql-8.4 manually after login. There are links in /etc/rc*.d to postgresql init script but for some reason it isn't started automatically after reboot07:38
NoReflexnothing?08:21
elpargohi. I got a program that I want to "always be running" as it opens a http listener and waits for input "forever" 08:53
elpargoI'm not entirely sure if I should be doing an upstart script for it.08:53
ct529hi everybody .... I am having serious problems with upstart on ubuntu 910 64 bit .... it would not start CUPS at all ....09:54
ct529CUPS is properly configrued in /etc/rcX.d and in /etc/init.d ....09:54
NoReflexct529: I have the same problem with upstart on Karmic 64bit. On my machine it won't start postgresql server. I tried http://superuser.com/questions/98702/how-to-make-postgresql-start-at-boot-time-in-ubuntu without luck10:07
NoReflexct529: as a workaround you can use rc.local ... not perfect but at least it works...10:09
ct529NoReflex: how?10:11
ct529NoReflex: yes, I have the same problem with mysql and postgresql10:11
ct529NoReflex: what do you see when you run the command runlevel?10:12
NoReflexct529: what I did was to remove the links from /etc/rc*.d for postgres (sudo update-rc.d -f  postgresql-8.4 remove) and add the start command to rc.local10:13
ct529NoReflex: did you add it manually?10:13
ct529NoReflex: could you pleas elet me know what do you see when  you run the command "runlevel"?10:13
NoReflexct529: runlevel gives N 210:14
ct529NoReflex: so it works on your machine10:14
edgecaseelpargo, are you asking if you should write upstart script instead of sysVinit script?14:05
kimjuhello.. Is there some documentation on howto debug the bootup sequence? I'm getting bitten by bind9 trying to start (and failing) before the interfaces with ip-addresses that it is configured to listen-on / listen-on-v6 are brought up.14:17
kimju(this is happening on ubuntu karmic. someone else has reported it as bug: https://bugs.launchpad.net/ubuntu/+source/bind9/+bug/510587 )14:19
Keybukkimju: you should ask on #ubuntu about that14:21
Keybukas far as I'm aware, bind9 in ubuntu is still using a sysvinit script and hasn't been converted to an upstart config file14:21
kimjuKeybuk, ok, sorry. I just asked before you joined the channel if there is some documentation on how to debug the bootup sequence, as I'm getting bitten by that bug.14:22
Keybukboot with --verbose on the kernel command-line14:23
edgecaseKeybuk, top o' the morning to ya!14:34
edgecase hmm hostname.conf, nothing depends on it, 14:35
edgecaseso a race is possible with anything that uses hostname/utsname14:35
Keybukedgecase: hey14:37
Keybukah yes, it's still St Patrick's Month14:37
edgecasei will now continue the barrage!14:37
Keybukedgecase: can you think of anything that cares about the hostname? :p14:37
edgecasesyslog?14:37
Keybukit doesn't really depend on it14:38
Keybukit queries it for every log14:38
edgecaseah ok14:38
Keybukso if the hostname changes, it works just fine14:38
edgecaseaside, is there anything to graph the dependencies visually?14:38
edgecasewould make investigation easier14:39
edgecasefor rsyslog, if you log to remote host, might get unknown hostname for a bit?14:39
Keybukno, but there's no reason it shouldn't be easy to write something that makes dotty output14:40
edgecaseok will look at dotty14:40
Keybukfor rsyslog, if you log to remote host, you have to wait for the network to come up first :p14:40
Keybukand on the typical laptop system, that won't happen until a user logs in and unlocks the WPA key :p14:40
edgecaseyou noticed my nick is "edgecase" right?14:40
edgecasei tend to ignore "typical" cases :P14:41
Keybuk:)14:41
edgecaseanyhow i'll admit hostname is a trivial case14:41
edgecasei notice mountall.conf emits many variations of filesystems14:42
edgecaseis there a formal definition of those, that would allow splitting them up?14:42
edgecase"emits filesystem", does that mean root fs is read-write?14:42
edgecaseappologies if that info is published already14:43
edgecasehmm, having /var not a mandatory part of root fs, and yet having /var/run mounted on top, seems problematic14:50
edgecaseI question the original unix paradigm of "map everything to a file" for daemon .pid files, esp. if they are going to just map back to ram(disk)14:51
edgecasejust use unix socket or even abstract namespace one14:52
Keybukedgecase: did you do "man 7 filesystem" ?14:54
Keybukproblematic> not really14:54
Keybukit requires some juggling14:54
Keybukbut it works14:54
Keybukwe have /var/run before and after /var is mounted14:54
Keybukin fact, even as /var is mounting, /var/run is still present14:54
edgecaseok, juggling is acceptable if you don't drop the ball14:54
Keybuk*shrug*14:55
Keybukif the boot sequence drops any ball, you can't boot14:55
edgecasebadness++14:55
Keybukwhy?14:56
Keybukjust write things to be reliable14:56
edgecasei'll just assume "even as /var is mounting, /var/run is still present" is relable, moving on...14:57
Keybukyes14:57
KeybukI could teach a course on Theory of Atomic Operations in Operating Systems 101 :p14:57
KeybukI think about them a lot14:57
Keybukthe details:14:57
edgecaseoh thank god14:57
Keybuk  we always have a /var/run directory on the root filesystem, under the /var directory14:58
Keybuk  we mount /var/run there on the first pass14:58
Keybuk  then when it's time to mount /var, we actually mount it somewhere else (/dev/.var I think :P)14:58
edgecaseis there a mount --under option or something?14:58
Keybuk  we bind mount the current /var/run to /dev/.var/run14:58
Keybukso now it's available at both /var/run and /dev/.var/run14:58
Keybuk  we then move the /dev/.var mount to /var14:59
edgecaseall atomic?14:59
Keybukeach of those is atomic yes14:59
Keybuksince a mount() operation holds the VFS lock14:59
edgecaseooh, snap!14:59
Keybukmountinfo will show /var/run mounted twice14:59
Keybukwith different parent mounts14:59
Keybukif you unmount /var, for whatever reason, /var/run is still mounted under it15:00
edgecasei find no mountinfo or man 7 filesystem15:00
Keybukedgecase: are you on lucid?15:00
edgecasekarmic15:00
edgecasei guess i need to be bleeding edge to get bleeding edge15:00
Keybukah, I think I added that manpage in lucid15:00
edgecasei'll get lucid on a box shortly15:00
edgecaseso i can discuss current state of things15:01
Keybukmountinfo => /proc/self/mountinfo15:01
edgecaseah /proc/mounts on steroids15:01
edgecaseok so, what provides /proc and /sys, upstart, before running any scripts?15:02
KeybukI don't quite understand your question15:02
Keybukyou asked me what kind of trees apples, oranges and buses grow on :p15:02
edgecaseearlier you said assume /proc and /sys when running upstart15:03
Keybukyes15:03
edgecaseso what mounts them?15:03
Keybukinit15:03
edgecasebefore running any "start on startup" jobs?15:03
Keybukyup15:03
edgecaseok just getting my bearings15:03
KeybukUpstart uses /proc/self/fd to run shell scripts15:03
Keybukso it needs /proc mounted15:04
Keybukand since it's probably going to need /sys at some point soon, I figured I'd mount that too15:04
Keybuk/dev gets mounted by the kernel these days15:04
edgecaseis there a formal definition of state when "startup" event fires?15:04
edgecaseie "you get root /proc and /sys"15:04
edgecaseand "but don't assume /var and /usr etc"15:05
Keybukno written down one I guess15:05
edgecaseuse the source luke15:05
Keybukthe root filesystem is read-only15:05
Keybukyou have /proc and /sys15:05
Keybukyou probably have /dev15:05
edgecasereading source takes time tho15:05
Keybukyou have /bin, /sbin, /lib and /etc15:05
Keybukbut nothing else filesystem wise15:05
edgecaseaside, i'm thinking mountall should be broken up, it's a syncronisation point, which defeats some parallelism15:06
Keybukit isn't a synchronisation point15:06
Keybukthat's kinda the idea15:06
edgecasemake a dummy job with the same syncronisation properties for dumb legacy jobs,15:06
Keybukit replaces the shell script nightmares we had before that were15:06
edgecasebut let smart jobs pick off say just root fs being rw15:07
Keybukthey can15:07
Keybuk  on mounted MOUNTPOINT=/15:07
edgecasemountall emits events?15:07
edgecaseoh vfs emits mount events i'm guessing15:07
Keybukno, mountall emits them15:08
edgecaseback to upstart?15:08
Keybukyes15:08
Keybuklike filesystem for a start ;)15:08
edgecaseok, then back to all the emits in mountall.conf...15:08
edgecaseany definition what they mean?15:09
Keybukemits virtual-filesystems15:09
Keybukemits local-filesystems15:09
Keybukemits remote-filesystems15:09
Keybukemits all-swaps15:09
Keybukemits filesystem15:09
Keybukemits mounting15:09
Keybukemits mounted15:09
Keybuk(from lucid)15:09
Keybukfor any of those, "man 7 EVENT-NAME"15:09
Keybuk(in lucid)15:09
edgecaseok will look there15:09
KeybukI've tried to be reasonable well behaved about writing man pages for events15:09
edgecasethat's why i say sync point, they all get emitted in parallel15:09
Keybukthey don't15:09
edgecasebut only after *all* of mountall is done15:09
Keybukno they don't15:09
Keybukthey get emitted at completely different times15:10
edgecaseok so it's a declaration, "may emit..."15:10
Keybukyes15:10
edgecaseright-o15:10
Keybukdid you read "man 5 init" ? :)15:10
Keybuk       emits EVENT...15:10
Keybuk              All processes on the system are free to emit their own events by15:10
Keybuk              using the initctl(8) tool, or by communicating directly with the15:10
Keybuk              init(8) daemon.15:10
Keybuk              This  stanza  allows  a job to document in its job configuration15:10
Keybuk              what events it emits itself, and may be useful for graphing pos‐15:10
edgecasei see now that i'm way to pessimistic coming into this15:10
Keybuk              sible transitions.15:10
Keybukemits is basically there to make writing that graphing tool you were asking about possible ;)15:11
Keybukdocumentation only15:11
edgecaseok things look in order then15:11
edgecasei'm thinking then that just the .conf files can be optimized, to depend only on what they *really* need,15:12
edgecaseto enable some more unusual use-cases than "user logs in then unlocks WLAN key..."15:12
Keybukyes, certainly15:12
edgecaselike, network booting etc15:12
Keybukthe difficulty comes in adapting to users15:12
Keybuklike we could write the job to actually depend on /usr rather than filesystem15:12
edgecaseexactly15:13
Keybukbut that wouldn't work if a user decided to put a different filesystem for /usr/bin and for /usr/lib15:13
edgecaseFHS doesn't allow that does it?15:13
=== elpargo_ is now known as elpargo
Keybukyes it does15:13
KeybukFHS only says directories you shouldn't put on different filesystems15:13
edgecaseok well on that topic,15:13
Keybukthings like /usr and /var are free-for-alls15:13
edgecasewindows has "reparse points"...15:13
Keybukit's pretty common for example to have /var/lib or /var/spool on different drives15:13
edgecasetrue15:14
edgecasewith unix, a (empty) directory *could* be a mount point, no way to know15:14
edgecaseyou can read fstab, and hope it's in sync with reality15:14
Keybukreparse points => those are basically crazy symlinks iirc?15:15
edgecasetakes place of fstab entries15:15
edgecaseyou get file dir symlink, and now reparse point fs object15:15
edgecaseso, it's like an empty dir, because it has a name, 15:15
Keybukactually it might not even be in fstab15:15
Keybuke.g. if you use LABEL to mean mountpoint15:15
Keybukor if it's a removable device under /media15:15
edgecasebut it's a type explicityly marking it as a mount point15:15
edgecaseok then that's an arguement for having reparse points in linux15:16
edgecasealthough 75% of the unix world will issue a death warrant to you15:16
edgecasefor saying it15:16
edgecasethe cases that are in fstab could be handled15:16
edgecasemaybe that's a starting point15:17
edgecasebut it's not /usr i'm interested in... but rather starting things that need root fs read-only and /var/run available, starting those asap15:19
edgecaseanyhow i see that upstart is thankfully ahead of my expectations, i need to do some more reading now15:19
edgecasethanks for the good work!15:19
Keybuklocal-filesystems should be ok for those on Ubuntu15:30
Keybukah15:30
Keybuksorry15:30
Keybukvirtual-filesystems15:30
Keybukvirtual-filesystems means you have root read-only, and all the things like /var/run and stuff15:30
Keybukwe use it to start things like udev, dbus, etc.15:30
edgecasek thx15:46
wasabioh hi/bye edgecase17:33
=== elpargo_ is now known as elpargo
=== elpargo_ is now known as elpargo
halflinesadmac: did you ever look at the display manager selection thing more?20:56
halflinei mean http://rstrode.fedorapeople.org/quest_to_find_a_dm.txt20:56
=== elpargo_ is now known as elpargo

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