puppetlabs/Razor — pull request #102 by tjmcs (2012-06-29 02:16:41+00:00)
Title: Fixes #94

This patch adds a the following functionality to the razor_daemon.rb script:

1. a check is made at the start of the script (before the daemon process is started) to ensure that the Razor depends on is accessible before starting that daemon process
1. if the database is accessible, the daemon process is started (as was the case in previous versions)
1. if the database is not accessible, an error message (which includes the current persistence database configuration parameters) is printed out and the script exits

This should fix Issue #94, since an error message is now being printed out to the console before the razor_daemon.rb script exits (previously, the error output only appeared in the log/razor_daemon.log file, not on the console, if the persistence database was not accessible when this script started). The issue in question was somewhat misnamed, since the issue is not that the razor_daemon.rb script does not ensure that the persistence database instance is running, it is that the script does not output an error to the console in the case where the database is inaccessible (it only sent this output to the log file).

It should be noted that the output for this error condition (the persistence database not being accessible) will **only** appear in the log file once the daemon process has started. The error output for this issue is only sent to the console **prior** to the daemon process being started (when a console is still available to sent output to).