lib/flapjack/cli/receiver.rb in flapjack-1.2.1rc2 vs lib/flapjack/cli/receiver.rb in flapjack-1.2.1rc3
- old
+ new
@@ -62,13 +62,19 @@
def start
if runner(@options[:type]).daemon_running?
puts "#{@options[:type]}-receiver is already running."
else
print "#{@options[:type]}-receiver starting..."
- print "\n" unless @options[:daemonize]
+ main_umask = nil
+ if @options[:daemonize]
+ main_umask = File.umask
+ else
+ print "\n"
+ end
runner(@options[:type]).execute(:daemonize => @options[:daemonize]) do
begin
+ File.umask(main_umask) if @options[:daemonize]
main(:fifo => @options[:fifo], :type => @options[:type])
rescue Exception => e
p e.message
puts e.backtrace.join("\n")
end
@@ -89,11 +95,13 @@
exit_now! unless wait_pid_gone(pid)
end
def restart
print "#{@options[:type]}-receiver restarting..."
+ main_umask = File.umask
runner(@options[:type]).execute(:daemonize => true, :restart => true) do
begin
+ File.umask(main_umask)
main(:fifo => @options[:fifo], :type => @options[:type])
rescue Exception => e
p e.message
puts e.backtrace.join("\n")
end