Apr 29, 2010

Access ALOM-Port of a Sun Fire V100 from Opensolaris Build 134

Today I had to install an old Sun Fire V100 server.

The Server has no onboard display. There is only a serial console
with a RJ45 plug. For the Sun Systems you got a converter from RJ45
to serial console.

By using a standard LAN cable, you can connect with the adaptor.


On my laptop is OpenSolaris Build 134 running.

To connect, I found a hint here.

Nothing has to be changed, just start
tip /dev/term/a -9600

and the system is connected.

You can switch between the installed system and the ALOM with the key-sequence #..

Apr 28, 2010

ssh-agent in Solaris 10

In OpenSolaris the ssh-agent features is started via the gnome-keyring-daemon.

In Solaris 10, I've found a hint in Stacey Marshall's Weblog.

An addtion to the $HOME/.dtprofile

#
# Start SSH agent
#
if [ "$SSH_AUTH_SOCK" = "" -a -x /usr/bin/ssh-agent ]; then
  pkill -u $LOGNAME ssh-agent
  eval `/usr/bin/ssh-agent`
fi
executes the ssh-agent and kill's an older one.

This allows a password free login. 

Apr 26, 2010

Netbeans 6.9 Beta for download -> Python plugins are available

The 6.9 Beta version of Netbeans.  The plugin  diaolog lists the
Python and Jython plugins.

The download and installing was ok.

Apr 15, 2010

python writexml fails with xml.dom.minidom, when using ISO-8859-1 encoding and e.g. character ö

I'm processing XML Files with python ( 2.4.2 and 2.6.2  makes no difference ).

The XML file stored in encoding ISO-8859-1 and contains a ö in the value
for an attribute:


content= "Löschungsgrund" />

I just attempted to load the XML file and write it to a different file:

>>> d=xml.dom.minidom.parse( "AUSW_KUEND.xml" )
>>> f=open("/tmp/a", "w" )
>>> d.writexml( f )
Traceback (most recent call last):
  File "", line 1, in
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 1749, in writexml
    node.writexml(writer, indent, addindent, newl)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 817, in writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 817, in writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 817, in writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 812, in writexml
    _write_data(writer, attrs[a_name].value)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 303, in _write_data
    writer.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 1: ordinal not in range(128)
Using the encoding of writexml():

>>> d.writexml(f, '', '', '', "ISO-8859-1" )

also doen't work, because the code just uses this encoding to write
the XML-Header in the new document.

The hint so successfully write the document came from here.

>>> import codecs
>>> f=codecs.open( "/tmp/aaa.xml", "w", "ISO-8859-1" )
>>> d.writexml( f, '', '','', "ISO-8859-1" )

with the same DOM-Object d as before, the new document is written without problems and the correct encoding.

Apr 8, 2010

Setting environment variable for services managed with SMF

Solaris 10 uses the SMF-Framework to manage the services started in the
system.

The configuration is stored in a database and can be managed with the
command svccfg.

This week we had to reboot a lot of servers, because of changes of the
power cords.

After booting again, some systems fail to work, because on some of them
where tomcat's installed and the were started manually.

From here, I got a package with a SMF manifest for tomcat. 

The manifest uses some default-Values, which were not suitable for me.

svccfg -s tomcat:default
svc:/network/tomcat:default>setprop start/exec= astring: /opt/apache-tomcat-5.5.20/svc-tomcat start


and some other values.
The reason to change the path, was that the /lib directory is readonly in
a sparse zone.

To set the environment correctly, I found a solution in this blog,
how to set JAVA_HOME, CATALINA_HOME, CATALINA_BASE 


svccfg -s tomcat:default setenv -m stop JAVA_HOME /usr/java

The user is nobody to use for starting tomcat, so the installation directory
was also changed
chown -R nobody:nobody apache-tomcat-5.5.20


svcadm refresh tomcat 
svcadm enable tomcat 

started the service with the SMF-Framework.