Text relocation remains against symbol, libx264
Just a very quick post regarding libx264.
If you are getting errors such as:
# gcc -shared -o libx264.so.67 common/mc.o common/predict.o common/pixel.o common/macroblock.o common/frame.o common/dct.o common/cpu.o common/cabac.o common/common.o common/mdate.o common/set.o common/quant.o common/vlc.o encoder/analyse.o encoder/me.o encoder/ratecontrol.o encoder/set.o encoder/macroblock.o encoder/cabac.o encoder/cavlc.o encoder/encoder.o extras/getopt.o -Wl,-h,libx264.so.67 -lm -lpthread -s
Text relocation remains referenced
against symbol offset in file
0x6be common/mc.o
0x6d5 common/mc.o
0xbbe common/mc.o
0xbc5 common/mc.o
...
__udivdi3 0x3809 common/set.o
__udivdi3 0x3875 common/set.o
__udivdi3 0x10cf encoder/macroblock.o
__divdi3 0x17865 encoder/analyse.o
__divdi3 0x1e9 encoder/set.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
then simply add “-mimpure-text -lrt” to your LDFLAGS.
A quick note to self, “gcc -shared” is better than “gcc -G”. The former tells gcc to build a shared object, which tells the linker (I suppose). The latter just tells the linker. Swapping a -shared for -G can fix the above issue, but creates other issues. Or something along those lines - I’m a bit hazy on this one.
This issue came about because I was getting errors when running a 64bit amd64 ffmpeg linked against libx264:
ld.so.1: ffmpeg: fatal: relocation error: R_AMD64_PC32: file /opt/ec/lib/amd64/libx264.so.67: symbol main: value 0x280018fc805 does not fit
The problem here was that I’d compiled libx264 with gcc -G instead of gcc -shared. However using -shared generated the “Text relocation remains against symbol” errors, which needed the “-mimpure-text -lrt” fix.
1 comment May 19th, 2009
FFMpeg 64bit x86_64 / amd64 on Solaris 10
I wanted to post this before I move onto my next problem, so excuse the brevity. When compiling ffmpeg on Solaris 10 for 64bit, you may encounter this particular block of errors, which come out of the assembly found inside libavcodec/cabac.h:
/var/tmp//ccC7vvHU.s:8035: Error: `-1(%ebx)' is not a valid 64 bit base/index expression /var/tmp//ccC7vvHU.s:8038: Error: `ff_h264_norm_shift(%ecx)' is not a valid 64 bit base/index expression /var/tmp//ccC7vvHU.s:8060: Error: `ff_h264_lps_range(%eax,%esi,2)' is not a valid 64 bit base/index expression /var/tmp//ccC7vvHU.s:8070: Error: `ff_h264_norm_shift(%esi)' is not a valid 64 bit base/index expression /var/tmp//ccC7vvHU.s:8072: Error: `ff_h264_mlps_state+128(%eax)' is not a valid 64 bit base/index expression /var/tmp//ccC7vvHU.s:8084: Error: `-1(%ebx)' is not a valid 64 bit base/index expression /var/tmp//ccC7vvHU.s:8087: Error: `ff_h264_norm_shift(%ecx)' is not a valid 64 bit base/index expression /var/tmp//ccC7vvHU.s:8107: Error: `ff_h264_lps_range(%eax,%esi,2)' is not a valid 64 bit base/index expression /var/tmp//ccC7vvHU.s:8117: Error: `ff_h264_norm_shift(%esi)' is not a valid 64 bit base/index expression ... /var/tmp//ccC7vvHU.s:32827: Error: `ff_h264_norm_shift(%esi)' is not a valid 64 bit base/index expression
The issue is that FFMpeg has failed to detect "BROKEN_RELOCATIONS". Simply set this in your config.h like so:
export CFLAGS=-m64 export LDFLAGS=-m64 ./configure --prefix=/tmp/ffmpeg --arch=x86_64 --cpu=nocona --disable-encoder=nellymoser echo '#define BROKEN_RELOCATIONS 1' >> config.h gmake-3.81
I’ve missed a lot of detail out here, such as all the patches we use to get ffmpeg building on Solaris, but I’ll hopefully find more time tomorrow to post a blog entry about it.
Some interesting tidbits of information: FFMpeg with –enable-shared is 3 times slower, so I wouldn’t advise enabling this flag unless you absolutely need it. And the 64bit ffmpeg binary is twice as fast at transcoding wmv to flv over a 32bit one (in the basic not-very-fancy test I used). So it is worth investing time in compiling up a 64bit version.
Here’s a performance comparison going from a 32bit ffmpeg with –enable-shared and –disable-mmx on gcc 3.4, to a 64bit ffmpeg with –disable-shared and –enable-mmx on gcc 4.4:
# time /opt/ec/bin/ffmpeg -y -i ~/test2.wmv ~/test2.flv
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/opt/ec --enable-shared --enable-nonfree --enable-gpl --enable-libamr-nb --enable-libamr-wb --enable-libdirac --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --disable-encoder=nellymoser --disable-mmx --enable-avfilter --disable-debug --enable-swscale --enable-postproc --enable-pthreads
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on May 1 2009 14:25:24, gcc: 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, asf, from '/export/home/alasdair/test2.wmv':
Duration: 00:11:04.65, start: 3.000000, bitrate: 172 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, mono, s16, 32 kb/s
Stream #0.1: Video: wmv1, yuv420p, 320x240, 180 kb/s, 25 tbr, 1k tbn, 1k tbc
Output #0, flv, to '/export/home/alasdair/test2.flv':
Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: libmp3lame, 44100 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame=16637 fps=263 q=12.6 Lsize= 22485kB time=665.48 bitrate= 276.8kbits/s
video:16626kB audio:5200kB global headers:0kB muxing overhead 3.016455%
real 1m3.285s
user 1m0.043s
sys 0m0.471s
# time ./ffmpeg-64 -y -i ~/test2.wmv ~/test2.flv
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/tmp/ffmpeg --arch=x86_64 --cpu=nocona --disable-encoder=nellymoser
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
built on May 3 2009 04:42:52, gcc: 4.4.0
Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, asf, from '/export/home/alasdair/test2.wmv':
Duration: 00:11:04.65, start: 3.000000, bitrate: 172 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, mono, s16, 32 kb/s
Stream #0.1: Video: wmv1, yuv420p, 320x240, 180 kb/s, 25 tbr, 1k tbn, 1k tbc
Output #0, flv, to '/export/home/alasdair/test2.flv':
Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: adpcm_swf, 44100 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame=16637 fps=1799 q=12.0 Lsize= 31483kB time=665.48 bitrate= 387.6kbits/s
video:16624kB audio:14375kB global headers:0kB muxing overhead 1.561981%
real 0m9.356s
user 0m8.937s
sys 0m0.291s
The encode time has gone from 63 seconds to just 9 seconds! That’s a *huge* speed up. I’m rather impressed.
I’m also guessing that compiling all the ffmpeg dependencies as shared object .so files will have the same slowdown as ffmpeg with –enable-shared, so I’m going to try building all the dependencies as static libraries instead.
It’s now approaching 5am so I should really go off to bed, but I’m glad I finally got this knocked on the head.
4 comments May 3rd, 2009
What is Solaris? Why should I be using it?
Solaris is Sun Microsystem’s flagship Unix based operating system. It is free to obtain and use, and Sun opened the Solaris source code under an Open Source license in 2005.
It is robust, highly scalable and incredibly powerful; actively maintained by Sun, new features are being introduced on a regular basis. Paid commercial support is available. It fully supports Intel & AMD CPUs, ensuring it runs on the vast majority of commodity hardware such Dell & HP.
Solaris contains many killer features. If you’re currently using Linux, FreeBSD, Mac OS X, or another Unix varient, you should consider checking it out.
We are a big Solaris user here at EveryCity, providing Managed Solaris Hosting to our customers, via our dedicated and cloud based hosting platform, along side our Windows and Linux hosting offerings.
Killer Features
Solaris has a huge number of features, too many to mention. We will cover off some of the key features that we make heavy use of, many of which we severely miss when we use other operating systems.
ZFS Filesystem
ZFS is a revolutionary filesystem that throws history to the wind, doing away with the traditional link between files, filesystems and partitions. ZFS utilises a notion of “pooled storage”, where you allocate disks to a pool. You can then dynamically create filesystems on the fly, which all share the pool of storage. You can, for example, give each user their own ZFS filesystem.
ZFS filesystems support compression, encryption and quotas. The ZFS filesystem is atomic - transactions are either fully comitted or not comitted at all. There is no fsck/chkdsk tool, data on disk is always consistent, meaning that after an unexpected power loss, the system boots without needing to perform a lengthy disk check.
Storage Pools can be created with RAID levels, with ZFS supporting RAID0, RAID1, RAID10, RAID-Z (Raid 5) and RAID-Z2 (Raid 6). ZFS stores data blocks on disk with a CRC error checking hash, and ZFS will detect silent data corruption and report on it. If you are using RAID with parity (1, 10, Z or Z2), ZFS will recover from the corruption by utilising the parity data. This ensures ZFS can for example recover from the scenario where a disk in a RAID array is silently corrupting data. No commercial RAID card on the market can currently recover from this particular failure mode.
ZFS supports snapshots, which are virtually free and incredibly easy to do. Filesystem snapshots are immediately available, via a hidden “.zfs” directory, that let you view the filesystem at the time of the snapshot. Snapshots are read only, and can be "cloned" to produce full read/write filesystems. They are great for producing backups.
ZFS snapshots are incredibly powerful, and very useful. A great example is the Solaris liveupgrade utility, which is used to upgrade Solaris to a new release. liveupgrade will snapshot the root ZFS filesystem before performing the upgrade. If the upgrade fails, you can rollback to the snapshot, saving you having to restore from backups. We use ZFS snapshots internally on our backup server to store incremental daily backups.
ZFS contains many more features that we haven’t even begun to touch on, such as send/receive, separate log devices, the ARC and L2ARC caching systems, and many many more. We love ZFS, and now simply can’t imagine life without it.
Zones / Containers
Solaris Zones (Or "Containers" as you may hear them being referred to) are similar to FreeBSD Jails. They are virtualised Solaris installations that you can SSH into, install applications inside, and use just like a real physical server. Solaris Zones differ from other virtualisation technologies in that they all run on top of a single Kernel, with little or no overhead. Zones cannot for example run Linux or Windows inside, because they are not a hardware virtualisation solution - they are a logical virtualisation technology that groups system processes/users/resources into discrete units.
Zones are very powerful, and Solaris provides a full management framework for creating, starting, stopping, cloning and modifying them. Since there is little or no overhead, Zones are incredibly fast, and it is entirely feasible to run enterprise applications such as Oracle inside a zone. Zones are cheap to create, using very little memory. As an example, one might create a database Zone for MySQL, a production Zone with Apache for a live website, and a staging Zone also with Apache for development.
Zones support resource controls, such as CPU, memory, number of processes, etc, providing a great method of partitioning up a system. Resources are pooled, in that you set a memory cap, rather than allocating a specific quantity of RAM, allowing you to overcommit.
We use Solaris Zones for our cloud computing environment, and cannot sing their praises enough. We can deploy a brand new fully working Zone, including installing all necessary key applications such as Apache, PHP, MySQL, etc, within 1 to 2 minutes.
Service Management Framework
Sun has done away with the old System V init scripts that users of Linux may be familiar with. Instead, in Solaris, we have the Service Management Framework, part of Sun’s "Predictive self healing" strategy. SMF manages services via a set of command line tools, "svcs", "svcadm" and "svccfg". SMF can detect and restart failed services, tracks dependencies, starts services in parallel, and stores it’s configuration in XML based manifests (which you don’t need to touch, unless you’re creating a new service).
SMF is incredibly powerful, and makes managing services incredibly easy.
Versions of Solaris
Solaris comes in several versions. Solaris 10 is Sun’s commercial, stable operating system, available free of charge. New release come out on a roughly 6 month basis, which often introduce new major features, whilst maintaining backwards compatibility providing maximum stability. We utilise Solaris 10.
OpenSolaris is the open source edition of Solaris. It contains radical new features and bleeding edge technologies. It is relatively new, and evolving quickly with releases every 6 to 12 months. It provides a great way to try out new features, and is very stable, with many companies using it in a production environment. Commercial support is also available from Sun.
Solaris also has development editions, such as Solaris Express Community Edition, and you can also obtain the OpenSolaris codebase and build this yourself.
Conclusion
I hope you found the above interesting. Solaris is not without it’s flaws, and Sun are working hard to address them. For example, Solaris 10 currently lacks an integrated centralised package management system. But this feature has been developed, is present in OpenSolaris, and should hopefully arrive in Solaris 11.
We wouldn’t have made such a heavy investment in time and energy to use Solaris if we didn’t strongly believe in it’s technological benefits, and we urge others to play with it and give it a go. Perhaps you’ll fall in love with it as much as we have.
4 comments March 6th, 2009
Compiling MySQL-python on Solaris 10
This one can be a bit of a nightmare on Solaris, due to typical Solaris complications. There are two key things to watch out for.
First thing to watch out for, is that MySQL-python includes both pyconfig.h and my_config.h, both of which on Solaris may include SIZEOF_ definitions. If you’re using Sun Web Stack 1.4, the my_config.h file is for 64bit, but we’ll no doubt be compiling as 32bit. Our recommendation is to compile up your own mysql client library and link against this (see my previous post about compiling things against the Sun Web Stack 1.4 MySQL).
The second thing to watch out for is that Python and MySQL both record the compiler options they were compiled with. For example, -fPIC, -Wall, etc. MySQL-python blindly passes these to whatever compiler you’re using. These may be the wrong arguments, generating all sorts of warnings and/or errors. Ones like these:
# MySQL compiled with Sun Studio, Python compiled with gcc, we're compiling with Sun Studio: building '_mysql' extension creating build/temp.solaris-2.10-i86pc-2.5 creating build/temp.solaris-2.10-i86pc-2.5/src /opt/SUNWspro/bin/cc -OPT:Olimit=0 -DNDEBUG -O -Kpic -Dversion_info=(1, 3, 0, 'f inal', 0) -D__version__=1.3.0 -I/opt/webstack/mysql/include/mysql -I/opt/python2 .5/include/python2.5 -c src/mysqlmod.c -o build/temp.solaris-2.10-i86pc-2.5/src/ mysqlmod.o -xarch=386 -xchip=pentium -xspace -xildoff -xc99=all -xnorunpath -m32 -DBIG_TABLES -DHAVE_RWLOCK_T cc: Warning: illegal option -OPT:Olimit=0 "/usr/include/sys/feature_tests.h", line 332: #error: "Compiler or options inval id for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications" cc: acomp failed for src/mysqlmod.c error: command '/opt/SUNWspro/bin/cc' failed with exit status 2 # MySQL compiled with gcc, Python compiled with Sun Studio, we're compiling with gcc: building '_mysql' extension creating build/temp.solaris-2.10-i86pc-2.5 creating build/temp.solaris-2.10-i86pc-2.5/src gcc -OPT:Olimit=0 -DNDEBUG -O -Kpic -Dversion_info=(1, 3, 0, 'final', 0) -D__version__=1.3.0 -I/opt/ec/mysql_client/include/mysql -I/opt/python2.5/include/python2.5 -c src/mysqlmod.c -o build/temp.solaris-2.10-i86pc-2.5/src/mysqlmod.o -DHAVE_RWLOCK_T gcc: unrecognized option `-Kpic' cc1: error: invalid option argument `-OPT:Olimit=0' # etc, there are quite a few combinations here
Our solution to this was to find out what your python is compiled with (Sun Studio or gcc) by looking in the “lib/python*/config/Makefile” file (relative to where python is installed), compile up your own MySQL client library using the same compiler, then compile MySQL-python with that same compiler.
Don’t forget to set the LDFLAGS environment variable with -L and -R paths to your MySQL client library path and Python library path, so that MySQL-python can find the libraries when it compiles.
Add comment March 6th, 2009
Compiling things against the Sun Web Stack MySQL
Sun have done an interesting thing with Web Stack 1.4, and have churned out both 32bit and 64bit libraries and binaries for Apache, PHP, MySQL, etc (On Solaris 10 anyway). The 64 bit versions can be found in their amd64 folders, and things like Apache & MySQL can be told to start in 64bit mode by tweaking their manifests. So for example, you have:
In: /opt/webstack/apache2/2.2/bin: ./httpd: ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, stripped ./amd64/httpd: ELF 64-bit LSB executable AMD64 Version 1 [SSE FXSR CMOV FPU], dynamically linked, stripped
One downside of this is that Sun have forgotten a vital subtlety. There is a header file that ships with MySQL called "my_config.h", which contains SIZEOF_ entries for the data types, eg SIZEOF_LONG. It’s autogenerated by autoconf, and the my_config.h that comes with Sun Web Stack 1.4 contains SIZEOF_ entries that are 64bit sized. There is no 32bit version of the file. This is no good if you want to link against MySQL in 32bit mode. We became aware of this error when compiling MySQL-python 1.3, which includes pyconfig.h as well, which also defines SIZEOF_LONG, so we were getting:
warning: "SIZEOF_LONG" redefined
There are perhaps ways of fixing or getting around this, such as stealing a my_config.h from a 32bit sized MySQL installation and altering the #include statement of whatever you’re compiling. But the safest solution we went with was to compile our own MySQL client from source, doing something along the lines of:
export CC=/opt/SUNWspro/bin/cc export CXX=/opt/SUNWspro/bin/CC ./configure --without-server --enable-thread-safe-client --prefix=/opt/mysql_client gmake gmake install
You can then compile your application against this client library. A lot of things that build against mysql use the mysql_config program to get their compiler options. So if you do compile up your own mysql client, you’ll want to make sure it’s mysql_config is in your path.
2 comments March 6th, 2009
Compiling syslog-ng 3.0.1 on Solaris 10
This one was giving me an endless amount of pain, until I realised it was to do with the fact it was trying deperatly hard to compile against static versions of libraries that Solaris only provides dynamically (or something along those lines!).
The Glib Solaris 10 package is too old to be used so we’ll need to grab the latest version of glib and compile this up - it’s fairly easy. You’ll also need to grab and compile libevent (The one written by the author of syslog-ng, not the Linux kernel related dooderywhatsit). Then we can compile up syslog. It doesn’t like Sun Studio, and you’ll want to set –disable-static-linking.
export CFLAGS="-I/opt/local/include -I/usr/sfw/include -I/opt/sfw/include" export CPPFLAGS=$CFLAGS export LDFLAGS="-L/opt/local/lib -R/opt/local/lib -L/usr/sfw/lib -R/usr/sfw/lib -L/opt/sfw/lib -R/opt/sfw/lib" export CC=gcc export CXX=g++ ./configure --prefix=/opt/ec --enable-ssl --enable-pcre --disable-ipv6 --disable-static-linking --enable-dynamic-linking --disable-glibtest gmake gmake install
These things are harder than they should be.
3 comments January 30th, 2009
Solaris, Ruby and iconv.
Solaris 10 has a native C library version of iconv. Unfortunately it lacks various features people might want to use, such as transliteration. You can see an example of this here:
# ruby -e "require 'iconv'; p Iconv.iconv('ascii//ignore//translit', 'utf-8', 'Tést')"
-e:1:in `iconv': invalid encoding ("ascii//ignore//translit", "utf-8") (Iconv::InvalidEncoding)
from -e:1
Other people have commented on the problem, for example on this blog here. One suggestion is to install SUNWgnu-libiconv and utilise LD_PRELOAD. The SUNWgnu-libiconv package isn’t around on Solaris 10 (that I know of), so we need to compile up our own libiconv. And LD_PRELOAD is an inelegant, somewhat difficult to implement and potentially dangerous environment variable.
This sadly means we need to recompile things from source. But hey, it’s Solaris! I’m sure you’re used to this by now. So it’s time to get your recompiling hat on and build libiconv and Ruby. A fairly generic build would go something along these lines (feel free to alter all the “/opt/local” paths to suit your own requirements:
# mkdir -p /opt/src
# cd /opt/src
# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.12.tar.gz
# gtar -zxf libiconv-1.12.tar.gz
# cd libiconv-1.12
# ./configure --prefix=/opt/local
# gmake
# gmake install
# cd /opt/src
# cat <<EOF > /tmp/ruby.patch
--- ruby-1.8.6-p287.good/ext/iconv/extconf.rb Mon Feb 12 23:01:19 2007
+++ ruby-1.8.6-p287/ext/iconv/extconf.rb Thu Jan 29 19:07:45 2009
@@ -22,6 +22,7 @@
end
end
$defs.push('-DICONV_INPTR_CONST')
+ $DLDFLAGS += ' -L/opt/local/lib -R/opt/local/lib -liconv'
end
if conf
prefix = '$(srcdir)'
--- ruby-1.8.6-p287.good/ext/iconv/iconv.c Thu Jan 29 19:10:58 2009
+++ ruby-1.8.6-p287/ext/iconv/iconv.c Thu Jan 29 18:20:56 2009
@@ -16,7 +16,7 @@
#include "ruby.h"
#include <errno.h>
-#include <iconv.h>
+#include </opt/local/include/iconv.h>
#include <assert.h>
#include "st.h"
#include "intern.h"
EOF
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
# gtar -zxf ruby-1.8.7-p72.tar.gz
# cd ruby-1.8.7-p72
# patch -p1
# export LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib -L/opt/local/lib -R/opt/local/lib"
# export CFLAGS="-I/usr/sfw/include -I/opt/local/include"
# export CPPFLAGS=$CFLAGS
# ./configure --prefix=/opt/ruby
# gmake
# gmake install
The above patch basically overrides the iconv that’s used. If you’re feeling fruity, you could grab the source to Sun Web Stack and modify their Ruby, which includes DTrace patches.
1 comment January 30th, 2009
Enabling 64bit MySQL on Solaris Sun Web Stack 1.4
Sun Web Stack 1.4 includes both a 32bit and 64bit MySQL, with the standard bin/mysqld and bin/amd64/mysqld binaries.
By default, the SMF service sun-mysql50 runs in 32bit mode. To enable 64bit mode, simply:
# svccfg -s sun-mysql50:default svc:/application/database/sun-mysql50:default> listprop sun-mysql50 application sun-mysql50/action_authorization astring solaris.smf.manage.sun-mysql/default sun-mysql50/bin astring /opt/webstack/mysql/5.0/bin sun-mysql50/data astring /var/opt/webstack/mysql/5.0/data sun-mysql50/value_authorization astring solaris.smf.value.sun-mysql/default sun-mysql50/enable_64bit boolean true method_context framework method_context/group astring mysql method_context/limit_privileges astring :default method_context/privileges astring :default method_context/project astring :default method_context/resource_pool astring :default method_context/supp_groups astring :default method_context/use_profile boolean false method_context/user astring mysql method_context/working_directory astring /var/opt/webstack/mysql general framework general/enabled boolean true restarter framework NONPERSISTENT restarter/logfile astring /var/svc/log/application-database-sun-mysql50:default.log restarter/contract count 105 restarter/start_pid count 606 restarter/start_method_timestamp time 1233237617.117424000 restarter/start_method_waitstatus integer 0 restarter/auxiliary_state astring none restarter/next_state astring none restarter/state astring online restarter/state_timestamp time 1233237617.119195000 svc:/application/database/sun-mysql50:default> setprop sun-mysql50/enable_64bit=true svc:/application/database/sun-mysql50:default> exit # svcadm refresh sun-mysql50 # svcadm disable sun-mysql50 # svcadm enable sun-mysql50 # ps -ef | grep mysql mysql 649 490 0 14:00:06 ? 0:00 /bin/sh /opt/webstack/mysql/5.0/bin/64/mysqld_safe --user=mysql --datadir=/var/ mysql 747 649 0 14:00:06 ? 0:22 /opt/webstack/mysql/5.0/bin/64/mysqld --basedir=/opt/webstack/mysql/5.0 --datad
And as we can see from the process list, the 64 bit binary has been launched instead of the 32 bit one.
Add comment January 29th, 2009
Compiling Python 2.6 on Solaris 10
Sorry for not posting so much lately. Work has been busier than ever - it’s quite incredible. Just a quick post on compiling Python 2.6, which was giving me a few problems.
Dependencies
I’d recommend throwing on ncurses and readline from the Solaris 10 companion CD, the packages are SFWncur and SFWrline. The full dependency list is:
P SFWncur P SFWrline P SUNWbzip P SUNWcry P SUNWcsl P SUNWcslr P SUNWcsr P SUNWgccruntime P SUNWlibms P SUNWlibmsr P SUNWopenssl-libraries P SUNWzlib
Compiling
The _ctype module fails to compile with Sun Studio 12. Rather than fix this, I simply used gcc instead. Also Python seemed to be missing _ssl, so I popped in the appropriate library paths. Thus:
export "LDFLAGS=-L/opt/sfw/lib -R/opt/sfw/lib -L/usr/sfw/lib -R/usr/sfw/lib" export "CPPFLAGS=-I/usr/sfw/include -I/opt/sfw/include -I/opt/sfw/include/ncurses" export "CFLAGS=-I/opt/sfw/include" export "LIBS=-lncurses" export CC=gcc CXX=g++ ./configure --prefix=/opt/python26 --enable-shared --disable-ipv6 --with-threads --with-libs="-lncurses" --with-wctype-functions gmake gmake install
Not all the modules will compile, but the ones that were missing were not of importance (sqlite, bsdbd, etc).
1 comment January 27th, 2009
Rules and Resolutions of 2009

As an earthly mortal human, I have an obligation to make the most of my short life here in the universe. Being born, here & now, in the free modern world, during what is arguably our civilizations peak, is one of the greatest miracles of luck imaginable. Squandering my life, or shortening it, would be incredibly foolish. So without further ado, here is my list of new years resolutions with this in mind.
The Eco Warrior
Recycling.
I like to recycle, and am the only person in our office who relentlessly separates out the trash into recyclables and non-recyclables. However the cleaner often comes and empties our makeshift recycling bins into the regular trash, and my work colleagues simply do not separate their waste. Whilst I can encourage them to recycle more, they simply won’t do it unless it’s incredibly easy (my work colleagues are very busy people). Thus I hearby decree I will have the business purchase office recycling bins.
Cycling.

I cycled into work for a few weeks towards the end of summer, and it was good. I even bought designer handle bars for my bike to make it look prettier. However when the weather got bad, the cycling ceased. What’s worse, I replaced it with driving a Honda Civic Type-S 2.0 Litre gas guzzler into work. Every single day. And you know what else is worse? I constantly forgot to pay the congestion charge, racking up over £600 in fines over the past 12 months. This is bad. Very bad.
Well while I purchased a Ken Buster just before Christmas to protect me from getting any more Congestion Charge fines (Which mysteriously hasn’t been delivered yet), I must stop driving everywhere. I hereby decree I will purchase winter cycling gear! Warm gloves, thermal technical clothing, and some kind of hat for keeping my ears warm. I have also negotiated permission to leave my bicycle in the front room of our house, instead of having to retrieve it from the shed each time I wish to use it.
I also must learn to cycle slowly. I am alarmingly competitive, and on the bike would try to beat my time into work each day, often resulting in the occasional sugar crash, wobbly legs or sick-for-the-whole-morning feelings. Bad Alasdair.
And I must also commit to taking the train on days it’s too terrible to cycle in. Why oh why can’t the overground railways implement Oyster Prepay for us ad-hoc travellers! *shakes fists*
Improve Health

Eat. I am notoriously bad for skipping meals, in particular breakfast, due to laziness and bad habits. I am also terrible for replacing meals with cupboard food, normally in the form of chocolate and biscuits! This morning is a classic example - wake up, turn on laptop, oh! Box of after eights left over from xmas, what a delicious brekfast substitute *nom nom nom*.
I therefore hereby decree I will do my very little best to eat a proper breakfast each day. I will also order fewer take aways, cook more, learn to cook more meals (I quite enjoy cooking when I can find the time to unplug (see below)).
I also decree I will dramatically cut my intake of sweets and delicious carbonated beverages.
Sleep (less). I am exceptionally bad at getting up. I love sleeping. Mmmm sleep. Just thinking about it makes me sleepy. But you know what? Sleeping so god damn much makes me lethargic, ineffective, late for work, and results in me wasting vast quantities of valuable life.

A classic example is getting up at 2pm on Saturday and Sunday, then spending the day doing very little, followed by rushing to the supermarket before it closes on Sunday at 4pm. I then struggle to get to bed on time, fail to get into work on time on Monday, and generally start the week off on a bad foot. BAD. MUST NOT DO THIS ANY LONGER.
Exercise. I do believe I covered this off above under "Cycling".
Personal Improvement

Me, circa 5+ years ago!
Times have changed.
Appearance. I am a busy person (and a lazy one). As such my hair often grows past it’s cut by date, and my wardrobe is full of clothes I don’t like and don’t wear. I can be seen wearing the same pair of jeans 7 days a week. I occasionally let my designer stubble turn into a hobo beard. It has also been so long since I put product in my hair that I no longer posses the skills required to style it. Recent experiments in this area were an unmitigated embarrassing disaster.
I refuse to give in and become an unfashionable, unpresentable sandle wearing hippie. I resolve to stylise myself into a fashionable presentable person. Anyone care to take me shopping?

Socialising. My years of getting smashed, clubbing till 9am, depriving myself of sleep and vomiting on night busses are officially behind me. However I’m not going to let that stop me socialising. I resolve to go to the pub, attend more dinner parties, go to more social events, go to the cinema, museums, and generally attend the plethora of entertainment activities available.
Become More.
Learning. 2008 was a great year of learning. I think I learned more in 2008 than I did in the 3 years preceding it, especially with regards to work. We’ve gone from being a Linux focused company, to being a Solaris focused company. We’ve got many exciting projects underway involving the latest in breakthrough technologies. 2009 is going to be an exciting year ahead, and I need to keep on top of things and spend much time learning.
Contributing. In 2008, I can’t really say I contributed terribly much back to society. In 2009, I want to change that. I want EveryCity to be at the forefront of community activity, particularly with regards to Solaris. There’s a lot of knowledge we have internally about Solaris that may benefit others, and packages we use that would benefit the community.
I also fully intend to write a book on Solaris Administration. When I got started in Solaris, there were no good books on Amazon on the topic. They were all out of date or utterly irrelevant. I aim to change this. I’m hoping I can write something of the sort of quality that O’Reilly would be interested in publishing. We’ll see how much spare time I have!
UNPLUG
Lastly, in 2009 I need to unplug more. 2008 was a hectic year for me - I don’t believe I’ve ever been busier. Being so busy is alarmingly stressful, and I have noticed a few grey hairs appearing! 2009 must be less stressful, more enjoyable, and more relaxing. I need to spend time at home relaxing rather than working. I need to delegate more to my staff, and I need to spend what time I do have off, not attached to a computer.
I hope everyone has had a good 2008, and I wish all the best for 2009 :)

5 comments December 30th, 2008


