Nov 11

When should I use kill -9 ?

Posted by James Netherton | Wednesday 11 November 2009 21:05 PM | In Linux

When should I use kill -9 ?

The answer is – Rarely! Or at least only in exceptional circumstances…..

The -9 signal is the KILL signal which forces a process to immediately terminate. Many processes perform clean up operations when they terminate, perhaps to close open files, remove temporary files & directories etc. Using the -9 signal prevents a process from executing any of its shut down hooks and could potentially leave your application / system in an inconsistent state.

If a process needs to be killed, it’s often better to use the kill command on its own or use kill -15 (-15 is usually the default signal) which sends the TERM signal to the process. The TERM signal tells a process to gracefully terminate which means it will be able to run any shut down hooks and thus leave your system in a potentially nicer state than it would have been if you’d have used kill -9.

I see kill -9 used in so many inappropriate circumstances, such as in scripts to stop some service or application. Kill -9 should never be used in such cases.

The *nix man pages have a good overview of the kill command. You can also get a list of all kill signals by executing kill -l.

Oct 30

Upgrade to Ubuntu 9.10 leaves Hue setting at -1000

Posted by James Netherton | Friday 30 October 2009 20:46 PM | In Linux

After a few Google searches on this, it seems like this issue is cropping up for people with Nvidia cards…..

I upgraded Ubuntu to 9.10 and found that all of my video content was being displayed with many of the colours totally messed up – pink sky and green skins on people!

For some reason the Hue graphics setting was set to -1000. To fix it, I corrected the setting via the graphics preferences in the Totem media player and everything looked fine afterwards.

Feb 13

Party Like It’s 1234567890

Posted by James Netherton | Friday 13 February 2009 22:08 PM | In Linux

*nix geeks will soon be celebrating the moment when Unix time reports the magic 1234567890 sequence of numbers. It’ll occur at 23:31:30 UTC. To keep track of things, run the following from the command line :)

watch -n 1 date +%s

Feb 03

Installing The Java Web Browser Plugin On Ubuntu

Posted by James Netherton | Tuesday 03 February 2009 19:09 PM | In Linux

For some reason Ubuntu by default installs the Java 1.6 open JDK but doesn’t seem to include the Java web browser plugin for Firefox. It took me a while to figure out how to add it. Run the following from the command line:

sudo apt-get install sun-java6-plugin

Jan 26

Deploying ColdFusion on Tomcat under Ubuntu

Posted by James Netherton | Monday 26 January 2009 7:00 AM | In ColdFusion, Linux

I spent ages trying to get ColdFusion working properly with Tomcat 6 on Unbuntu. Tomcat wouldn’t start the ColdFusion application sever and the logs were getting full of exceptions moaning about the inability to access certain resources. For example:

java.security.AccessControlException: access denied (java.util.PropertyPermission coldfusion.classPath read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
at java.security.AccessController.checkPermission(AccessController.java:553)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)
at java.lang.System.getProperty(System.java:669)

Eventually I came across a solution posted to House Of Fusion in 2007. Open up your catalina.policy file, comment out what’s in there and add the line:

permission java.security.AllPermission;

It’s a bit of a hack – but it works! This is obviously something that you wouldn’t want to do on a production machine!

Jan 25

Switching from Windows to Ubuntu

Posted by James Netherton | Sunday 25 January 2009 19:17 PM | In Linux

Last week my four year old Windows XP installation started creaking at the seams and doing all kinds of weird things so I decided to back up my data and give Ubuntu a try. I’ve been switching back and forth between operating systems for the last eight years, installing Linux, getting frustrated or missing certain aspects of Windows.

Not so this time! I can’t see myself making a permanent switch back to Windows, Ubuntu has everything I need. Anything that didn’t come pre-installed is easily installed with APT. Should I need Windows for anything, I’m running XP virtualised under VirtualBox (which so far seems superb).

Overall, OS X is my preferred operating system but I’m more than happy with Ubuntu. Hopefully I can stick with it for more than a few weeks this time.