From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Wed, 15 Oct 2008 08:42:07 -0400 To: 9fans@9fans.net Message-ID: <7807852439120719b87d05dc1e00b529@coraid.com> In-Reply-To: <20081015082813.GD1296@hermes.my.domain> References: <20081015082813.GD1296@hermes.my.domain> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-srlvwumdkspifkhxbrsqawnsqy" Subject: Re: [9fans] How to get the diagnostics of fs(3) Topicbox-Message-UUID: 1e9fa164-ead4-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-srlvwumdkspifkhxbrsqawnsqy Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit we have three different console servers at coraid. so i've changed how consoles and console logging works. maybe this will be useful to other people. here are the changes that make this work 1. instead of consoledb use /lib/ndb/consoledb.$sysname. and have a general test for this new file in cpurc. if(test -f /lib/ndb/consoledb.$sysname){ aux/consolefs -c /lib/ndb/consoledb.$sysname startclog } 2. startclog (attached) uses a new consoledb tuple clog=$sysname, e.g. from /lib/ndb/consoledb.baron console=ila dev=/dev/eia5 gid=sys clog=baron (the -r flag is part of a very sneaky trick involving booting from a skeleton kfs and binding large bits of the namespace back via aan so that the console logger can survive loosing its connection to the fs without having console logging end up someplace other than the man fs. the way to start it is startclog; startclog -r. this setup survived a switch gone wild a few weeks ago.) 3. add the directory /sys/log/clog & create the console files you wish. - erik --upas-srlvwumdkspifkhxbrsqawnsqy Content-Disposition: attachment; filename=startclog Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit #!/bin/rc rfork e rflag=0 if(~ $1 -r) rflag=1 cd /mnt/consoles for(i in *){ x = `{ndb/query -f/lib/ndb/consoledb.$sysname console $i clog} if(~ $rflag 0 && ~ $x $sysname){ log=/sys/log/clog/$i if(~ $rflag 1){ mkdir -p /tmp/clog log=/tmp/clog/$i } while(~ 1 1){ echo aux/clog $log /mnt/consoles/$i aux/clog /mnt/consoles/$i $log && echo clog exits $status sleep 10; } }& } fn rotate{ rm /tmp/oclog/* cp /tmp/clog/* /tmp/oclog rm /tmp/clog/* } if(~ $rflag 1){ mkdir -p /tmp/oclog /tmp/clog while(~ 1 1){ sleep 600 s=`{du -a /tmp/clog| sed 's/[ ].*//g'} if(test $s -gt 10000) rotate } }& --upas-srlvwumdkspifkhxbrsqawnsqy--