Age | Commit message (Collapse) | Author |
|
We do the actual fork as the last step, after redirecting the
standard I/O streams. This also ensures that no log messages
are shown on console _after_ forking.
|
|
IO.write() takes an arbitrary number of argumens, that are converted to string
and joined on write. We should behave the same way.
Moreover, the returned value is the number of bytes, and this is bytesize
in modern Ruby.
|
|
|
|
Overriding (as we should do) the standard error write method when
daemonizing introduces a recursion in the logger, due to the
persistent presence of the console logger.
The solution is obviously to stop logging on console
after daemonization.
|
|
In 96d13521d the STDOUT/STDERR write overrides were replaced
by overrides to $stdout, but the second should have been to $stderr
(obviously).
|
|
Logging was broken when daemonizing, due to the logger thread being dead
after the fork. This can be solved by restarting the thread, if necessary
when setting the log file (which we conveniently do right after the fork).
|
|
|
|
|
|
This is intended to make testing/mocking of the http client easier.
|
|
This moves the logger management thread/queue to a seperate singleton.
It removes the explicit stopping/restarting of the logging thread since
the thread should behave like a daemon thread anyway.
Still needs to be tested to work in daemonize.
|
|
This makes it so the -d debug flag on the rbot
command line will always log to STDOUT, previously
it would just force the log level.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creates a new option to store the default at first run.
This fixes the problem that random auth passwords are not
kept, it also allows us to always store the core.db config
value.
|
|
|
|
|
|
|
|
* a new abstract class AbstractAccessor is the new base
for all concrete database implementations.
* a factory now, dynamically discovers those implementations
in the registry/ directory and will create the configured
type for the plugins.
* again: this makes db keys case-sensitive (aka 'the correct
way of doing things' -.-)
* re-added tokyocabinet
|
|
|
|
|
|
|
|
|
|
|
|
This removes the existing registries, ruby-bdb (Berkeley DB) and
tokyocabinet, instead it creates a new registry based on ruby
DBM.
Ruby-bdb has long since been abandoned in favor for rubys DBM
and tokyocabinet also has been ceased development since
2011 (for kyotocabinet).
|
|
|
|
This reverts commit c4d629ad86aae3b8bb4669650df57875252bea92.
|
|
This adds a print to $stderr for log messages with the
level ERROR or FATAL. I did this because in the past errors
connecting to the server weren't immediately obvious but
rather hidden in the logfile. I think it should be right
in-your-face when the connection doesn't work.
It would probaply be better to extend Logger to print
to STDERR but this apparently requires monkeypatching ruby's
Logger. Anyhow I think my solution works for now.
|
|
This adds three new configuration variables to configure
SSL verification against a CA.
server.ssl_verify: true if it should verify and disconnect
if it fails
server.ssl_ca_file: a CA file, is set to the systems CA
bundle by default (distri. dependent)
server.ssl_ca_path: alternativly path to a directory with
CA PEM files
I tested it and this seems no longer an issue with >= 1.9.3
https://www.braintreepayments.com/braintrust/sslsocket-verify_mode-doesnt-verify
|
|
I revisited my fix for the ThreadError in ruby 2.0.0
this doesn't use a queue for signals but just starts a
thread for each received signal, works much better for me.
It also fixes a bug in Bot#reconnect where the SystemExit
exception coming from quit is not handled correctly.
|
|
Ruby 2.0.0 crashes with "ThreadError: can't be called from trap context"
anytime a signal is received, because it tries to write a debug message
within the "trap context".
This changes signal handling so that signals are queued and processed
in the main loop.
More information: https://www.ruby-forum.com/topic/4411227
|
|
|
|
|
|
Rather than raising changing the message (a message that would not be
displayed anyway), display the (composed) error message and then reraise
without further changes.
|
|
|
|
Only reset quit message when entering the main loop sanely.
|
|
|
|
When using a DB backend different from BDB, the BDB constant may not be
defined, causing a NameError during error trapping in the main loop. Fix
this by defining our own DBFatal error that maps to BDB::Fatal in the
BDB case and is defined as an (unused) Exception for TokyoCabinet.
|
|
|
|
|
|
|
|
|
|
|
|
Untrapped connect() failures would raise up to the mainloop, causing a
burst of reconnect attempts without delay. Fix by rescuing in
reconnect() and retrying after waiting.
|
|
Since in 1.9 methods arrays have symbols instead of strings, fix it by
changing into respond_to? and method_defined?
|