private IndexerSupervisor indexerSupervisor;
private StateWatchingZooKeeper zk;
private Server server;
public static void main(String[] args) {
Daemon d = new Daemon() {
@Override
public void init() throws Exception {
init("/var/run/hbase-indexer.pid");
}
};
try {
if(d.isDaemonized()) {
// perform initialization as a daemon
// this involves in closing file descriptors, recording PIDs, etc.
d.init();
} else {
// if you are already daemonized, no point in daemonizing yourself again,
// so do this only when you aren't daemonizing.
if(args != null && args.length > 0 && "daemon".equals(args[0])) {
d.daemonize();
System.exit(0);
}
}
} catch (Exception e) {
log.error("Error setting up hbase-indexer daemon", e);