Saturday Jan 06, 2007

Update: running SlimServer on Solaris



Eric Bautsch has kindly given me permission to post his latest updates for running slimserver on Solaris. He has made a few improvements over my previous scripts, so you might want to use these instead.


Here is a shell script used to build the slimserver distribution:

cd /usr/local
gunzip -c /sw/src/audio/slimserver/SlimServer_v6.5.0.tar.gz | tar xfv - \\
        >> ${LOG} 2>&1
mv SlimServer_v6.5.0 slimserver >> ${LOG} 2>&1
mkdir /usr/local/slimserver/cachedir >> ${LOG} 2>&1
chown -R slimsrv:slimsrv slimserver >> ${LOG} 2>&1
cd slimserver/Bin >> ${LOG} 2>&1
export PATH=${PATH}:/opt/SUNWspro/bin:/usr/sfw/sbin
echo "/usr/bin/perl\\n/usr/local/slimserver\\n/tmp" | \\
        ./build-perl-modules.pl >> ${LOG} 2>&1
cd /tmp/XML-Parser\* >> ${LOG} 2>&1
perl Makefile.PL EXPATLIBPATH=/usr/sfw/lib EXPATINCPATH=/usr/sfw/include \\
        >> ${LOG} 2>&1
cd /usr/local/slimserver/Bin >> ${LOG} 2>&1
echo "/usr/bin/perl\\n/usr/local/slimserver\\n/tmp" | \\
        ./build-perl-modules.pl >> ${LOG} 2>&1
cp -p /sw/src/audio/slimserver/my.tt /usr/local/slimserver/MySQL >> ${LOG} 2>&1
cp -p /sw/src/audio/slimserver/slimrun /usr/local/slimserver >> ${LOG} 2>&1

svccfg import /sw/src/audio/slimserver/slimserver_manifest >> ${LOG} 2>&1
svcadm enable slimserver >> ${LOG} 2>&1

Note: The above double call of the build-perl-modules.pl with the manual build of XML-Parser was neccessary because XML parser requires expat but appears to be unable to pick up that it's in /usr/sfw, despite set PATH and LD_LIBRARY_PATH.

my.tt is simply modifed in that mysql provided in /usr/sfw does not like innodb, default-character-set and default-collation, so I have hashed these out.

slimrun is attached and simply sets the PATH to find mysqld prior to calling slimserver.



Here is the slimrun script:


#!/bin/sh

PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/i86pc/sbin:/usr/sfw/bin:/usr/sfw/sbin
export PATH

exec /usr/local/slimserver/slimserver.pl --cachedir=/usr/local/slimserver/cachedir --user=slimsrv --group=slimsrv --audiodir=/apps/jukebox/NEW/xmcd --prefsfile=/usr/local/slimserver/cachedir/slimserver.pref --pidfile=/usr/local/slimserver/cachedir/slimserver.pid $\*





Here is the updated manifest

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='slimserver'>
  <service name='application/slimserver' type='service' version='1'>
        <create_default_instance enabled='false'/>
        <single_instance/>
<dependency name='name-services' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/milestone/name-services' />
</dependency>
<dependency name='network' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/milestone/network' />
</dependency>
<dependency name='local-filesystems' grouping='require_all' type='service' restart_on='none'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
        <exec_method type='method' name='start'
                exec='/usr/local/slimserver/slimrun --daemon'
                timeout_seconds='30' />
        <exec_method type='method' name='stop'
         exec=':kill'
                timeout_seconds='30' />
        <stability value='Unstable' />
        <template>
               <common_name>
                        <loctext xml:lang='C'>Slim Server</loctext>
                </common_name>
                <documentation>
                        <doc_link name='SlimDevices Home' uri='http://www.slimdevices.com/'/>
                </documentation>
        </template>
  </service>
</service_bundle>





powered by performancing firefox

Sunday Dec 11, 2005

Solaris SlimServer 6.x SMF manifest





If you are are Slim Devices fan (easily the best home MP3 device on the market), you can run the software quite nicely on Solaris. The SlimServer software is written in Perl - so it runs on almost anything. However - there are a couple of Perl modules that require a C compiler to install. You can do some hacking and use gcc, but your best bet is download the Studio 11 compilers (the default Perl makefiles assume you are using the Sun C compiler).

Here is a service manifest that I hacked together for starting SlimServer ( I am a SMF newbie, so feel free to offer improvements :-)

[Update: Thanks to tips from Stephen and Dave, the associated service method is no longer required. The process can be directly started with the exec method - and :kill can be used to shut it down].



<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='slimserver'>
  <service name='application/slimserver' type='service' version='1'>
        <create_default_instance enabled='false'/>
        <single_instance/>
<dependency name='name-services' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/milestone/name-services' />
</dependency>
<dependency name='network' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/milestone/network' />
</dependency>
<dependency
name='local-filesystems' type='service' restart_on='none'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
        <exec_method type='method' name='start'
                exec='/usr/local/slimserver/slimserver.pl -daemon'
                timeout_seconds='30' />
        <exec_method type='method' name='stop'
         exec=':kill'
                timeout_seconds='30' />
        <stability value='Unstable' />
        <template>
               <common_name>
                        <loctext xml:lang='C'>Slim Server</loctext>
                </common_name>
                <documentation>
                        <doc_link name='SlimDevices Home'
                                uri='http://www.slimdevices.com/' />

                 uri='http://www.slimdevices.com/' />
                </documentation>
        </template>
  </service>
</service_bundle>

Tuesday Nov 15, 2005

xorg.conf file for a Ferrari 4002

I spent a few hours struggling to get Xorg working (Solaris 11 Build 27a) on a Ferrari 4002. Hopefully the following config file will save folks some time. I don't have the MergedFB option working right now - but everything else looks good. If you have any improvements please share!


[Note if you have the Ferrari 4005 you should use Casper's xorg.conf file included as part of his frkit].




Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "USBMouse"
	InputDevice    "Touchpad" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	RgbPath      "/usr/X11/lib/X11/rgb"
	ModulePath   "/usr/X11/lib/modules"
	FontPath     "/usr/X11/lib/X11/fonts/TrueType/"
	FontPath     "/usr/X11/lib/X11/fonts/Type1/"
	FontPath     "/usr/X11/lib/X11/fonts/Type1/sun/"
	FontPath     "/usr/X11/lib/X11/fonts/F3bitmaps/"
	FontPath     "/usr/X11/lib/X11/fonts/misc/"
	FontPath     "/usr/X11/lib/X11/fonts/100dpi/"
	FontPath     "/usr/X11/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
	Load  "IA"
	Load  "Xst"
	Load  "dbe"
	Load  "extmod"
	Load  "record"
	Load  "xtrap"
	Load  "glx"
	Load  "bitstream"
	Load  "type1"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "keyboard"
EndSection

Section "InputDevice"
	Identifier  "Touchpad"
	Driver      "mouse"
	Option	    "Protocol" "PS/2"
	#Option	    "Synaptics" "false"
	Option	    "Device" "/dev/kdmouse"
	Option      "Emulate3Buttons" "true"
	Option      "SendCoreEvents"
	Option	    "Sensitivity" "20"
	#Option	    "Mickeys" "12"
	#Option	    "EdgeScroll" "false"
	Option	    "BottomScroll" "false"
	#Option	    "LeftHanded" "true"
	Option     "Tapping" "true"
EndSection

Section "InputDevice"
	Identifier  "USBMouse"
	Driver      "mouse"
	Option	    "Protocol" "VUID"
	Option	    "Device" "/dev/mouse"
	Option      "SendCoreEvents"
EndSection

Section "Monitor"
	#DisplaySize	  330   210	# mm
	Identifier   "Monitor0"
	VendorName   "SEC"
	ModelName    "0"
	 Modeline "1280x800"   68.90  1280 1301 1333 1408  800 804 808 816
	#HorizSync	28-100
	#VertRefresh	40-72
EndSection

Section "Device"
     
        	
        Option "MonitorLayout" "LVDS,CRT"

      
	# set to false - doesnt seem to work
        Option     "MergedFB"           	"false"
	# This is needed so that you can merge two screens of different sizes
        Option     "MergedNonRectangular" 	"true"
        Option     "CRT2HSync" 			"30-100"
        Option     "CRT2VRefresh"      		"40-75"
        Option     "CRT2Position"		"Clone"
      
	Option	    "MetaModes"   "1280x800-1280x1024 1024x768-1024x768"
	# Added by warren - help to save power 
	Option 	"DynamicClocks" "on"
	Identifier  "Card0"
	Driver      "ati"
	VendorName  "ATI Technologies Inc"
	BoardName   "Radeon Mobility X700 (PCIE)"
	BusID       "PCI:1:0:0"
	
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
		Modes	  "1280x800" "1024x768"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
		Modes	  "1280x800" "1024x768"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
		Modes	  "1280x800" "1024x768"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
		Modes	  "1280x800" "1024x768"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
		Modes	  "1280x800" "1024x768"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
		Modes	  "1280x800" "1024x768"
	EndSubSection
EndSection

End

Wednesday Jan 26, 2005

Getting Identity Manager 5.0 running in a Solaris 10 Container + App Server 8.1

Yesterday I installed Identity Manager (formely Waveset) into a Solaris 10 Container running App server 8.1 (from the soon to be released JES 2005Q1).

Here are some notes for those that might want to repeat the process.

First we need to bring up a zone to run IDM in. The JES installer requires a "non sparse" zone install (in other words, it should not inherit any packages or directories from the global zone). Here is my zone configuration (modify as required for your environment, and create the zone with zonecfg):


# zonecfg -z jes export 
create -b
set zonepath=/export/home/zones/jes
set autoboot=true
add fs
set dir=/export/home/download
set special=/export/home/download
set type=lofs
end
add net
set address=129.155.57.233
set physical=bge0
end
add attr
set name=comment
set type=string
set value="JES 3 zone set up by warren"
end

This is a fairly vanilla zone install. One directory (/export/home/download) is shared with the global zone, but everything else is unique to the zone. Kinda nice to be able to install software in an isolated environment without having to worry about screwing up something else on the system!

When you first log in to the zone (via zlogin -z jes), you are prompted for the usual initial configuration (e.g. root password, terminal type, naming service etc.). I'll skip this part since it is fairly easy.

Step 2 is to get a database running for the IDM account index. IDM supports mySQL 4.0.x, and this also happens to be included with the Solaris 10 distribution (look in /usr/sfw).

I opted to run mySQL under it's own account which I created with the following commands:

groupadd mysql
mkdir /export/home/mysql
useradd -s /usr/bin/bash -g mysql -d /export/home/mysql mysql
chown mysql ~mysql
chown mysql /var/mysql/

cat << HERE  >~mysql/.profile
export PATH=$PATH:/usr/sfw/bin:/usr/sfw/sbin
HERE

I start MySQL by su'ing to the mysql account and running the following command:

/usr/sfw/sbin/mysqld_safe &
MySQL needs to be initialized (once only) with the following command:

# Create the db
/usr/sfw/bin/mysql_install_db


You can (optionally) set the root password:

mysqladmin -u root -p password
New Password:XXXXX

Next step is to create the database schema for IDM. In your IDM installation media you can find scripts for all of the supported databases. For mySQL, I used the following:


cd <IDM-INSTALL>/db_scripts
mysql -u root -p 
Password: XXXXX
source create_waveset_tables.mysql

exit

Having fun yet? Now we install the App Server. I wont go into a lot of details on this - as I pretty much just ran the JES installer GUI, and selected the Application Server (and associated dependencies). I created the following .bashrc to make it easy to start and stop the app server:

export TERM=xterm

export AS_ADMIN_USER=admin
export AS_ADMIN_PASSWORD=XXXXXXX

export PATH=/opt/SUNWappserver/sbin:$PATH:/usr/sfw/bin:/usr/sfw/sbin

export MANPATH=/usr/man:/usr/sfw/man

Now we start the App Server administration instance:

# asadmin start-domain        
Starting Domain domain1, please wait.
Log redirected to /var/opt/SUNWappserver/domains/domain1/logs/server.log.
WARNING: The --password option is insecure and should not be used since it can compromise your password.  Please use either the command prompt or the --passwordfile option.

You can now log on to the (very sweet...) App Server admin gui (the default port is 4849) https://server:4849/.

You have the option of running a web app in the same container as the admin instance itself (default listeners at 8080/8081). This is NOT recommended for production (you should create a standalone instance or a cluster) - but for development it is very nice as it supports exploded war file installs. This allows you make changes in the web application directory which can be dynamucally redployed by the App Server.

The IDM installer will unpack the distributed war file to the specified directory (/export/home/idm in my case). After prompting for the license key information, it will ask you if you want to run setup. Before you say yes, go and grab the mySQL JDBC driver. Unpack the driver distribution and put the driver in your WEB-INF/lib directory (/export/home/idm/WEB-INF/lib, for example).

Now you are ready to complete the IDM installation. Choose mySQL as the repository. The installer will ask you to import a default configuration file - which you will want to do. If all goes well the initial objects and sample data will be imported in to the mysql database

Now back to the app server console. From the Home->Common Tasks tab, choose "deploy Web application". You will want to choose the second option "Specify a package file or a directory path that must be accessible from the server." In our example, specify the path /export/home/idm. For reasons previously mentioned, you can only deploy the exploded war to the default server-config instance. Once you have deployed, you should be able to bring up the /idm context with your browser.

Two Caveats:

  1. I found it necessary to remove the policy manager setting (look under the instance JVM settings in the console):
    # Remove this
    -Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy 
    
    [Note that you could also make the appropriate changes in server.policy - but I'm lazy :-)]
  2. You will probably find you get a JCE error when you first bring up the application. This is because the cryptix jars in the idm/WEB-INF/lib directory conflict with the JCE implementation provided by the App Servers JDK. The solution to this is to remove the cryptix jars, and redeploy the application. Because we installed with an exploded war file, you can get the App Server to redeploy with the following command:
    touch /export/home/idm/.reload

Whew!

You should now have a working IDM install. Have fun....

Friday Nov 19, 2004

Zones: Not just for geeks

The server consolidation pendulum seems swings back and forth from large consolidated (SMP) architectures to single blade CPUs racked and stacked to the sky. Inevitably, the momentum always seems to come back to the form factor of:

one project == one (or more) servers

Why? Consolidation sounds wonderful in practice - but there a lot of operational issues that come in to play. Consolidated environments require monumental planning for change control. You need to gain agreement with all of the communities that share the server. Not all of them will want the change, or see it as desirable ("the last time you guys upgraded you broke my database"). Much politiking and calls to directors will ensue when one group threatens to block the change, or another insists they can't meet their schedule without it.

Access to consolidated environments also needs to be tightly controlled due to high risk of having all your eggs in one basket. Limited root access sounds like a good thing (TM) but it is often necessary to give out administrative access to a system in order let some SME install a complex piece of software. Often the policy of "no project root access" is relaxed when it becomes expedient.

And finally, some software products don't easily co-exist in a consolidated environment. You may need to install multiple versions of a product to support a legacy environment.

For these reasons, many organizations lean towards providing isolated server environments for each project. This makes the developers happy (they have their own sandbox to play in), but makes the folks who sign the cheques rather peeved (you are telling me I have 2 floors of rack mounted servers, running at 5% utilization, and I need to buy more?)

Zones provide nice lightweight alternative to over consolidated environments that keep us geeks happy (we each get our own sandbox), and make the accountants ecstatic (you mean I dont need to buy another box? )?

Some of the practical beneifits:

  • They provide administrative isolation: Each project can be given full access to thier own zone. The project manager is happy (they can use their own resources to install software), and the UNIX admins can sleep at night knowing the developers can only mess up their own environment :-)
  • Supporting multiple releases or instances becomes simple. Zones are easy to create - so there is no reason why a project group can't have dozens of instances ( for dev, qa, individual developer sandboxes, etc.).
  • When people start to trust the technology to provide true isolation, they don't mind sharing the server with other groups. Utilization goes up

There are so many cool things in Solaris 10, but I think customers are going to find zones as the big ticket item. This will really change the way people think about deploying services.

About

Things that amuse me

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
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
30
   
       
Today
News

No bookmarks in folder

Blogroll