Making FreeNX always suspend

I’m running my Rivendell radio automation software on a virtual host, connecting to it using FreeNX. It works very well for the most part, but there’s been one little piece which could cause disaster: the FreeNX server’s habit of asking me if I want to suspend or terminate my session. Because my music will stop if the session terminates, I don’t ever want that option. I want it to always suspend.

I spent a few minutes tonight tracking down the best way to do this. It turns out the /usr/bin/nxdialog script is being called. By patching this script, I can force the suspend option every time. Problem solved!

Below is the code that does the magic:

— nxdialog.orig 2011-10-24 11:45:14.000000000 -0400
+++ nxdialog-mine 2012-03-30 21:41:33.000000000 -0400
@@ -415,6 +415,11 @@
exit 0
}

+always_suspend()
+{
+ return 3
+}
+
#
# main case statement
#
@@ -427,7 +432,7 @@
${dialog_interface}_yesno
;;
yesnosuspend)
– ${dialog_interface}_yesnosuspend
+ always_suspend
;;
panic)
${dialog_interface}_panic

You can also download the raw patch here.

Police in the neighborhood

Hallie and Travis pose with Officer J.A. Kryskowiak, July 2010

Police are in my neighborhood and I couldn’t be happier about it. You see, they’re not leaving to go on another call, they live in my neighborhood. I know of at least two officers who’ve chosen to call my neighborhood home.

Why is this so great? Because as I learned on my ridealong a few years ago, no one knows neighborhoods like cops do. Cops like to live in places that have don’t have crime. Like everyone else, cops like to “leave it at the office” when they’re off duty. They want time when they can relax and just be themselves. And, any criminals thinking of committing a crime are going to think twice when they see a police car ont he street.

When an officer I know asked if there were any available homes in my neighborhood, I knew my neighborhood was in good shape.