Archive

Archive for the ‘Zones/Containers’ Category

Mediatomb and Solaris 10

June 13th, 2009

Now that I rebuilt the server, it was time to put media tomb on it to share media with the PS3. To get it to compile on Solaris (fresh 05/09 Update 7 install patched with the latest security and recommended patches), there are a couple of things you have to do (most of this is from http://blogs.sun.com/constantin/entry/mediatomb_on_solaris with some additional stuff I had to do:

1. Download the latest version of the “file” program from ftp://ftp.astron.com/pub/file/ (my case the current is 5.03)
2. Unzip/untar the file
3. Configure and run make:

gzip -d file-5.03.tar.gz
tar -xvf file-5.03.tar
cd file-5.03
./configure –prefix=/usr/local/file
gmake
su – root -c "gmake install"

3. There are a bunch of other requirements for mediatomb, the easiest way to get them is to use www.blastwave.org. The packages that I installed are:
CSWbdb4
CSWbzip2
CSWcurl
CSWcurlrt
CSWexpat
CSWfaac
CSWfaad2
CSWfconfig
CSWffmpeg
CSWffmpeglib
CSWftype2
CSWgcc3corert
CSWgcc3g++rt
CSWgcrypt
CSWggettext
CSWgpgerr
CSWiconv
CSWid3lib
CSWimlib2
CSWisaexec
CSWlame
CSWliba52
CSWlibid3tag
CSWlibidn
CSWlibnet
CSWlibogg
CSWlibsdl
CSWlibssh2
CSWlibtool
CSWlibtoolrt
CSWlibx11
CSWlibxau
CSWlibxcb
CSWlibxdmcp
CSWncurses
CSWoldaprt
CSWossl
CSWossldevel
CSWosslrt
CSWosslutils
CSWpixman
CSWpng
CSWsasl
CSWsdlmixer
CSWsqlite3
CSWsqlite3dev
CSWstl4
CSWsunmath
CSWtaglibgcc
CSWtheora
CSWtiff
CSWungif
CSWvorbis
CSWxvid
CSWzlib

4. Once these are installed, you can download mediatomb and compile it. http://mediatomb.cc/pages/download

gzip -d mediatomb-0.11.0.tar.gz
tar -xvf mediatomb-0.11.0.tar
cd mediatomb-0.11.0
./configure –prefix=/mediatomb –enable-iconv-lib –with-iconv-h=/opt/csw/include –with-iconv-libs=/opt/csw/lib –enable-libmagic –with-magic-h=/usr/local/file/include –with-magic-libs=/usr/local/file/lib –with-taglib-cfg=/opt/csw/bin/taglib-config –with-curl-cfg=/opt/csw/bin/curl-config –with-sqlite3-libs=/opt/csw/lib –with-sqlite3-h=/opt/csw/include –with-search=/opt/csw –with-id3lib-h=/opt/csw/include –with-id3-libs=/opt/csw/lib
gmake

However before you can run gmake, you need to edit a couple of files. One is the src/main.cc, you need to comment out lines 128 through 141. This is not needed for Solaris. The second file to edit is a result of this:

During the compile I got an error that looked like this:

../src/url.cc:78:53: macro "curl_easy_setopt" requires 3 arguments, but only 2 given
../src/url.cc: In member function `zmm::Ref<zmm ::StringBuffer> URL::download(zmm::String, long int*, CURL*, bool, bool, bool)‘:
../src/url.cc:78: warning: statement is a reference, not call, to function `curl_easy_setopt’

To fix it edit the src/url.cc file and on line 78 change it from this:

curl_easy_setopt(curl_handle, CURLOPT_NOBODY);

to this :

curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1);

Then rerun gmake . Once the compile is finished, su to root and do a gmake install, it will place all the media tomb stuff in /mediatomb. (I am using a Zone on a Solaris 10 machine so / has plenty of space).

I then created a user for mediatomb to be run under, so a user and group called mediatmb were created, and all the /mediatomb directories and files were changed to be owned by mediatmb

Once that was done, login as the mediatmb user and create a script in /mediatmb/bin with the following in it:

LD_LIBRARY_PATH=/opt/csw/lib:/usr/local/file/lib:/usr/sfw/lib
export LD_LIBRARY_PATH
./mediatomb –ip x.x.x.x –port 49194 –daemon –pidfile /tmp/mediatomb.pid –logfile=/tmp/mediatomb.log

where x.x.x.x is the IP address of the machine you are running it on. In Constantin’s blog, he mentioned also using the interface, but I found that it had problems since this was a zone. So instead of using the interface, I used the IP address of the zone.

The changes I made to the config.xml in the ~/.mediatomb directory are as follows:

-bash-3.00$ diff orig-config.xml config.xml
6a7
> <account user=”unixwiz” password=”video”/>
23c24
< <protocolInfo extend=”no”/><!– For PS3 support change to “yes” –>

> <protocolinfo extend=”yes”/><!– For PS3 support change to “yes” –>
44a46
> <magic -file>/usr/local/file/share/misc/magic.mgc</magic>
46a49,50
> <map from=”mpg” to=”video/mpeg”/>
> <map from=”JPG” to=”image/jpeg”/>
61c65
< <!– <map from=”avi” to=”video/divx”/> –>

> <map from=”avi” to=”video/divx”/>

Now all you have to do is login to the web interface and add the media, following mediatomb’s documentation.

Some interesting things I have found with it:

1. If your PS3 is on wireless it may have problems streaming mp4, but not mpeg2. Weird I know as the mpeg2 was solid streaming at 370kb/s, but it couldn’t handle the mp4. Switching to a hardwired connection fixed that problem.

2. If you happen to be a ReplayTV user [cause TiVO is a wanna be replay ;-) ] you can use MediaTomb in conjunction with DVArchive, which also runs nicely in my Solaris zone. Just point a media directory at the Local_Guide directory and mediatomb will stream every MPEG2 file in that directory to your PS3. Which is pretty damn cool.

3. The PS3 is very pickly about it’s mp4 type files. Some that I made with handbrake don’t work, but ones I did with ffmpegx worked once I put the hardwired connection in.

4. I have not tried any of the transcoding stuff. I would rather do that before and not bog down my server doing that.

5. I need to do a lot of reading on how to make folders and the such so that my collection is organized and not just all under one directory.

For those interested:
My compile environment is setup like this:

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/sfw/bin:/usr/ccs/bin:/usr/local/bin:/opt/csw/bin
SHELL=/bin/tcsh

Random Stuff, Solaris, Zones/Containers , , ,

OpenSolaris vs Solaris

October 13th, 2008
Comments Off

This weekend I went to install the new Communications Suite with Convergence and I decieded to install OpenSolaris 2008.5 on my machine and put the Comms Suite in a zone on it (so I could easily blow it away after my testing was done..)

Let me be probably not the first to say that OpenSolaris != Solaris.. I have been using Solaris 10 since it was in beta, and OpenSolaris through me for a couple of loops…

First are some of the cool things I liked:

1. The interface, it is updated and seemed a lot faster.

2. The ease of “patching” only took about half an hour to do a pkg image update.

3. Zfs root made it easy to roll back changes..

Now the parts that i had problems with and did not like too well.

1. I had to download a driver for my ethernet card as the one Sun delivers (sk98sol) is still too old and did not support my card which is one built on to a 3+ year old motherboard.

2. To create a zone, you MUST have a network connection (and at least to the internet for the time being). This really made me mad as I sometimes don’t have access to the Internet, and if I need to create a zone, I don’t want to have to wait for it to download 200+ Mb of packages, that are already on the machine in the first place.

3. No more “full root zones”, I created a zone in the hopes of installing the Comms Suite in it, only to find out that it was not a full root zone and stuff that is required by the Comms Installer to be there wasn’t and therefor I could not install it… Such simple things like unzip and perl are missing from the newly created zone.

In the end, I ended up reinstalling the box with Solaris 10 05/08, which was a task in itself. See when you install OpenSolaris it makes the root drive zfs, and did  some weird things to the VTOC. Therefore when I went in to do the install of the “older” Solaris 10 05/08, the installer would show me the disk, let me “carve” it up like I wanted in the gui and via command line, but when the install went to go on, the installer always came back saying that there was not enough disk to install Solaris. What I ended up having to do was go and do a “format -e” and then fdisk and delete the Solaris partition that was made by OpenSolaris, and let the Solaris installer create it’s own fdisk partition again.

So after finally getting Solaris 10 installed and the latest Recommended/Security/Sun Alert patches put on, I called it a night and left the Comms install for next weekend.

Overall I think OpenSolaris is going in the right direction, but there needs to be a lot of things fixed in it.. The biggest is the zones, there should be an option for “cloning” the already installed OS, since it is already on a ZFS pool. The second is that there should be an option when creating the zone as to what kind of zone it should be, whether a full (which would load every package, so you don’t have to try and do it  your self), sparse or maybe a new one called Jail which has everything in it read only.

OpenSolaris, Rant, Solaris, Zones/Containers , , ,

Solaris 10 with zones and patching

September 24th, 2006
Comments Off

One little draw back I have noticed about using zones on solaris 10 is the amount of time it takes to patch a machine. Right now I am waiting on a SunFire 890 with 8 processors and 16gb of ram with 12 zones (counting the global) to finish patching. I started it at around 8:54 this morning and it is now 11:16 and there are still 2 or 3 patches left to go. Since all the zones are basicly sparse zones, I wonder why it takes so much longer to do the patching? I also hope all this patching fixes my Power supply problem We have replaced the power supplies a couple of times, and the power distribution bored. I put the latest OBP on it this morning and it did not seem to fix it either. So hopefully after this set of patches are done, I will have a better idea whether it is a hardware or software problem.

Solaris, Sun, Work, Zones/Containers , , ,

Interesting Sun Ray problem

September 14th, 2006
Comments Off

I got called the other night by our operations group because the keyboard and mouse would not work on their 3 head group of Sun Ray 150′s. So I went in and killed their session and had them restart it, did not work. So I went looking in the log files and saw this:

Sep 11 17:53:41 [10.198.11.221.2.2] 0×0.0x1c392b7 0:3:ba:3c:1b:c1 USB: enable change: 2 lost enable state!
Sep 11 17:53:41 [10.198.11.221.2.2] 0×0.0x1c392b7 0:3:ba:3c:1b:c1 USB: enable change: 4 lost enable state!
Sep 11 20:28:44 [10.198.11.221.2.2] 0×0.0x2a1 0:3:ba:3c:1b:c1 USB: usb port 1 overcurrent
Sep 11 20:28:46 [10.198.11.221.2.2] 0×0.0×307 0:3:ba:3c:1b:c1 USB: usb port 2 overcurrent
Sep 11 20:28:46 [10.198.11.221.2.2] 0×0.0x36d 0:3:ba:3c:1b:c1 USB: usb port 3 overcurrent
Sep 11 20:28:47 [10.198.11.221.2.2] 0×0.0x3d3 0:3:ba:3c:1b:c1 USB: usb port 4 overcurrent
Sep 11 20:28:48 [10.198.11.221.2.2] 0×0.0×439 0:3:ba:3c:1b:c1 USB: usb port 5 overcurrent
Sep 11 20:45:34 [10.198.11.221.2.2] 0×0.0×291 0:3:ba:3c:1b:c1 USB: usb hub port 4 overcurrent!
Sep 11 20:45:35 [10.198.11.221.2.2] 0×0.0x2f9 0:3:ba:3c:1b:c1 USB: usb hub port 1 overcurrent!
Sep 11 20:45:36 [10.198.11.221.2.2] 0×0.0x35f 0:3:ba:3c:1b:c1 USB: usb hub port 2 overcurrent!
Sep 11 20:45:37 [10.198.11.221.2.2] 0×0.0x3c5 0:3:ba:3c:1b:c1 USB: usb hub port 3 overcurrent!
Sep 11 20:45:38 [10.198.11.221.2.2] 0×0.0x42b 0:3:ba:3c:1b:c1 USB: usb hub port 5 overcurrent!
Sep 11 20:46:21 [10.198.11.221.2.2] 0×0.0×304 0:3:ba:3c:1b:c1 USB: usb hub port 1 overcurrent!
Sep 11 20:46:22 [10.198.11.221.2.2] 0×0.0x36a 0:3:ba:3c:1b:c1 USB: usb hub port 2 overcurrent!
Sep 11 20:46:23 [10.198.11.221.2.2] 0×0.0x3d0 0:3:ba:3c:1b:c1 USB: usb hub port 3 overcurrent!
Sep 11 20:46:24 [10.198.11.221.2.2] 0×0.0×436 0:3:ba:3c:1b:c1 USB: usb hub port 4 overcurrent!
Sep 11 20:46:25 [10.198.11.221.2.2] 0×0.0x49c 0:3:ba:3c:1b:c1 USB: usb hub port 5 overcurrent!

Well that could not be good. So I ended up going in to the office. Tried unplugging the Sun Ray and plugging it back in. This is when I saw the 9 D error icon. Nice little icon with a picture of a USB connector and a yellow triangle. So I unplugged it and disconnected the keyboard and mouse and then plugged it back in. Still got the same error. The funny thing about the error is, it is listed as this in the docs:

This is an over current condition on the USB bus, i.e., the total number of devices draws too much current . Consider using a powered hub.

So now I ended up swaping it out with one that was in my office and rebuilding the multi-head group, and they were all set. The interesting thing about it is that the status LED stayed green, instead of turning amber. So the next morning I tried it on a different server (the original server it was attached to is running SRSS 2.0 still) that was running SRSS 3.1, this time nothing showed up in the log files, but the Sun Ray still showed the USB 9 icon and the keyboard and mouse did not work. So I ended up calling it in for replacement. It is nice that the Sun Ray’s have a long warrenty period. This one was bought 2 or 3 years ago.

In an unrelated note, I have to go in early to get a power backplane replaced in one of our V890′s because we have went through three power supplies in the PS0 slot in under a month. The bad part about this is the 890 has 11 zones on it and 1TB of disk, so we are going to have some services out while Sun replaces the backplane and power supply. Hopefully this will fix it though.

Computer Hardware, Interesting, Solaris, Sun, Sun Ray, Thin Clients, Work, Zones/Containers , , , , , , ,

Zfs on home server

July 24th, 2006
Comments Off

Time to Backup 300+ gig of data: 8 hours
Time to install Solaris 10 06/06 : 1 hour
Time to fix the PATA controller card: 10 minutes
Time to create a mirrored 387 gig ZFS file system: 5.2 seconds

For some people MS Windows is the only thing they know, but for others if you use Solaris and ZFS, things go much faster and are much better.

Now that I have a ZFS file system, I can clone my zones instead of having to install each one. I really like zfs!

One note, that I came across creating a zfs file system. One of the disks previously had a ufs file system on it and it would not let me create the pool. to get around it I did this:

zpool create -f tempspace c1d0s0

The error that caused me to do this was:

# zpool create tempspace c1d0s0
invalid vdev specification
use ‘-f’ to override the following errors:
/dev/dsk/c1d0s0 contains a ufs filesystem.

Solaris, ZFS, Zones/Containers , ,