@@ -0,0 +1,1999 @@
+package voldemort.server;%0A%0Aimport static voldemort.utils.Utils.croak;%0A%0Aimport org.apache.log4j.Logger;%0A%0A/**%0A * Daemon class for use with the jsvc wrapper.%0A * %3Cp%3E%0A * Simple example usage:%0A * %3Cp%3E%0A * %0A * %3Cpre%3E%0A *  jsvc -pidfile ./voldemort.pid voldemort.server.VoldemortDaemon%0A * %3C/pre%3E%0A * %3Cp%3E%0A * The above assumes that JAVA_HOME, CLASSPATH, and VOLDEMORT_HOME have all been%0A * exported.%0A * %3Cp%3E%0A * A more detailed example might be:%0A * %0A * %3Cpre%3E%0A * jsvc %5C%0A *   -Xmx2G %5C%0A *   -pidfile /var/run/voldemort.pid %5C%0A *   -errfile &quot;&amp;1&quot; %5C%0A *   -outfile /var/log/voldemort.out %5C%0A *   -user voldemort %5C%0A *   -Dcom.sun.management.jmxremote %5C%0A *   -Dlog4j.configuration=file:///etc/voldemort/log4j.properties %5C%0A *   voldemort.server.VoldemortDaemon /etc/voldemort%0A * %3C/pre%3E%0A * %0A * See %3Ca href=%22http://commons.apache.org/daemon/jsvc.html%22%3ECommons Daemon%3C/a%3E%0A * documentation for more info.%0A * %0A * @author Eric Evans %3Ceevans@racklabs.com%3E%0A * %0A */%0Apublic class VoldemortJsvcDaemon %7B%0A%0A    private static final Logger logger = Logger.getLogger(VoldemortServer.class.getName());%0A    private VoldemortServer server = null;%0A%0A    public void init(String%5B%5D args) throws Exception %7B%0A        VoldemortConfig config = null;%0A        try %7B%0A            if(args.length == 0)%0A                config = VoldemortConfig.loadFromEnvironmentVariable();%0A            else if(args.length == 1)%0A                config = VoldemortConfig.loadFromVoldemortHome(args%5B0%5D);%0A            else%0A                croak(%22USAGE: java %22 + VoldemortJsvcDaemon.class.getName()%0A                      + %22 %5Bvoldemort_home_dir%5D%22);%0A        %7D catch(Exception e) %7B%0A            logger.error(e);%0A            croak(%22Error while loading configuration: %22 + e.getMessage());%0A        %7D%0A%0A        server = new VoldemortServer(config);%0A    %7D%0A%0A    public void start() %7B%0A        if(!server.isStarted())%0A            server.start();%0A    %7D%0A%0A    public void stop() %7B%0A        if(server.isStarted())%0A            server.stop();%0A    %7D%0A%0A    public void destroy() %7B%0A%0A    %7D%0A%7D%0A

Add Jsvc daemon patch from Eric.