/srv/irclogs.ubuntu.com/2012/10/17/#upstart.txt

geek65535Hope someone can help: I'm having trouble with gluster where the daemon 'glusterd' is starting before the network is properly up, despite using 'start on static-network-up'. My network contains a bridge (for KVM use), and it appears to appear up to upstart (ouch) before it's actually up and passing packets. Is there any way I can make glusterd wait on actual network connectivity through the bridge?18:48
SpamapSgeek65535: how are you configuring the bridge?18:50
geek65535SpamapS: so sorry! Got distracted by the real world. (I hate when that happens). This is my current config:21:20
geek65535iface bridge0 inet static21:20
geek65535        address 10.8.1.2121:20
geek65535        netmask 255.255.255.12821:20
geek65535        network 10.8.1.021:20
geek65535        broadcast 10.8.1.12721:20
geek65535        gateway 10.8.1.121:20
geek65535        # dns-* options are implemented by the resolvconf package, if installed21:20
geek65535        dns-nameservers 10.8.1.33 10.8.1.4421:20
geek65535        dns-search houston8.topgolf.com21:20
geek65535        bridge_ports eth021:20
geek65535        bridge_stp off21:20
geek65535        bridge_maxwait 621:20
TimothyAI seem to have a slight problem with upstart when trying to run a python script as a service; when I try to manually invoke the process, it will just lock up the screen until I press ctrl-c. any ideas how to fix this?21:46
TimothyAwhat is the recommended approach for starting python scripts with upstart?21:51
TimothyAand now the server has become unusable...22:05
SpamapSTimothyA: python scripts aren't special over any other thing22:08
SpamapSTimothyA: can you pastebin your upstart script?22:09
SpamapSgeek65535: do you have 'auto bridge0' in /etc/network/interfaces ?22:09
TimothyASpamapS: I can't. the server has become unreachable.22:12
geek65535SpamapS: yes. I just missed it on the copy-and-paste22:13
SpamapSgeek65535: ok, static-network-up *should* wait for that.. you can see the exact time static-network-up was emitted by looking at the mtime of the dir /run/network/static-network-up-emitted ...22:21
SpamapSgeek65535: perhaps ifup returns before the bridge is actually working?22:21
TimothyASpamapS: removed the file and rebooted server22:23
TimothyAbut it's nothing more than a basic respawn and exec python main.py lines22:23
geek65535SpamapS: let me take a look...22:24
SpamapSTimothyA: yeah, that should work. If you don't have any post-start or expect lines, it should return immediately on 'start your-job-name'22:24
geek65535run/network/static-network-up-emitted is empty...22:27
geek65535er, sorry, missed the 'mtime' part...22:27
SpamapSgeek65535: right, its the dir itself that is used as a flag22:27
SpamapSgeek65535: you should also see the ifup.bridge0 there, with an earlier mtime/ctime22:28
geek65535root@vmhost1:/run/network# ls -l --full-time22:28
geek65535total 422:28
geek65535-rw-r--r-- 1 root root 22 2012-10-17 17:26:27.217981181 -0500 ifstate22:28
geek65535-rw-r--r-- 1 root root  0 2012-10-17 17:26:27.209981181 -0500 ifup.bridge022:28
geek65535-rw-r--r-- 1 root root  0 2012-10-17 17:26:24.089981092 -0500 ifup.lo22:28
geek65535drwxr-xr-x 2 root root 40 2012-10-17 17:26:27.209981181 -0500 static-network-up-emitted22:28
SpamapSgeek65535: right, so ifup is the problem then22:29
SpamapSgeek65535: it must return before the bridge is actually working22:29
geek65535That's what I had been thinking. I just need to find something that emits a signal after the bridge is active. (Or live with the 'sleep 10' stuck in my /etc/init/glusterd.conf)22:31
SpamapSgeek65535: thats a bug.. perhaps we should find it and fix it :)22:31
geek65535What can I do to help? (I'm an experienced admin, but I don't code outside of scripting languages.)22:33
SpamapSgeek65535: I'm looking now.. it may be an issue with the way ifupdown delegates this duty to the bridge plugin22:35
TimothyASpamapS: it did not22:36
TimothyAand it locks up my screen when I try to do it manually22:36
SpamapSTimothyA: "locks up my screen" meaning the terminal does not return?22:36
TimothyAyep22:37
SpamapSgeek65535: ok, this is handled by /etc/network/if-pre-up.d/bridge ...22:37
SpamapSgeek65535: of particular interest to you may be the MAXWAIT= area22:38
SpamapSgeek65535: bridge_maxwait 10 would solve your problem ;)22:39
SpamapSgeek65535: (from man bridge-utils-interfaces)22:40
SpamapSgeek65535: actualy, bridge_fd seems more appropriate22:40
SpamapSgeek65535: I suspect yours is failing because brctl showstp bridge0 is not reporting forward delay / bridge forward delay properly22:41
SpamapSgeek65535: its usually 15.00 which should be 15 seconds.. so maybe you need more?22:42
geek65535 SpamapS: I have maxwait at 6  and bridge_fd at 0, allong with bridge_hello at 0 (although that shouldn't matter with stp off).22:42
SpamapSTimothyA: ok, well that still should work fine. When you can, pastebin the upstart job file and we can try to help22:43
TimothyASpamapS: the python script already implements a signal handler.22:43
SpamapSTimothyA: thats not realy important in 'start'22:43
SpamapSTimothyA: signals are only sent on 'reload' and 'stop' (HUP, and TERM, then KILL)22:43
TimothyAexec python main.py22:43
TimothyAthat's about all22:43
geek65535 SpamapS: upped maxwait to 20, rebooting to see if it make a difference.22:46
geek65535 SpamapS: no joy.22:48
SpamapSgeek65535: how strange22:48
SpamapSgeek65535: another possibility is that brctl is showing it as ready, when its not22:49
geek65535 SpamapS: I'd buy that.22:49
SpamapSgeek65535: because maxwait is just how long it waits for brctl showstp to show 'listening, learning, forwarding, blocking'22:50
SpamapSoh oh oh .. I think that maxwait is 10th's of seconds22:51
geek65535 SpamapS: 10ths? That would make a difference!22:52
SpamapSyeah22:53
SpamapSwell it sleeps 0.1, then inc's count +122:53
SpamapSso yeah, 10ths22:53
SpamapSok, I have to run22:53
geek65535 SpamapS: me, too, actually. dinnertime...22:53
SpamapSgeek65535: I think you have enough to take a look. If you find that the script is doing something wrong, or brctl is, I urge you to do an 'ubuntu-bug bridge-utils' or 'ubuntu-bug linux' ;) good luck22:54
geek65535 SpamapS: thanks!22:55

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