1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the Apache Public Source License 2.0 ("the License").
3 // You may not use this file except in compliance with the License.
10 * This class uses the highly-proprietary sun.misc.Signal class to
11 * let the JVM ignore SIGHUP. This is useful when you want to start
12 * a JVM and leave it running after you've logged out.
14 public class Signals {
15 public static void inhibitSigHUP() {
16 Signal.handle(new Signal("HUP"), new SignalHandler () {
17 public void handle(Signal sig) {
18 System.out.println("got SIGHUP; ignoring");
24 public static void main(String[] s) {
27 System.out.println("hi");
28 try { Thread.sleep(1000); } catch (Exception e) { }