aboutsummaryrefslogtreecommitdiff
path: root/bin/mauveserver
diff options
context:
space:
mode:
authorAlex Young <alex@bytemark.co.uk>2015-03-25 15:01:28 +0000
committerAlex Young <alex@bytemark.co.uk>2015-03-25 15:01:28 +0000
commita306e4a3dee7506893b31032f3c8c0426a7a1c42 (patch)
tree850ce122258e63e0b08214c6ff4c598f9d0e605d /bin/mauveserver
parentc12e2c8f65a59a075ad20424a03d137a62db7e48 (diff)
Provide a default output stream in 1.9
Diffstat (limited to 'bin/mauveserver')
-rwxr-xr-x[-rw-r--r--]bin/mauveserver14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/mauveserver b/bin/mauveserver
index b0c3573..286b126 100644..100755
--- a/bin/mauveserver
+++ b/bin/mauveserver
@@ -1,4 +1,4 @@
-#! /usr/bin/ruby1.8
+#! /usr/bin/env ruby
# NAME
# mauveserver -- receive alerts from station(s) around the network
#
@@ -26,7 +26,7 @@
# The configuration file consists of various stanzas, and sub-stanzas which
# give give options for each part of the server. The example configuration
# file gives a definitive explanation of all the options.
-#
+#
# SEE ALSO
# mauveclient(1), mauveconsole(1)
#
@@ -94,6 +94,8 @@ outputter.formatter = Log4r::PatternFormatter.new( :pattern => "%d [ %6.6l ] [ %
outputter.level = verbose ? Log4r::DEBUG : Log4r::INFO
logger.outputters << outputter
+$defout ||= $stdout # This isn't set in 1.9.
+
def error(msg)
logger = Log4r::Logger['Mauve']
logger.error "*** Error: #{msg}"
@@ -134,12 +136,12 @@ begin
builder.include_file(configuration_file)
Mauve::Configuration.current = builder.result
rescue StandardError => ex
- error ex
+ error ex
end
if test
logger.info "*** Configuration looks OK!"
- exit 0
+ exit 0
end
%w(HUP).each do |sig|
@@ -147,7 +149,7 @@ end
Mauve::Server.instance.logger.warn "#{sig} signal received. Restarting."
Mauve::Server.instance.stop
- #
+ #
# Reload configuration
#
begin
@@ -210,6 +212,6 @@ begin
logger.info "This is mauve #{Mauve::VERSION}"
Mauve::Server.instance.start
rescue StandardError => ex
- error ex
+ error ex
end