/srv/irclogs.ubuntu.com/2011/04/12/#upstart.txt

semiosisi'm working on writing an upstart job that will start a service after the network interface is up, but before remote filesystems are mounted.  or at least start the service after the network interface is up, then reattempt mounting of remote filesystems.  emitting remote-filesystems doesnt seem to have any effect on the _netdev entries in /etc/fstab.  any ideas?18:16
semiosisthis is on ubuntu maverick18:16
Keybuksemiosis: a lot of that stuff is custom to Ubuntu18:21
semiosisi'm sure it is.  any pointers?18:26
KeybukI've no idea, sorry18:33
KeybukI haven't been able to keep track of Ubuntu's fork so far18:33
semiosisok, thanks anyway.  i'm sure i'll figure something out :)18:33
SpamapSsemiosis: so you really need to block the mounting of remote filesystems, right?19:29
SpamapSsemiosis: sounds like you may need to block some of the 'mounting' events until your service is started.19:32
semiosisSpamapS: not sure what i need, but i figured out that emitting a 'startup' event caused a retry of the mounts.  not sure what the other implications of that are though19:33
SpamapSsemiosis: emitting startup seems a bit bass-ackwards. ;)19:33
semiosisSpamapS: yeah it does!19:33
semiosisSpamapS: but mountall service goes away, so emitting a remote-filesystems (which would trigger the mountall-net job) does nothing at all19:34
SpamapSsemiosis: so what you want, I think, is start on mounting TYPE=nfs ...19:35
semiosisSpamapS: actually it's glusterfs I'm working with, but it might be similar enough19:35
SpamapSsemiosis: mounting is a hook point, so mountall blocks on anything that uses that event...19:35
SpamapSAh gluster. Ok.. is mountall "gluster aware" ?19:36
semiosisSpamapS: i dont know.19:36
SpamapSseems its not19:36
SpamapSso gluster will be treated like a local filesystem unless given the 'nobootwait' flag, I think.19:36
* SpamapS is still wrapping his head around mountall19:36
SpamapSso tiny, but so twisted.. :)19:36
semiosisSpamapS: basically, gluster service starts up & exports directories over the network (which could be eth0 or lo) then I have a client mount of the glusterfs volume in my fstab, which never gets mounted during bootup, unless i put 'mount -a' or similar in rc.local19:37
semiosisSpamapS: hmm that woudl explain why _netdev didnt seem to make any difference.  in fact, nobootwait didnt seem to make any difference either19:38
SpamapSsemiosis: right, you might just try adding  _netdev=eth0 to the options19:38
SpamapSerr19:39
SpamapSjust _netdev19:39
SpamapSsemiosis: no _netdev should make it a "remote" filesystem19:39
SpamapSsemiosis: so you're saying in order for gluster to be able to mount a remote fs, it needs a service, right?19:40
semiosisSpamapS: not at all19:40
SpamapSOk.. then thats very odd that _netdev didn't work19:40
semiosisSpamapS: this host is a server and a client, in order for it to be a client of its own served volume, the service needs to be up19:41
SpamapSsemiosis: AHHH19:41
semiosisSpamapS: so the server name here is localhost19:41
SpamapSyeah so you *do* need it to start on mounting TYPE=glusterfs19:41
semiosisSpamapS: hmm i was hoping this could be solved by adding an upstart job to my custom glusterfs package, but are you saying it requires changes to mountall?19:42
SpamapSsemiosis: you might just try a task that is 'start on mounting TYPE=glusterfs' that starts the service (exec /etc/init.d/glusterfs start)19:42
semiosisSpamapS: ok then where does the mounting TYPE=glusterfs event get emitted?19:42
SpamapSsemiosis: by mountall, whenever it tries to mount glusterfs volumes19:43
semiosisSpamapS: ooh neat19:43
SpamapSand, importantly, it waits for that task to finish19:43
SpamapSsemiosis: you could also, of course, convert glusterfs to an upstart job completely.. which would improve boot speed and be super cool. ;)19:44
semiosisSpamapS: thats what i'd like to do19:45
semiosisSpamapS: and it shouldnt be too hard, the service is super easy to manage (it really manages itself, just needs a kick) i just need to figure out these events19:45
SpamapSsemiosis: the one tricky thing about mounting TYPE=glusterfs is you're going to see that event multiple times and sometimes the network won't be up... but don't be tempted to do 'and net-device-up' ;)19:46
semiosisSpamapS: actually i was thinking 'or net-device-up'19:47
semiosisSpamapS: but first things first19:47
SpamapSsee if you do 'or net-device-up' you may not block mounting TYPE=glusterfs19:50
SpamapSunless you add  instance $UPSTART_EVENTS19:51
SpamapSand even then I'm not sure if that will work19:51
semiosisSpamapS: hmm no luck yet.  i've got a trivial upstart job to start glusterd, it has 'start on mounting TYPE=glusterfs' and 'exec /usr/sbin/glusterd -N -p /var/run/glusterd.pid' which will execute the daemon and have it stay in foreground (-N = no fork)19:55
semiosisSpamapS: now this job does get run at boot, the service is up when I login, but the mount from fstab is still not mounted19:55
SpamapSsemiosis: one thing that may cause that to fail is that it will be considered "started" as soon as it execs glusterd ..19:56
SpamapSsemiosis: but it may not be ready to service things yet.19:56
semiosisSpamapS: i also tried adding _netdev to the fstab but no effect19:56
SpamapSsemiosis: weird. I wonder if your glusterfs partitions are even being attempted on 'net-device-up'19:56
semiosisSpamapS: well doing 'initctl emit -n startup' does mount the volume from fstab19:58
SpamapSsemiosis: but.. that seems a bit .. silly.19:59
SpamapSsemiosis: maybe just 'start mountall'19:59
SpamapSbut even that is counter intuitive19:59
semiosisSpamapS: i know but as a test it suggests to me that the mount in fstab is being evaluated due to upstart events19:59
SpamapSsemiosis: boot with '--verbose' and see if the mounting event is even being emitted20:00
semiosisSpamapS: the service does start up, and mounting is the only event in its 'start on' line20:00
semiosisSpamapS: where do I add --verbose?  grub boot line?20:00
SpamapSsemiosis: yeah20:02
SpamapSsemiosis: ahh ok so the service does start ... then that makes me think the gluster mount just fails20:02
semiosisSpamapS: checking client logs... looks like it's trying the mount before the service is started, which has been the issue all along20:04
SpamapSsemiosis: right, so you need to add a post-start to your job that spins until gluster is ready20:10
semiosisSpamapS: interesting, sounds reasonable, i'll work on that.20:11
=== Md_ is now known as Md
semiosisSpamapS: you rock!!!  adding a post-start script of just 'sleep 5' did the trick!  now i know what's needed I can get it down to the minimum necessary.  thanks for your help! :-D20:20
semiosisSpamapS: also as a side note, thanks for the quick tutorial on mountall & the events it generates, i've found a whole new area of man pages to study based on that quick tip.20:22
SpamapSsemiosis: in natty, 'man upstart-events' is really good20:22
semiosisSpamapS: nice, i'll check that out on the web, i dont have a natty install set up yet20:23
SpamapSsemiosis: manpages.ubuntu.com has it20:23
semiosisSpamapS: i'm there20:23
SpamapS"we're there dude"20:23
jMCgoh wow. I'm absolutely flabbergasted. Since when does that exist?20:28
jMCgO_o20:29
jMCgHow do you fuck up man pages?20:30
semiosisi dont know, how?20:39
* semiosis likes a good joke20:40
jMCgsemiosis: compare manpages.ubuntu.com with http://www.freebsd.org/cgi/man.cgi20:40
jMCgIt's actually a bad joke.20:40
jMCgAlso try finding that site from: http://www.ubuntu.com/ or https://help.ubuntu.com/ (th eofficial documentation)20:41
jMCgKeybuk: what's it take to port upstart to FreeBSD :)20:56
KeybukjMCg: a FreeBSD developer being interested enough to do it20:57
JanCjMCg: the manpages site is linked from https://help.ubuntu.com/community but I agree it should probably be linked from the frontpage...20:59
jMCgJanC: or at least from help.ubuntu.com21:02
JanCyes, that's what I meant, the frontpage of the help site21:02
KeybukjMCg: the trouble is, of course, that FreeBSD developers don't need Upstart21:05
Keybukthey still haven't moved off the one big shell script approach21:05
Keybuk(at least, don't think they need :oP)21:06
mastamindhi. can i use upstart without dbus?23:31
ionThe daemon? Sure.23:31
mastamindit seems, that the tools only use dbus to communicate with the daemon.23:32
mastamindshutdown, telinit, ...23:32
ionThe daemon? Only optionally if it happens to be there.23:32
mastamindsysv_change_runlevel requires dbus.23:33
Keybukit requires the dbus protocol, not the dbus daemon23:33
Keybukthere is a miniature dbus daemon built into upstart that it connects to23:33
mastamindok :-)23:34
mastamindso the upstart daemon will "emulate" the dbus daemon?23:34
Keybuknot so much, but close enough for government work23:35
mastamindok23:35
mastamindthank you for your help.23:35

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