Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, January 7, 2010

Friday, December 11, 2009

Debian - Out of disk space on /tmp

I suspected I was out of disk space, due to some corrupted JAR files, while compiling NHIN CONNECT 2.3

How do I tell on Debian?

$ sudo df

shows 0% available in /tmp

What's taking up this space?

$ sudo du /tmp

Shows recursively, what is where.

This appears to be a difference between GlassFishESB and GlassFish 2.1, but I'm not sure.

Wednesday, November 18, 2009

Git on a Flash Drive

Had some serious trouble figuring this one out...

The Idea: Use Git for source control on my Debian laptop, and keep a copy of the repository on a USB Flash Drive.

It should work something like this:

on flash drive:
mkdir project
cd project
git --bare init
on desktop:
git clone /path/to/usb/drive
make changes
git add .
git commit -m "did something"
git push origin master
But it didn't quite work that way

git clone resulted in the error messages "unable to chdir or not a git archive"
and "The remote end hung up unexpectedly"
The problem here is one of case-sensitivity. Git looks for a file named HEAD.
ls
branches config description head hooks info objects refs
but HEAD is lower case on the flash drive.

Attempts to Fix:
  • Renaming it to head results in an error (its already there).
  • Renaming to a temporary name and then to HEAD results in head showing up again.
So I look around on the drive and find out that NOT every file which has its name downcased. I check properties, and the flash drive is mounted using VFAT. In my configuration (Applications/System Tools/Configuration Editor) I check the VFAT settings (system/storage/default_options/vfat) and see a mount option of shortname=lower. I change this to mixed, remount the floppy and head is now HEAD.

Go google shortname=lower to find the world's opinion of this default...

Anyway, Git works on USB Flash Drives!

Thursday, October 15, 2009

MySQL5.1 on Debian Installation

I've been having issues installing MySQL5.1 on Debian, for the NHIN Connect port to Linux.

First I tried downloading the tarball and following the installation instructions in their INSTALL-BINARY file. One thing which needs modification is substituting useradd for adduser.

The problem, though was the installation script

script/mysql_install_db

was failing, as it could not find files. After messing with this for some time, I decided to delete everything, start over, and use the package manager:

aptitude install mysql-server

However this installed an instance of mysql without a root or mysql user. I could never authenticate against it.

Back to the tar - I'm now working on script/mysql_install_db

root>cd /usr/local/mysql
root>./scripts/mysql_install_db

FATAL ERROR: Could not find errmsg.sys

The following directories were searched:

/usr/share/english
/usr/share/mysql/english

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

Looks as though the "you must be either at the top level of the extracted archive" part does not work, so I'll specify basedir:

root>./scripts/mysql_install_db --basedir=.
Installing MySQL system tables...
091015 9:34:03 [ERROR] ./bin/mysqld: unknown option '--skip-bdb'
091015 9:34:03 [ERROR] Aborting

091015 9:34:03 [Warning] Forcing shutdown of 2 plugins
091015 9:34:03 [Note] ./bin/mysqld: Shutdown complete


Installation of system tables failed! Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

shell> ./bin/mysqld --skip-grant &

and use the command line tool ./bin/mysql
to connect to the mysql database and look at the grant tables:

shell> ./bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com/. Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the ./scripts/mysqlbug script!

Ok, two oddities here.

1) I didn't specify --skip-bdb
2) /var/lib/mysql has no logs

The "Installation of mysql tables" message is from the script, the rest is from mysqld.

I modified the script to output its options and found these:

./bin/mysqld --language=./share/english --bootstrap --basedir=. --datadir=/var/lib/mysql --log-warnings=0 --loose-skip-innodb --loose-skip-ndbcluster --user=mysql --max_allowed_packet=8M --default-storage-engine=myisam --net_buffer_length=16K

So where is --skip-bdb coming from. After investigating, I found a global configuration file, my.cnf, which can specify options. It can be found in a number of places:

/etc/my.cnf
/etc/mysql/my.cnf
SYSCONFDIR/my.cnf
$MYSQL_HOME/my.cnf
defaults-extra-file
~/.my.cnf

Found one in /etc/mysql

#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#

So I commented out skip-bdb, and the script worked.

I finished out the installation instructions and started mysqld using

mysqld_safe --user=mysql

but it exited right away.

Nothing useful in the log, so I added the -log option:

091015 10:23:20 [Warning] The syntax '--log' is deprecated and will be removed in MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.
091015 10:23:20 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'

So I added a symbolic link to the missing dir

ln -s /usr/local/mysql/share /usr/share/mysql

restarted, and its running now. Wahoo!

Wednesday, October 14, 2009

Debian java confusion

On my Debian laptop, I've been having several java apps hang up on me and need to be killed. Primarily, these have been UI apps, like MagicDraw and UI installers, Like Metro 1.4, which I needed for NHIN Connect.

Looking into this, I found two versions of java installed, the 1.5 Gnu Compiler for java, and the 1.6.0 JDK from sun.

/usr/lib/jvm$ ls
java-1.5.0-gcj-4.3-1.5.0.0 java-6-sun java-6-sun-1.6.0.12 java-gcj

So which am I running?

/usr/lib/jvm$ which java
/usr/bin/java

Which is a symbolic link to /etc/alternatives/java. Looking further, looks as though /etc/alternatives is pointing to a mix of 1.5gcj/1.6jdk. This is somewhat less than ideal.

/etc/alternatives$ ls -lgo ja* | grep gcj | cut -c34-
jar -> /usr/lib/jvm/java-gcj/jre/bin/jar
jar.1.gz -> /usr/lib/jvm/java-gcj/man/man1/jar.1.gz
java -> /usr/lib/jvm/java-gcj/jre/bin/java

jeff@oci1412:/etc/alternatives$ ls -lgo ja* | grep sun | cut -c34-
jarsigner -> /usr/lib/jvm/java-6-sun/bin/jarsigner
jarsigner.1.gz -> /usr/lib/jvm/java-6-sun/man/man1/jarsigner.1.gz
javac -> /usr/lib/jvm/java-6-sun/bin/javac
javac.1.gz -> /usr/lib/jvm/java-6-sun/man/man1/javac.1.gz
javadoc -> /usr/lib/jvm/java-6-sun/bin/javadoc
javadoc.1.gz -> /usr/lib/jvm/java-6-sun/man/man1/javadoc.1.gz
javah -> /usr/lib/jvm/java-6-sun/bin/javah
javah.1.gz -> /usr/lib/jvm/java-6-sun/man/man1/javah.1.gz
javap -> /usr/lib/jvm/java-6-sun/bin/javap
javap.1.gz -> /usr/lib/jvm/java-6-sun/man/man1/javap.1.gz
java-rmi.cgi -> /usr/lib/jvm/java-6-sun/bin/java-rmi.cgi
java_vm -> /usr/lib/jvm/java-6-sun/jre/bin/java_vm
javaws -> /usr/lib/jvm/java-6-sun/jre/bin/javaws
javaws.1.gz -> /usr/lib/jvm/java-6-sun/jre/man/man1/javaws.1.gz

Easy enough to (attempt to) fix:
/etc/alternatives$ sudo rm jar
/etc/alternatives$ sudo ln -s /usr/lib/jvm/java-6-sun/bin/jar ./jar
/etc/alternatives$ sudo rm java
/etc/alternatives$ sudo ln -s /usr/lib/jvm/java-6-sun/bin/java ./java
/etc/alternatives$ sudo rm jar.1.gz
/etc/alternatives$ sudo ln -s /usr/lib/jvm/java-6-sun/man/man1/jar.1.gz

And verify:
/etc/alternatives$ ls -lgo ja* | grep gcj | cut -c34-

Problem Solved!

Tuesday, October 13, 2009

Connect 2.2

NHIN Connect 2.2 was released recently. Major changes from 2.1 include:
* BPEL removed, yay!
* Secure communication extended to Adapter

Testing it, I have found

* Build is much faster
* Execution of Self tests is faster (though not yet fast)
* Memory usage is still high

Ahead for 2.3, we are working on platform independence. Linux build soon?

Wednesday, October 7, 2009

Mounting Windows Shares from Debian

Next in my Switch to Debian, I had to mount a shared windows drive. This requires smbfs:

$ sudo aptitude install smbfs

Then I create a dir for this host and share (as root because its a root-owned dir):

$ sudo mkdir /mnt/winhost
$ sudo mkdir /mnt/winhost/sharename

Then I mount the dir. Since I am not using an LDAP login, I have to specify my LDAP credentials:

$ sudo mount -t smbfs -o userame=myLDAPuser,password=myLDAPpass //winhost/sharename /mnt/winhost/sharename

Problem Solved. If I could only print!

Tuesday, October 6, 2009

Configuring sudo on Debian

Next in the Switch To Debian, is the ability to use the sudo command.

This is needed, for example, to install many programs, which install to root-protected directories.

I edited the /etc/sudoers file with visudo and added this line

jeff ALL=(ALL) ALL

What this means, I have no idea.

Tuesday, September 15, 2009

Running Rails On Debian

During my Switch To Debian, I had to get rails runnning on my laptop. My first try, I could not get the rails command to work - had the classic write_inheritable_attribute problem. However, this time, the problem was not the iconv library, as activesupport loaded fine.

Instead, it appeared to be a missing require 'rubygems' from the script.

I got it working, but could not start the server. It said my version of rubygems was out of date and I needed to update it with gem update --system. Nice, except I ran it and got:

ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.


I found the answer, to build rubygems 1.3.1 from source, and then gem update --system worked. See the post here.

Monday, September 14, 2009

Opera 10 Very Fast

I switched to using Opera 10 on Debian. Noticably faster with better rendering than Firefox.

Friday, September 11, 2009

Debian: Mounting USB Drives

During my Switch To Debian, I was unable to use a USB drive.

When plugging it in, I got an error:

Error: org.freedesktop.DBus.Error.AccessDenied.

This was because my user, who started X was not a member of plugdev.

I added my user in /etc/group and bingo. Solved

Thursday, September 10, 2009

Debian: Perhaps HAL Requires Bluetooth

During my Switch To Debian, one thing which we changed by manually starting Dbus, HAL, and wicd was that these now are started later relative to other startup processes.

I noticed Bluetooth in the startup logs (when it all failed) started immediately after HAL. No more, Bluetooth is now started when I start Dbus.

Perhaps HAL is dependent on Bluetooth by its configuration?

DBUS is on Fire

While Switching To Debian, we had an error initializing HAL, which is related somehow to dbus. On a related note, wicd was not starting, nor the wicd-client.

Solution - boot into console mode. Start dbus, then wicd, then hald.

Problem solved.

Debian Extremely Slow - When Not Connected

The first problem to overcome in the Switch To Debian was that startup is slow - Extremely so. 10 minutes of pain. But this only happens when NOT wired to my company's LAN.

Checking the syslogs, we found there were numerous DNS requests going out. We disabled DHCP, and the problem went away.

Now it fails quickly.

Wednesday, September 9, 2009

Switching To Debian

For the past month, I have been struggling with my laptop, running XP. Two bad things were happening:

* Generic Host Process for Win32 Services encountered a problem and needed to close
* Svchost.exe Application Error

Both of these conditions would have the same result - I could no longer start any new processes. All I could do was close what was running and reboot - except I couldn't really reboot, as that would never complete. The truth is, I had to pull the power cable and battery from my laptop and start it up again.

This happened from 4-7 times per day, making me rather unproductive. Our plan was to make XP a virtual machine, running in a Debian environment. This would give me the environment I so wanted, allow me to run Windows when I absolutely had to, and restart it when it had a problem.

I knew this wouldn't be a comfortable change, but that I would be better for it in the long run, so we decided to go for it. I'm writing about the decisions and experience so others can benefit, and because if successful, I may want to do this to another machine in the future.

The first choice we had to make was whether to install XP on a separate partition (in addition to the VM). I decided not to, as I wasn't overflowing with disk space.

Next, we did put in a partition which Windows and Debian could share. The idea is that I could use both the Debian tools and Windows in concert. We created to 20GB FAT partition for this purpose.

Finally, the VM (chosen for me) was Sun Virtual Box, rather than VMWare.

The configuration is complete, and I picked it up Friday. So far, its been a disaster - when the laptop is not wired to my corporate network. But it was a disaster before, so no big deal. We'll figure it out, and post it.

Update: See posts tagged SwitchToDebian in my blog.

Sunday, December 7, 2008

Dear Linus

Mr. Torvalds,

Thanks for writing the Git source control system. One problem however, it is not yet supported on Windows from what I see. Just on a Mac and Linux. Not even Cygwin.

Don't git me wrong, I love subversion, but why Linux over Windows :) We want to play too.

Love,

The Schmitzer

Monday, August 18, 2008

Olympic Embarassment

What technical item was more embarrassing to the host nation, China?

The fake fireworks?

or

The Blue Screen of Death?

Note to next host, choose Linux...