lib/daemon-ogre.rb in daemon-ogre-1.4.0 vs lib/daemon-ogre.rb in daemon-ogre-1.4.1
- old
+ new
@@ -302,17 +302,18 @@
def help
puts "\nyou can use one of these commands: "+\
"\nstart daemon -d stop restart log -l pid -p port -tcp status reset help"+\
"\n==============================================================================DESC======>>"
puts "start\t\t\t\t=> this will start the #{$0}"+\
- "\ndaemon\t\tor -d\t\t=> this will make is daemon process"+\
+ "\ndaemon\t\t\t\t=> this will make is daemon process"+\
"\nstop\t\t\t\t=> this will kill the last process with pidfile"+\
"\nrestart\t\tor reset\t=> hard restart"+\
"\nlog\t\tor -l\t\t=> logfile place"+\
"\npid\t\tor -p\t\t=> pid file place (if you want set the filename as well, put .pid or .txt in the end)"+\
"\nport\t\tor -tcp\t\t=> user definiated port"+\
"\nstatus\t\t\t\t=> last process alive?"+\
+ "\ndebug\t\tor -d\t\t=> show debug log (you can make your own by using 'puts 'xy' if $DEBUG' "+\
"\nhelp\t\t\t\tgive you this msg :)\n"
DaemonOgre::App.terminate=true
end
def start
@@ -447,22 +448,18 @@
DaemonOgre::App.terminate=true
end
def clear
- begin
- File.delete DaemonOgre::App.log_path
- rescue Exception
- end
- begin
- File.delete DaemonOgre::App.daemon_stderr
- rescue Exception
- end
+ logs = ['loh_path','daemon_stderr','exceptions','exlogger']
- begin
- File.delete DaemonOgre::App.exceptions
- rescue Exception
+ logs.each do |logname|
+ begin
+ File.delete DaemonOgre::App.__send__(logname)
+ rescue Exception => ex
+ puts ex if $DEBUG
+ end
end
end
end
@@ -599,11 +596,11 @@
serv_load = Array.new
ARGV.each do |one_argv_parameter|
case one_argv_parameter.downcase
when "start" then serv_load.push "start"
when "daemon" then serv_load.push "daemon"
- when "-d" then serv_load.push "daemon"
+ when "-d" then DaemonOgre::Server.debug
when "stop" then serv_load.push "stop"
when "restart" then serv_load.push "restart"
when "reset" then serv_load.push "restart"
when "debugger" then serv_load.push "debugger"
when "log" then DaemonOgre::Server.set_log "log"
@@ -634,10 +631,10 @@
DaemonOgre::Server.continue? if DaemonOgre::App.terminate
begin
require "debugger" ;debugger if serv_load.include? "debugger"
rescue Exception => ex
- puts "you need to install debugger gem => gem install debugger"
+ puts "you need to install debugger gem => gem install debugger\n#{ex}"
end
end
end
def self.help
\ No newline at end of file