Currently, Opensolaris does not provide a Postfix package. Although there exist packages on blastwave and on OpenCSW they are either outdated or do not play well together.
Fortunately, Ihsan Dogan did create a script to create Postfix packages from scratch as well as some precompiled packages. Unfortunately, these packages miss SASL support. So I was in need to compile these myself.
You will obviously need the Postfix sources and the package script:
1
2
3
4
5
6
7 | wget http://de.postfix.org/ftpmirror/official/postfix-2.7.1.tar.gz
gunzip -c postfix-2.7.1.tar.gz | tar -xf -
wget http://ihsan.dogan.ch/postfix/downloads/makePostfixPkg.sh
chmod +x makePostfixPkg.sh
cd postfix-2.7.1
|
Since Opensolaris b130, NIS+ was removed from the system. As Postfix does not know that, it not compile as it defines a dependency to it. However, it can be disabled by simply applying the following patch:
1
2
3
4
5
6
7
8
9
10 | --- src/util/sys_defs.h 2010-06-02 01:56:57.000000000 +0200
+++ src/util/sys_defs.h 2010-06-14 22:08:35.596113543 +0200
@@ -400,7 +400,6 @@
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/mail/aliases"
#define HAS_NIS
-#define HAS_NISPLUS
#define USE_SYS_SOCKIO_H /* Solaris 2.5, changed sys/ioctl.h */
#define GETTIMEOFDAY(t) gettimeofday(t)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
|
Just put that patch into a file called nisplus.patch and patch the code:
1 | patch -p0 < nisplus.patch
|
(found on estibi’s Solaris blog)
Before actually compiling Postfix, we need some packages:
1
2
3
4
5
6 | # First install the sunstudio compilers and some additional
# development tools
pkg install sunstudio12u1 object-file
# ...and some additional libraries and tools
pkg install libsasl pcre
|
Now we can generate the makefile, compile and generate the SRV4 package. We will tell the compilers to include the default Cyrus SASL library for client authentication as well as the Dovecot library which I will use later to connect both servers and authenticate SMTP users.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | # Clean up first and after failed attempts
make tidy
# Generate the makefile
make makefiles CCARGS='-DUSE_TLS -DHAS_LDAP \
-DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\"dovecot\" \
-DUSE_CYRUS_SASL -I/usr/include/sasl'
AUXLIBS="-L/usr/lib -lsasl -lssl -lcrypto -lldap"
CC=/opt/sunstudio12.1/bin/cc
# Build
make
# Create the package if the build succeeded
../makePostfixPkg.sh
|
The makePostfixPkg will create a Solaris package named something like CNDpostfix-2.7.1,REV=100614-SunOS5.11-i386.pkg inside the Postfix directory. This package can then be installed like this:
1
2
3
4
5
6
7
8 | # make sure you removed the default Sendmail package first if it installed
#pkg uninstall sendmail
# install the package
pkgadd -d CNDpostfix-2.7.1,REV=100614-SunOS5.11-i386.pkg CNDpostfix
# Configure the package to your needs. Then enable the service
svcadm enable svc:/network/postfix:default
|
Opensolaris has done some huge steps towards being usable by a normal person. Sadly there are still some things lacking sane defaults which I try to provide here. I will try to update this post if I stumble over more of these hiccups.
Correct colors on exit of an ncurses program
If an ncurses program (like nano) exits, the default xterm-color does not properly restore the colors of the terminal. The background color is shown in a dark gray. For a quick relieve you can issue a short
As this is rather cumbersome, I think it is better to adjust out terminfo definitions.
1
2
3
4 | TERM=xterm-color infocmp > /tmp/xterm-color.src
sed -i -e 's/op=\\E\[100m,/op=\\E\[m,/' /tmp/xterm-color.src
pfexec tic -v /tmp/xterm-color.src
rm /tmp/xterm-color.src
|
The solution is from the Opensolaris Bug, the rough steps from Peter Harvey.
Fixing some key bindings
By default some essential key bindings do not work properly. This can be fixed by just reassigning them. The following statement has to be run as root.
1
2
3
4
5
6
7
8
9
10
11
12 | cat >> /etc/profile <<EOF
# home key
bind '"\e[1~":beginning-of-line'
# del key
bind '"\e[3~":delete-char'
# end key
bind '"\e[4~":end-of-line'
# pgup key
bind '"\e[5~":history-search-forward'
# pgdn key
bind '"\e[6~":history-search-backward'
EOF
|
You have to logout and login again for these settings to take effect. Alternatively you could just enter the individual bind statements into your current terminal.
The bindings are from Epiphanic Networks’ Wikka.
This is mainly a pointer for me to remember things. .
If you have an OpenSolaris 200x.xx installed as a minimal image (like that one) you will notice that there is a rather unfriendly assortment of locales installed:
1
2
3
4 | locale -a
C
POSIX
iso_8859_1
|
What we (or at least I) want instead is the “default” locale en_us.UTF-8
Google has pointed me to the localeadm tool to solve this. However this tool seems not to be available anymore on Opensolaris. Instead, one is expected to do the following:
1 | pkg install lang-support-english
|
This installs ca. 135 MB of packages. Unfortunately one of them is a complete X.org server which I specifically did not want to install in the first place as the system is intended to be a server where I deem an X server to be just unnecessary cruft. Fortunately, it is not started by default, so it seems, I have to live with that.
another call of locale -a shows us a much friendlier view on the system:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 | locale -a
C
POSIX
en_AU
en_AU.ISO8859-1
en_AU.UTF-8
en_CA
en_CA.ISO8859-1
en_CA.UTF-8
en_GB
en_GB.ISO8859-1
en_GB.ISO8859-15
en_GB.ISO8859-15@euro
en_GB.UTF-8
en_IE
en_IE.ISO8859-1
en_IE.ISO8859-15
en_IE.ISO8859-15@euro
en_IE.UTF-8
en_MT.UTF-8
en_NZ
en_NZ.ISO8859-1
en_NZ.UTF-8
en_US
en_US.ISO8859-1
en_US.ISO8859-15
en_US.ISO8859-15@euro
en_US.UTF-8
iso_8859_1
|
To setup our newly installed locale, just put this line
into the file /etc/default/init and reboot the system.
Sigh, sometimes are things so much easier on the Linux side of life.
The hint to the solution came from the OpenSolaris Forum btw.
Update 2010-02-23
You can also just install the locale files without the overhead that comes from lang-support-english. Just install on Opensolaris < Build 133
1 | pkg install SUNWlang-enUS
|
or on Opensolaris >= Build 133
1 | pkg install system/locale/en_us
|
Two years ago I bought a ReadyNAS NV+ with 4 500 GB drives based on the recommendation of Volker Weber. It served its purpose well and runs 24/7 without any problem at all. However recently I started to have issues. The most important one was simply that the device is now filled to the rim. While that could be solved by just using larger disks (or not ripping all of my DVDs onto disk), the other major issue would still stand.
The device is just too slow. Using AFP or CIFS I barely get more than 10 MByte/sec top (measured using dd from /dev/zero with a blocksize of 32k). This doesn’t look like a device capable of Gigabit speed. Besides, during these tests the CPU of the ReadyNAS ran at about 90% load so there is obviously not much more to expect from that device.
So being too cheap to buy one of the new ReadyNAS Pros while craving for that extra speed and wanting to learn something new, I opted into building a new system from ground up. As I have heard very nice stories about (Open)solaris (I’m looking a you, Jörg) I decided that Opensolaris would be the new OS of choice. I just wanted to see and use all that ZFS goodness by myself.
Unfortunately as I bought only Macs recently I was fairly outdated regarding a diverse knowledge of PC hardware. So I started browsing (Heise FTW!) and finally found some decent hardware (at least on paper) which I ordered today. The main problem here was Solaris compatibility, so amost everything was checked against the HCL.
For me, the most important piece was the enclosure as I intended to put a lot of disks in it. Or at least could be able to add more of them later without having to add additional enclosures. There are some modestly prices server enclosures on the market. However, as I don’t own a rack (yet) these where of reach. So I opted into a tower case from Lian Li - more specifically the PC-A17B. Which allows to add 9 external 5.25″ devices. As I obviously not want to insert 5.25″ disk drives, I searched for an enclosure to convert that bays into 3.5″ bays for normal hard disks. Initially I fell in love with the Lian Li EX-H34B which allows 4 disk drives to be used in 3 5.25″ bays while providing hot-plug capabilities. Unfortunately these babes were nowhere to find for delivery in the german internets in a reasonably timeframe.
So I opted into 3 Silverstone CFP52B together with 12 Silverstone CP05 which also provide hot-plug capabilities while looking pretty decent together with the Lian Li enclosure.
For the other hardware, I had a hard time deciding between Intel and AMD. Finally I settled with Intel as it promised a wee bit more compatibility with Opensolaris (at least on consumer boards and CPUs). I ordered an Asus P5QL-CM together with an Intel E7400 (45nm, 2.8 GHz, 65W TDP) and 4 GB of Kingston RAM. The board combination allows me to use 6 SATA disk drives now and add an additional controller and more drives later if needed. I’m a bit concerned regarding the Realtek network chip on board. Furtunatlty I have two spare Intel Pro/1000 GT adapter lying around. So this hopefully will not be a huge problem
Regading the drives, I ordered 6 Western Digital WD10EADS which are going to be connected to the onboard SATA ports and a DeLOCK IDE Flash Modul 40Pin 8GB Vertical as a boot device connected to the “old” PATA port. Let’s see how that works…
I further entries, I will go into details about my journey into Solaris. But first I’m going to wait for my hardware to arrive.