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);