20110911

Blind Administration

A few weeks ago I've lost the ability to see any output form my MacBook Pro.

It was a second time. For the first time I had lost the embedded led display only.
The DVI output worked fine. Then came the healing power of promise - I have to buy a new one.
But threat without the coverage it's just the bucket of words.
The MBP makes me blind completely and definately. No video output. No remote access.
No working ssh daemon, no firewall access, no future.

I thought the target mode would be the cure.
I have PowerBook Pismo with Tiger onboard. Unfortunately, the data on MBP was encrypted with
a FileVault from Snow Leopard. Either try of target mode connection, or try of manual mount failed.

Collecting of the recipe components took me many hours, often filled with an exasperation.
Hidden typos. Invisible prompts. Lurking daemons.

The recipe.
It's here to remember. It's here to save other souls.

Power On.
Listen to chime and wait a few moments, then log in yourself:
username TAB
password

Open Applications
⌘+Shift+A
and invoke your favourite text terminal by typing its name, followed by CMD+O
i t e r m ⌘+O

Confirm you're in:
$ say ok
$ sudo su
> put your password <
Confirm your personality.
$ whoami | say
Let the dogs out. Select a race, choose wisely.
$ launchctl load -w /System/Library/LaunchDaemons/telnet.plist # enable configuration and
$ launchctl load -w /System/Library/LaunchDaemons/ssh.plist    # set Disable key to false
$ launchctl start com.apple.telnetd
$ launchctl start com.openssh.sshd
Check the locks.
$ defaults read /Library/Preferences/com.apple.alf globalstate | say
2
Firewall states
  • 0 - de-activated
  • 1 - on for specific services
  • 2 - on for essential services
Open the gates.
Pretty enough for older systems (Tiger), where no reboot required:
$ ipfw flush
> 'y' to flush <
$ ipfw list | say # 'any to any' means success
Permanent solution:
$ defaults write /Library/Preferences/com.apple.alf globalstate -int 0
$ reboot
Connect and enjoy it.

Mount USB Disk drive.
sh-3.2# diskutil list| grep SAM
   1:             Windows_FAT_32 SAMSUNG                 2.0 TB     disk2s1
sh-3.2# diskutil mountDisk SAMSUNG
Volume(s) mounted successfully
Rsync your secrets.

20110103

db2setup start failure on Debian/Ubuntu

Two late evenings of life - that was the time cost of the solution discovery.
I had tried to put the DB2 Express-C 9.7.2 on 64-bit Linux system, and I failed either on Ubuntu 8.04 LTS
or on Debian 5.0 (I know it is not recommended/supported solution).

The first and the last problem was related to the db2setup startup error.
It can be seen from the console just like that:

# ./db2setup
DBI1190I db2setup is preparing the DB2 Setup wizard which will guide
you through the program setup process. Please wait.


#

But, there was the trail in the error log:

# cd /tmp
# cat db2setup.err
Exception in thread "main" java.lang.UnsatisfiedLinkError: awt (An exception was pending after running JNI_OnLoad)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:998)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:962)
at java.lang.System.loadLibrary(System.java:465)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:69)
at java.security.AccessController.doPrivileged(AccessController.java:202)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1605)
at java.awt.Toolkit.(Toolkit.java:1627)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at java.awt.AWTEvent.(AWTEvent.java:220)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:167)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:167)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:167)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:37)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:920)
at java.lang.reflect.Field.getFieldAccessor(Field.java:901)
at java.lang.reflect.Field.get(Field.java:360)
at com.ibm.db2.tools.common.support.AssistManager.loadVKeys(Unknown Source)
at com.ibm.db2.tools.common.support.AssistManager.(Unknown Source)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at DB2Setup.(Unknown Source)
at DB2Setup.main(Unknown Source)
#

Let me start from the beginning.

# ./db2setup
WARNING:
Can't use string to find the version of libstdc++.
Check the following web site for the up-to-date system requirements
of IBM DB2 9.7
http://www.ibm.com/software/data/db2/udb/sysreqs.html
http://www.software.ibm.com/data/db2/linux/validate
The force option "-f sysreq" is used to force the installation ...

DBI1190I db2setup is preparing the DB2 Setup wizard which will guide
you through the program setup process. Please wait.



The DISPLAY variable is not set properly. Ensure that the DISPLAY variable is set properly and that permissions are set properly to open windows on the display specified, then rerun the command.
#

Even with the -f sysreq there was no visible progress.
Before the installation begins I have installed the libaio1 and libstdc++6 as it was mentioned in the online documentation.

The installation was on the remote server, so to verify that X11 session forwarding works fine I had to install xauth and use the ssh -Y option.

# xauth list
digestive.deadsystems.com/unix:10 MIT-MAGIC-COOKIE-1 a957c95c1c862f5314b32e88c5bd9e17
# echo $DISPLAY
localhost:10.0

I have used the xarclock to check that the remote app is being displayed fine on my laptop.

"Can't use string to find the version of libstdc++." -
it was resolved by simple binutils package installation (to get the strings binary).

But, there was no progress yet.

# ./db2setup
WARNING:
The 32 bit library file libstdc++.so.6 is not found on the system.
32-bit applications may be affected.
DBI1190I db2setup is preparing the DB2 Setup wizard which will guide
you through the program setup process. Please wait.


#

Then I thought that the /tmp/db2setup.err contains the java related exception, but there is no java vm on the machine.

# java -version
-ksh93: java: not found [No such file or directory]

After the sun-java6-jre installation there was still nothing more.

# java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)


A few search queries more and I have found a tip:

GUI applications, such as the JConsole monitoring tool, on 64-bit Ubuntu with a 32-bit JVM
When running a 32-bit JVM on a 64-bit Ubuntu system, GUI applications do not start because some AWT libraries are missing. To fix the problem, install the 32-bit libraries using the ia32-libs package:
sudo apt-get install ia32-libs
The following exception is thrown if the libraries are not available:
Exception in thread "main" java.lang.UnsatisfiedLinkError: awt (An exception was pending after running JNI_OnLoad)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:993)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:962)
at java.lang.System.loadLibrary(System.java:465)
... lines removed for clarity ...
If problems are encountered with DNS name resolution, install the package lib32nss-mdns.

But neither ia32-libs nor lib32nss-mdns installation helped me to go further.
The only benefit was the lack of warning message:

WARNING:
The 32 bit library file libstdc++.so.6 is not found on the system.
32-bit applications may be affected.

Then It looked like:

# ./db2setup
DBI1190I db2setup is preparing the DB2 Setup wizard which will guide
you through the program setup process. Please wait.


#

After the additional few hours of digging through the differences between the library sets on two machines,
on which the first have the fully operational DB2 instances and the second is the reported unlucky node, I have pointed the main responsible for all the evil - there was no libxft2. After the apt-get install libxft2 - db2setup has raised from the ashes.

Enjoy.

20110101

Un-monit

Using the monit to look after the hosts and services, sometimes you need to stop watching a particular check.
The argument for unmonitor option is the process name or host name being monitored, ex.

# monit status
[...]
Remote Host 'eye0.deadsystems.com'
status Connection failed
monitoring status monitored
[...]

# monit unmonitor eye0.deadsystems.com
# monit summary
[...]
Process 'sshd' running
Remote Host 'eye0.deadsystems.com' not monitored
[...]