Add option to daemonize

This commit is contained in:
Dzmitry Plashchynski committed 2015-03-03 19:13:17 +02:00
1 parent 0ead66f626
commit 2ce9db45db
2 files changed
+7

No files matched your search

+5
View File
@@ -49,6 +49,11 @@ module Crono
opts.on("-L", "--logfile PATH", "Path to writable logfile (Default: #{Crono.config.logfile})") do |logfile|
Crono.config.logfile = logfile
end
opts.on("-d", "--[no-]daemonize", "Daemonize process (Default: #{Crono.config.daemonize})") do |daemonize|
Crono.config.daemonize = daemonize
end
end.parse!(argv)
end
end
+2
View File
@@ -7,11 +7,13 @@ module Crono
attr_accessor :schedule
attr_accessor :cronotab
attr_accessor :logfile
attr_accessor :daemonize
def initialize
self.schedule = Schedule.new
self.cronotab = CRONOTAB
self.logfile = LOGFILE
self.daemonize = false
end
end