--- /dev/null
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the Apache Public Source License 2.0 ("the License").
+// You may not use this file except in compliance with the License.
+
+package org.ibex.util;
+import java.io.*;
+import sun.misc.*;
+
+/**
+ * This class uses the highly-proprietary sun.misc.Signal class to
+ * let the JVM ignore SIGHUP. This is useful when you want to start
+ * a JVM and leave it running after you've logged out.
+ */
+public class Signals {
+ public static void inhibitSigHUP() {
+ Signal.handle(new Signal("HUP"), new SignalHandler () {
+ public void handle(Signal sig) {
+ System.out.println("got SIGHUP; ignoring");
+ }
+ });
+ }
+
+
+ public static void main(String[] s) {
+ inhibitSigHUP();
+ for(;;) {
+ System.out.println("hi");
+ try { Thread.sleep(1000); } catch (Exception e) { }
+ }
+ }
+}