tag:blogger.com,1999:blog-17353640415250981162024-02-19T09:19:18.572-08:00Help Me Fix ThisGuy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.comBlogger19125tag:blogger.com,1999:blog-1735364041525098116.post-7323338932280233912020-02-24T07:05:00.000-08:002020-02-24T07:09:25.856-08:00dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylibTrying to run an older version of PHP via homebrew for development of an old codebase I get an error that <b>libcrypto.1.0.0</b> is not found:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;">/usr/local/Cellar/php@5.6/5.6.40/bin/php -v</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;">dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;"> Referenced from: /usr/local/Cellar/php@5.6/5.6.40/bin/php</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;"> Reason: image not found</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;">zsh: abort /usr/local/Cellar/php@5.6/5.6.40/bin/php -v</span><br />
<br />
Easily sorted by installing an appropriate libcrypto like so:<br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;">brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb</span><br />
<br />
And it's working!<br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;">/usr/local/Cellar/php@5.6/5.6.40/bin/php -v</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;">PHP 5.6.40 (cli) (built: Apr 23 2019 11:14:34)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;">Copyright (c) 1997-2016 The PHP Group</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: small;">Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies</span>Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-62692698555867521162019-01-04T01:55:00.000-08:002019-06-11T13:01:49.902-07:00Unix Timestamp ToolMy top googled search terms are probably 'unix timestamp' or 'unix timestamp converter'. Because I work a lot with time series data that is stored in integer timestamp format, I'm always using one of a couple of online tools for converting those timestamps back to a human readable form or going the other way, getting a timestamp from a date.<br />
<br />
I get frustrated with these tools as they don't do what I want and most times I need to manipulate the timestamp further to get the timestamp of the start of an hour or minute interval so I decided to create my own tool - <a href="https://unixtime.ninja/" target="_blank">unixtime.ninja</a><br />
<br />
I now keep my unixtime.ninja window almost permanently for converting my timestamps 😀Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-32404942013404171632018-08-20T06:40:00.000-07:002018-08-20T06:40:33.490-07:00Mac OS X High Sierra: Bluetooth Not AvailableLast year my MacBook Pro developed an issue where the internal keyboard / trackpad would become intermittent. You could get it to work if you pressed a certain place on the bottom panel.<br /><br />It was under warranty so eventually I sent it in to Apple to get repaired, they replaced the 'top board' and while they were at it they replaced the screen because some of the anti-glare coating had rubbed off in places.<br /><br />Since it came back I had an issue where Bluetooth will just stop working, sometimes at random times, mostly about a minute after waking from sleep. Some say it's a software issue, I diagnose a hardware issue - the Broadcom bluetooth adapter (presented as a USB device) just disappears from the device list. My theory is that during the first repair it may not have been reseated in the socket securely.<br /><br />So I got myself a £5 toolkit from eBay that includes the 'pentalobe' (that's a star to you and me) driver I needed to open the case, got it open, identified the Bluetooth / WLAN card, pulled it out, cleaned the contacts and put the whole thing back together again.<br /><br />
So far so good. I've been able to walk away and wake up my MacBook from sleep a long while later by wiggling the Magic Mouse, something I've not been able to do for months. 😀😀😀Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-19045428849164999272017-07-27T14:01:00.000-07:002017-07-27T14:02:50.827-07:00How Big is 'At Scale'?I see the term 'at scale' being used a lot on tech/engineering blogs - "You need to do it like <i>this</i> when you run your app <b>at scale</b>", "We had to do <i>this</i> to make it work <b>at scale</b>" etc etc.<br />
<br />
But what exactly determines that I am doing something at scale?<br />
<br />
How do you quantify that? There's no SI unit for scale like the 'Double Decker Bus' or the 'Olympic Swimming Pool'. I like to think that if my systems break either due to the amount of traffic they're being asked to handle or the amount of data I've asked them to query then I'm probably running my systems 'at scale'.<br />
<br />
Today I read the excellent ebook <a href="https://www.scalingphpbook.com/" target="_blank">Scaling PHP Applications</a>. The blurb on the website makes the proud <span style="font-family: inherit;">claim "<span style="background-color: white;">Scale PHP 5.6 (and 7), nginx, haproxy, MySQL 5.6, Redis, and Memcache to 10K req/second".</span></span><br />
<br />
That sounds like an upper limit for 'at scale' - <b>10,000 requests per second</b>.<br />
<br />
I'm sure I've seen my systems consistently handle more than 10k req/s. Sure enough, my monitoring graphs are showing peak HTTP traffic of <b>25k req/s</b> - that's <b>2.5x</b> '<i>at scale</i>'. I call this 2.5 Xscale.<br />
<br />
Taking a function of the number of requests handled and the service uptime, I got some stats from my system:<br />
<br />
<span style="font-size: large;"><b>nginx</b> - 14,227 req/s (<span style="color: red;">1.4</span> Xscale)</span><br />
<span style="font-size: large;"><b>php-fpm</b> - 10,999 req/s (<span style="color: red;">1.09</span> Xscale)</span><br />
<span style="font-size: large;"><b>memcached</b> - 93,221 cmd/s (<span style="color: red;">9.3</span> Xscale</span>)Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com1tag:blogger.com,1999:blog-1735364041525098116.post-21876639390155696672017-06-29T03:03:00.001-07:002017-07-27T14:03:18.940-07:00Apple Magic Keyboard 2 on LinuxAnnoyingly, the Apple Magic Keyboard 2 is only recognised as a generic Bluetooth hid keyboard so the Fn and shortcut keys don't work correctly (using hid-generic kernel module).<br />
<div>
<br /></div>
<div>
I've started work on a set of patches for the hid-apple kernel module to add support for this keyboard.</div>
<div>
<br /></div>
<div>
Using Wireshark to sniff the Bluetooth packets, I've found the following are emitted as Fn KeyDown and KeyUp events:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Fn KeyDown: a1 01 00 00 00 00 00 00 00 00 02</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Fn KeyUp: a1 01 00 00 00 00 00 00 00 00 00</span></div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
I'm going to attempt to add these as a customisation in the hid-apple module and see how I get on.</div>
Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-7907591259563297212017-01-31T14:36:00.002-08:002017-01-31T14:36:53.733-08:00A PHP Trait for validating a configuration array<a href="https://gist.github.com/gthouret/f6e1aa0fd8c7009bf29d2244f4754d9f">https://gist.github.com/gthouret/f6e1aa0fd8c7009bf29d2244f4754d9f</a>Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-26997085189934088872017-01-02T01:59:00.000-08:002017-01-02T01:59:02.000-08:00External USB Audio on Raspberry Pi 3The rpi3 could see the USB audio device but not be able to enable it. The following errors were observed in dmesg:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">[ 4.214503] snd_bcm2835: unknown parameter 'index' ignored</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">[ 4.470103] snd-usb-audio 1-1.2:1.0: cannot find the slot for index 0 (range 0-0), error: -16</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">[ 4.470134] usb 1-1.2: cannot create card instance 0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">[ 4.470164] snd-usb-audio: probe of 1-1.2:1.0 failed with error -16</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">[ 4.470823] usbcore: registered new interface driver snd-usb-audio</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">It looks like a conflict with the card index of the internal sound codec. Because I don't want to use the interval sound codec I just blacklisted the module to prevent it from loading by adding:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">blacklist snd_bcm2835</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">To the configuration file /etc/modprobe.d/rpi-blacklist.conf</span>Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-3843953951769904572016-12-05T13:30:00.000-08:002016-12-05T13:30:38.401-08:00Bash Completion on OS XWorking with the terminal in OS X for the first time I realised I was missing tab completion for common terminal tasks. After a bit of searching I found the <b>bash-completion</b> package is available to install from brew. Just use:<div>
<br /><div>
<span style="font-family: Courier New, Courier, monospace;">brew install bash-completion</span></div>
</div>
Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-64389589819559029952016-09-09T02:28:00.001-07:002016-09-09T02:28:49.403-07:00No SIM card - Emergency calls onlyI got a Motorola Google Nexus 6 phone which takes a nano SIM card. I cut down my existing SIM as far as I could and it worked in the Nexus but the SIM tray wouldn't shut properly so I ordered a brand new nano SIM.<br />
<br />
When the nano SIM came I could not get it to work at all. The phone would not detect the presence of the SIM card. I tried wedging paper under it, cleaning contacts, factory reset, software downgrade and nothing would work.<br />
<br />
This same nano SIM worked perfectly in another handset, I tried another working nano SIM in the Nexus and that wouldn't work either.<br />
<br />
I then tried pushing the SIM tray as hard as I could and surprisingly the SIM was registered by the handset and it indicated full signal.<br />
<br />
Short Answer:<br />
<span style="font-size: large;"><b>Push the SIM tray in as hard as you can!!!</b></span><br />
<br />
This appears to be some kind of mechanical defect with the Nexus 6 as recorded in many threads.<br />
Here: <a href="http://forum.xda-developers.com/nexus-6/help/sim-card-emergency-calls-error-verizon-t2996291">http://forum.xda-developers.com/nexus-6/help/sim-card-emergency-calls-error-verizon-t2996291</a><br />
Here: <a href="https://productforums.google.com/forum/#!topic/nexus/wuIXWFdaHZQ">https://productforums.google.com/forum/#!topic/nexus/wuIXWFdaHZQ</a><br />
And Here: <a href="https://productforums.google.com/forum/#!topic/nexus/-vSXPn2obNk">https://productforums.google.com/forum/#!topic/nexus/-vSXPn2obNk</a><br />
<br />Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-46823237282861920832016-08-15T06:40:00.002-07:002016-08-15T06:40:54.139-07:00Best description so far of Google Cast APIThinking of developing a Google Cast Receiver outside of the official Android SDK?<br />
<br />
Take a look at <a href="https://github.com/thibauts/node-castv2" target="_blank">this</a> documentationGuy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0Stockport, UK53.410631599999988 -2.157533199999988953.334924599999987 -2.3188946999999889 53.486338599999989 -1.996171699999989tag:blogger.com,1999:blog-1735364041525098116.post-79923308505884411122016-03-08T05:28:00.001-08:002016-03-08T05:29:19.174-08:00U-boot fails to load env from I2C eeprom if SPI is enabledU-boot failed to load environment from an I2C eeprom with the following errors:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">U-Boot SPL 2015.10-00002-gfedeb03-dirty (Mar 08 2016 - 13:05:30)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">reading args</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">spl_load_image_fat_os: error reading image args, err - -1</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">reading u-boot.img</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">reading u-boot.img</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">U-Boot 2015.10-00002-gfedeb03-dirty (Mar 08 2016 - 13:05:30 +0000)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> Watchdog enabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">I2C: ready</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">DRAM: 512 MiB</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">i2c_read: error waiting for addr ACK (status=0x116)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">*** Error - default environment is too large</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">Net: <ethaddr> not set. Validating first E-fuse MAC</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">Phy 0 not found</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">cpsw</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">Error: cpsw address not set.</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">, usb_ether</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">Error: usb_ether address not set.</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">env_buf [32 bytes] too small for value of "bootcmd"</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">Hit any key to stop autoboot: 0 </span><br />
<div>
<br /></div>
<div>
On investigation, adding a debug output I found that the wrong I2C address was being read:</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">I2C read: addr:0 len:4 alen:1 chip:0x00</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
My configuration defines the env on an eeprom at 0x50:</div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">/* EEPROM (24C16) */</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_CMD_EEPROM</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_ENV_IS_IN_EEPROM</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_I2C_ENV_EEPROM_BUS 1</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_SYS_I2C_EEPROM_ADDR<span class="Apple-tab-span" style="white-space: pre;"> </span>0x50<span class="Apple-tab-span" style="white-space: pre;"> </span>/* Main EEPROM */</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN<span class="Apple-tab-span" style="white-space: pre;"> </span>1</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_SYS_I2C_MULTI_EEPROMS</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS<span class="Apple-tab-span" style="white-space: pre;"> </span>3 /* 8 Byte write page */</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS<span class="Apple-tab-span" style="white-space: pre;"> </span>10</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 0x07</span></div>
</div>
<div>
<br /></div>
<div>
Looking at the section of code at include/common.h:483:</div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#if defined(CONFIG_SPI) || !defined(CONFIG_SYS_I2C_EEPROM_ADDR)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># define CONFIG_SYS_DEF_EEPROM_ADDR 0</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#else</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#endif</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#endif /* CONFIG_SPI || !defined(CONFIG_SYS_I2C_EEPROM_ADDR) */</span></div>
</div>
<div>
<br /></div>
<div>
The logic is a bit confusing but appears to set CONFIG_SYS_DEF_EEPROM_ADDR to 0 if CONFIG_SPI is defined but I don't have CONFIG_SPI defined!</div>
<div>
<br /></div>
<div>
On closer inspection, an included default config for the SoC I was using had defined this so simply adding:</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">#undef CONFIG_SPI</span></div>
<div>
<br /></div>
<div>
Resolved the issue :-) </div>
Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-31344268284695723492015-07-02T01:59:00.000-07:002015-07-02T01:59:58.740-07:00mysqld crashes with trap divide error I started getting alerts last night from applications being unable to connect to a mysql server. I checked the logs and kept seeing the following being repeated every minute:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:52:56 mysqlcluster1 /etc/mysql/debian-start[5569]: Upgrading MySQL tables if necessary.</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:52:56 mysqlcluster1 /etc/mysql/debian-start[5572]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:52:56 mysqlcluster1 /etc/mysql/debian-start[5572]: Looking for 'mysql' as: /usr/bin/mysql</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:52:56 mysqlcluster1 /etc/mysql/debian-start[5572]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:52:56 mysqlcluster1 /etc/mysql/debian-start[5572]: This installation of MySQL is already upgraded to 5.5.24, use --force if you still need to run mysql_upgrade</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:52:56 mysqlcluster1 /etc/mysql/debian-start[5583]: Checking for insecure root accounts.</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:52:56 mysqlcluster1 /etc/mysql/debian-start[5588]: Triggering myisam-recover for all MyISAM table</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:53:37 mysqlcluster1 kernel: [8198166.809336] mysqld[5562] trap divide error ip:7f1a23a9ae2e sp:7f1a23261400 error:0 in mysqld[7f1a233cf000+a8a000]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:53:37 mysqlcluster1 kernel: [8198167.130770] init: mysql main process (5155) killed by FPE signal</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:53:37 mysqlcluster1 kernel: [8198167.130836] init: mysql main process ended, respawning</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Jul 2 08:53:37 mysqlcluster1 kernel: [8198167.147935] type=1400 audit(1435823617.958:44): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=6160 comm="apparmor_parser"</span><br />
<br />
mysqld is obviously crashing for some reason. Today is 2nd July and one of our applications pulls nightly data into a table with over 2bn rows that is partitioned by month then other processes access and process that data later on. I remembered some weirdness in the past when we had forgotten to add more partitions so I logged into the application server and shut down all processes that may be trying to select or insert data to that table and the database server stayed up and didn't crash. Excellent, that must be the issue. Sure enough now that mysqld was up and I could access the database I found the table only had partition definitions up to end of June. I added a partition for July and restarted all of the application processes.<br />
<br />
For reference the versions this is running are:<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">guy@mysqlcluster1:~$ lsb_release -a</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">No LSB modules are available.</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Distributor ID:<span class="Apple-tab-span" style="white-space: pre;"> </span>Ubuntu</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Description:<span class="Apple-tab-span" style="white-space: pre;"> </span>Ubuntu 12.04.5 LTS</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Release:<span class="Apple-tab-span" style="white-space: pre;"> </span>12.04</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Codename:<span class="Apple-tab-span" style="white-space: pre;"> </span>precise</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">guy@mysqlcluster1:~$ mysqld --version</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mysqld Ver 5.5.24-0ubuntu0.12.04.1 for debian-linux-gnu on x86_64 ((Ubuntu))</span>Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com1Stockport, UK53.410631599999988 -2.157533199999988953.334924599999987 -2.3188946999999889 53.486338599999989 -1.996171699999989tag:blogger.com,1999:blog-1735364041525098116.post-28518339708574222012015-06-05T06:42:00.001-07:002015-06-05T06:42:09.466-07:00Freescale i.MX21 and Cirrus Logic cs8900a Patches for Linux Kernel 3.7A bit of work I did 3 years ago to provide board support for the i.MX2 based ASD01 WEMS programmer. Hopefully someone can make use of this patch for their own project.<br />
<br />
<a href="https://github.com/WEMS/ASD01-Kernel-Patches" target="_blank">ASD01 Kernel Patches</a>Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com1Stockport, UK53.4082911340032 -2.157719135284423853.4071081340032 -2.1602406352844237 53.4094741340032 -2.155197635284424tag:blogger.com,1999:blog-1735364041525098116.post-23893759871906345842014-10-31T03:18:00.000-07:002014-10-31T03:18:45.426-07:00Kernel 3.16.0 error on skb_warn_bad_offload with bnx2 and bridgeAfter upgrading to Ubuntu Server 14.10 I've been getting slow performance and constant messages in dmesg/syslog relating to skb_warn_bad_offload. Possibly as a result of some change in the 3.16.0 kernel that ships with it.<br />
<br />
It appears to be related to using bridges on top of an interface using the bnx2 kernel module.<br />
<br />
While the error message related to gso (generic segmentation offload) the resolution is to turn off the 'scatter-gather' option for any bridge interface that has an IP address assigned which appears to also turn off various offload options on the interface (tso,gso). I first tried just turning off tso and gso but this did not resolve the issue.<br />
<br />
To see interface options: (I already have sg option off)<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">guy@cyclopes:~$ sudo ethtool -k br28</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Features for br28:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">rx-checksumming: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-checksumming: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-checksum-ipv4: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-checksum-ip-generic: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-checksum-ipv6: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-checksum-fcoe-crc: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-checksum-sctp: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">scatter-gather: off</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-scatter-gather: off</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-scatter-gather-fraglist: off</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tcp-segmentation-offload: off</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-tcp-segmentation: off [requested on]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-tcp-ecn-segmentation: off [requested on]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>tx-tcp6-segmentation: off [requested on]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">udp-fragmentation-offload: off [requested on]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">generic-segmentation-offload: off [requested on]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">generic-receive-offload: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">large-receive-offload: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">rx-vlan-offload: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-vlan-offload: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ntuple-filters: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">receive-hashing: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">highdma: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">rx-vlan-filter: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">vlan-challenged: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-lockless: on [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">netns-local: on [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-gso-robust: off [requested on]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-fcoe-segmentation: off [requested on]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-gre-segmentation: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-ipip-segmentation: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-sit-segmentation: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-udp_tnl-segmentation: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-mpls-segmentation: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">fcoe-mtu: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-nocache-copy: off</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">loopback: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">rx-fcs: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">rx-all: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tx-vlan-stag-hw-insert: on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">rx-vlan-stag-hw-parse: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">rx-vlan-stag-filter: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">l2-fwd-offload: off [fixed]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">busy-poll: off [fixed]</span><br />
<br />
To turn off scatter gather:<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo ethtool -K br98 sg off</span><br />
<br />
If you have a lot of traffic on a bridge interface the performance of the machine is considerably reduced. My load average was sitting at 18 - 19. Probably due to the extra work of generating and logging the error messages. Once sg was turned off on the bridge interface, load average came down to 0.18!<br />
<br />
I have this set permanently in /etc/network/interfaces:<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">auto br98</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">iface br98 inet static</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> address 10.0.7.136</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> netmask 255.255.255.128</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> vlan_raw_device bond0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> bridge_ports bond0.98</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> pre-up /sbin/ethtool -K br98 sg off</span><br />
<br />
Kernel log for Google:<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789432] WARNING: CPU: 3 PID: 0 at /build/buildd/linux-3.16.0/net/core/dev.c:2246 skb_warn_bad_offload+0xc7/0xe0()</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789435] : caps=(0x0000000004197ba9, 0x000000801fdb78e9) len=2962 data_len=2896 gso_size=1448 gso_type=1 ip_summed=3</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789437] Modules linked in: dm_snapshot dm_bufio dm_zero dm_service_time ses enclosure ib_iser rdma_cm iw_cm ib_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi bridge 8021q garp stp mrp llc dm_round_robin radeon nfsd intel_powerclamp coretemp auth_rpcgss kvm_intel nfs_acl kvm nfs ttm crct10dif_pclmul bonding drm_kms_helper crc32_pclmul gpio_ich drm ghash_clmulni_intel lockd aesni_intel i2c_algo_bit aes_x86_64 sunrpc dm_multipath lp lpc_ich acpi_power_meter i7core_edac hpwdt parport ipmi_si fscache lrw gf128mul edac_core ipmi_msghandler joydev serio_raw glue_helper hpilo ablk_helper scsi_dh shpchp cryptd mac_hid hid_generic uas usbhid be2net bnx2 psmouse pata_acpi usb_storage hid vxlan hpsa</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789491] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G W I 3.16.0-24-generic #32-Ubuntu</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789493] Hardware name: HP ProLiant DL380 G7, BIOS P67 05/05/2011</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789495] 0000000000000009 ffff880d9fa23290 ffffffff8177fcbc ffff880d9fa232d8</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789498] ffff880d9fa232c8 ffffffff8106fd8d ffff88045c9c3ce8 ffff880d6ecf6000</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789501] 0000000000000001 0000000000000000 0000000000000081 ffff880d9fa23328</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789505] Call Trace:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789506] <IRQ> [<ffffffff8177fcbc>] dump_stack+0x45/0x56</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789517] [<ffffffff8106fd8d>] warn_slowpath_common+0x7d/0xa0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789519] [<ffffffff8106fdfc>] warn_slowpath_fmt+0x4c/0x50</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789521] [<ffffffff8139f827>] ? ___ratelimit+0x87/0x100</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789523] [<ffffffff8167aa77>] skb_warn_bad_offload+0xc7/0xe0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789526] [<ffffffff8167d63d>] skb_checksum_help+0x13d/0x170</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789527] [<ffffffff8168097d>] dev_hard_start_xmit+0x46d/0x5d0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789530] [<ffffffff81680e23>] __dev_queue_xmit+0x343/0x4f0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789532] [<ffffffff81680fe0>] dev_queue_xmit+0x10/0x20</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789535] [<ffffffffc025af45>] vlan_dev_hard_start_xmit+0x95/0x130 [8021q]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789537] [<ffffffff81680845>] dev_hard_start_xmit+0x335/0x5d0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789539] [<ffffffff81680e23>] __dev_queue_xmit+0x343/0x4f0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789541] [<ffffffff816b1ee4>] ? nf_hook_slow+0x74/0x130</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789544] [<ffffffffc0337a50>] ? deliver_clone+0x50/0x50 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789546] [<ffffffff81680fe0>] dev_queue_xmit+0x10/0x20</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789550] [<ffffffffc0337ac4>] br_dev_queue_push_xmit+0x74/0xa0 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789553] [<ffffffffc0337b12>] br_forward_finish+0x22/0x60 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789556] [<ffffffffc0337ba3>] __br_deliver+0x53/0x100 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789560] [<ffffffffc0338093>] br_deliver+0x63/0x70 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789563] [<ffffffffc03358bc>] br_dev_xmit+0x13c/0x270 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789564] [<ffffffff81680845>] dev_hard_start_xmit+0x335/0x5d0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789567] [<ffffffff81680e23>] __dev_queue_xmit+0x343/0x4f0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789568] [<ffffffff81680fe0>] dev_queue_xmit+0x10/0x20</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789570] [<ffffffff816be3e1>] ip_finish_output+0x511/0x850</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789572] [<ffffffff816bf0a8>] ip_output+0x58/0x90</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789575] [<ffffffff811788e5>] ? put_page+0x35/0x40</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789576] [<ffffffff816be800>] ip_local_out_sk+0x30/0x40</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789578] [<ffffffff816beb83>] ip_queue_xmit+0x143/0x3c0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789580] [<ffffffff816d5f34>] tcp_transmit_skb+0x484/0x940</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789582] [<ffffffff816d65bc>] tcp_write_xmit+0x1cc/0xd60</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789584] [<ffffffff816d73ce>] __tcp_push_pending_frames+0x2e/0xd0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789586] [<ffffffff816d291a>] tcp_rcv_established+0x11a/0x6e0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789588] [<ffffffff816dd465>] tcp_v4_do_rcv+0x1b5/0x4e0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789590] [<ffffffff81680d24>] ? __dev_queue_xmit+0x244/0x4f0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789591] [<ffffffff816df08e>] tcp_v4_rcv+0x6ce/0x7b0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789596] [<ffffffffc0236922>] ? bond_dev_queue_xmit+0x32/0x80 [bonding]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789598] [<ffffffff816b895a>] ip_local_deliver_finish+0xaa/0x220</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789600] [<ffffffff816b8c68>] ip_local_deliver+0x48/0x80</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789602] [<ffffffff816b85e4>] ip_rcv_finish+0x84/0x350</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789604] [<ffffffff816b8f1f>] ip_rcv+0x27f/0x380</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789606] [<ffffffff8167eb92>] __netif_receive_skb_core+0x572/0x820</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789608] [<ffffffff816b1e5a>] ? nf_iterate+0x9a/0xb0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789610] [<ffffffff8167ee56>] __netif_receive_skb+0x16/0x70</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789611] [<ffffffff8167eed3>] netif_receive_skb_internal+0x23/0x90</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789613] [<ffffffff8167ef5c>] netif_receive_skb+0x1c/0x70</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789617] [<ffffffffc0339026>] br_handle_frame_finish+0x1b6/0x3f0 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789621] [<ffffffffc03400cb>] br_nf_pre_routing_finish+0x12b/0x3c0 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789625] [<ffffffffc03404e7>] br_nf_pre_routing+0x187/0x740 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789629] [<ffffffffc0338e70>] ? br_handle_local_finish+0x90/0x90 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789631] [<ffffffff816b1e5a>] nf_iterate+0x9a/0xb0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789634] [<ffffffffc0338e70>] ? br_handle_local_finish+0x90/0x90 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789636] [<ffffffff816b1ee4>] nf_hook_slow+0x74/0x130</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789640] [<ffffffffc0338e70>] ? br_handle_local_finish+0x90/0x90 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789643] [<ffffffffc0339408>] br_handle_frame+0x1a8/0x260 [bridge]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789645] [<ffffffff8167e8b2>] __netif_receive_skb_core+0x292/0x820</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789647] [<ffffffff8101c2f9>] ? read_tsc+0x9/0x20</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789649] [<ffffffff8167ee56>] __netif_receive_skb+0x16/0x70</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789651] [<ffffffff8167eed3>] netif_receive_skb_internal+0x23/0x90</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789652] [<ffffffff8167f950>] napi_gro_receive+0xc0/0xf0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789657] [<ffffffffc0090b09>] bnx2_rx_int+0x3c9/0x1050 [bnx2]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789661] [<ffffffff81366215>] ? blk_run_queue+0x35/0x40</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789665] [<ffffffffc0091ae0>] bnx2_poll_work+0x350/0x450 [bnx2]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789669] [<ffffffffc0091c14>] bnx2_poll_msix+0x34/0xc0 [bnx2]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789671] [<ffffffff8167f2a2>] net_rx_action+0x142/0x250</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789673] [<ffffffff810755f4>] __do_softirq+0x124/0x2e0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789675] [<ffffffff810759ad>] irq_exit+0xfd/0x110</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789676] [<ffffffff8178ab06>] do_IRQ+0x56/0xe0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789679] [<ffffffff8178896d>] common_interrupt+0x6d/0x6d</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789679] <EOI> [<ffffffff81619159>] ? cpuidle_enter_state+0x49/0xc0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789684] [<ffffffff816192b7>] cpuidle_enter+0x17/0x20</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789686] [<ffffffff810b9b77>] cpu_startup_entry+0x347/0x480</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789688] [<ffffffff81045ac0>] start_secondary+0x230/0x2c0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Oct 31 06:47:22 cyclopes kernel: [28195.789689] ---[ end trace 83f6d496335214a4 ]---</span>Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-75736448542048278552014-10-31T02:35:00.000-07:002014-10-31T03:19:31.781-07:00Virtlockd on Ubuntu Server 14.10<div>
Virtlockd shouldwork out of the box on 14.10 but it doesn't!</div>
<div>
<br /></div>
To implement locking on SAN volumes in a 3 node QEMU/KVM cluster I wanted to implement virtlockd. I first set up a glusterfs cluster for the three nodes to share a common filesystem to store the lock files and mounted this at /var/lib/libvirt/lockd on each node.<br />
<div>
<br /></div>
<div>
I turned on locking in /etc/libvirt/qemu.conf by uncommenting the line:</div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">lock_manager = "lockd"</span></div>
<div>
<br /></div>
<div>
Set auto_disk_leases = 1 in /etc/libvirt/qemu-lockd.conf and uncommented all of the default <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">lockspace_dir</span> entries.</div>
<div>
<br /></div>
<div>
I restarted libvirt with <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo service libvirt-bin restart</span> and attempted to start a machine.</div>
<div>
<br /></div>
<div>
I was met with the error:</div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Failed to connect socket to '/var/run/libvirt/virtlockd-sock': No such file or directory</span></div>
<div>
<br /></div>
<div>
After searching in various config files I found that virtlockd needs to start as a daemon and there was no auto way for this to happen so I wrote an upstart config...</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">description "virtlockd Daemon"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">author "Guy Thouret <guy@thouret.uk>"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">start on stopped rc RUNLEVEL=[2345]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">stop on starting rc RUNLEVEL=[016]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">expect daemon</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">respawn</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">exec /usr/sbin/virtlockd -d</span></div>
</div>
<div>
<br /></div>
<div>
...saved it as /etc/init/virtlockd.conf and I was then able to start virtlockd with <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">service virtlockd start</span></div>
<div>
<br /></div>
<div>
<span style="font-family: inherit;">I confirmed the lockfile had indeed been created:</span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">guy@cyclopes:/gluster/vmlocks$ sudo ls -l /var/lib/libvirt/lockd/*</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">-rw-r--r-- 1 root root 0 Oct 30 14:02 /var/lib/libvirt/lockd/tsting</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">/var/lib/libvirt/lockd/files:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">total 0</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">/var/lib/libvirt/lockd/lvmvolumes:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">total 0</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">/var/lib/libvirt/lockd/scsivolumes:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">total 0</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">-rw------- 1 root root 0 Oct 30 16:33 3600c0ff0001587169836e15201000000</span></div>
</div>
<div>
<br /></div>
<div>
Attempting to start the running VM on another node gave the error:</div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Error starting domain: resource busy Lockspace resource '3600c0ff000158716ec34b05201000000' is locked</span><br />
<br />
Virtlockd has saved the day and prevented the VM from potentially being trashed.</div>
Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-69682974380192134102014-10-28T03:54:00.001-07:002014-10-28T03:54:50.670-07:00Unable to start Corosync service on Ubuntu ServerConfused for ages as to why when I was calling sudo service corosync start it would not doas I asked I looked in the init script at /etc/init.d/corosync and found the line:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"># start corosync at boot [yes|no]</span><br />
<span style="font-family: Courier New, Courier, monospace;">START=no</span><br />
<br />
changing this to <span style="font-family: Courier New, Courier, monospace;">START=yes</span> enabled the service to start.<br />
<br />
A warning or error might have been nice...Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-23710433912832992032014-10-16T07:20:00.002-07:002014-10-16T07:20:30.472-07:00Issue with libuuid package during Ubuntu 14.10 upgradeGot the following error while upgrading from Ubuntu 14.04 to 14.10<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Setting up libuuid1:amd64 (2.25.1-3ubuntu2) ...</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">chsh: PAM: Authentication failure</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">dpkg: error processing package libuuid1:amd64 (--install):</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> subprocess installed post-installation script returned error exit status 1</span><br />
<div>
<br /></div>
<div>
The post install script was using the chsh program to change the shell of libuuid user to /bin/false only if it was currently set to /bin/sh.</div>
<div>
<br /></div>
<div>
Changing this manually by editing /etc/passwd allowed the package install to continue as normal and all dependent packages to install also.</div>
<div>
<br /></div>
<div>
I had to do an apt-get update && apt-get upgrade to continue with the installation of updates after this was resolved.</div>
Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com4tag:blogger.com,1999:blog-1735364041525098116.post-8942827915547449892014-07-10T07:21:00.001-07:002014-07-10T07:22:17.628-07:00NEC Aspire Slow Dialling SIP TrunksDialling a number on a SIP trunk would result in a wait of 10 seconds from the last number key press until the Aspire sent the SIP INVITE packet. This was really annoying and not really acceptable as the same delay did not seem to occur on an ISDN trunk.<br />
<br />
As a workaround, if a # was entered after the last digit it forced an immediate dial and bypassed the wait timer.<br />
<br />
A more permanent solution was to adjust programming option <b>21-01-03 External Call Inter-digit Time </b>to 5 from 10. This halves the time out until dialling occurs but set any lower could cause issues with users not being able to dial digits fast enough.Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com0tag:blogger.com,1999:blog-1735364041525098116.post-63665261755936226472014-07-04T05:50:00.001-07:002014-07-04T05:50:03.864-07:00Recover Cisco 7970 IP Phone From Failed Factory ResetI tried to upgrade a 7970 to 9.3 SCCP firmware and it wouldn't connect to my CME so I performed a factory reset using <a href="http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cuipph/7970g_7971g-ge/english/5_0/sccp/english/administration/guide/5_0/7970trb.html#wp1087544">this</a> method and the phone appeared to be bricked.<br />
<br />
After power up it was just showing a blank screen followed by green lit headset light and cycling green line buttons. What I didn't know was that the factory reset actually removes the firmware from the phone and it now needed to find it again.<br />
<br />
Some investigation showed that it was requesting an IP form DHCP and was requesting the file term70.default.loads from the option 150 TFTP server address.<br />
<br />
Trying many different firmware versions and different TFTP servers it would successfully get the term70.default.loads but not do anything with it. Eventually I went all the way back down to firmware version 8.3 which I sourced from <a href="http://software.cisco.com/portal/pub/download/portal/select.html?&mdfid=278436620&catid=280789323&softwareid=282074289">here</a>.<br />
<br />
With version 8.3 loaded on the tftp server the phone successfully read the term70.default.loads and continue to download the other binaries required although I had to rename the jar70sccp... file to Jar70sccp... with a capital J.<br />
<br />
When reconnected to CME it still fails to load firmware version 9.3 with the message "Load Authentication Failed". I suspect that the signing certificate in 8.3 is unable to authenticate the load of 9.3 given that 8.3 was released back in 2007 and it's probably expired.Guy Thourethttp://www.blogger.com/profile/00166954789036539309noreply@blogger.com1