Metaswitch/ralf — pull request #117 by rkday (2014-12-15 22:59:04+00:00)
Title: Protect against bad config

Fixes #107.

Tested the init.d changes by:
* checking that Ralf starts up normally
* checking the debug logs to confirm the startup options were recognised

```
15-12-2014 22:44:11.199 UTC Status main.cpp:319: Log level set to 5
15-12-2014 22:44:11.200 UTC Info main.cpp:329: Command-line options were: /usr/share/clearwater/bin/ralf --localhost=10.249.61.134 --http=10.249.61.134 --http-threads=50 --access-log=/var/log/ralf --log-file=/var/log/ralf --log-level=5 --billing-realm=example.com --sas=0.0.0.0,ralf@10.249.61.134
15-12-2014 22:44:11.200 UTC Info main.cpp:167: Local host: 10.249.61.134
15-12-2014 22:44:11.200 UTC Info main.cpp:177: HTTP address: 10.249.61.134
15-12-2014 22:44:11.200 UTC Info main.cpp:203: HTTP threads: 50
15-12-2014 22:44:11.200 UTC Info main.cpp:218: Access log: /var/log/ralf
15-12-2014 22:44:11.200 UTC Info main.cpp:208: Billing realm: example.com
15-12-2014 22:44:11.200 UTC Info main.cpp:192: SAS set to 0.0.0.0
```

(I didn't retest after merging in the DNS server command-line option, but I don't think that invalidates my testing.)

Tested the infrastructure/scripts/ralf change by installing with ralf_hostname commented out:

```
Selecting previously unselected package ralf.
(Reading database ... 48564 files and directories currently installed.)
Unpacking ralf (from ralf_1.0-141215.223033_amd64.deb) ...
Setting up ralf (1.0-141215.223033) ...
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US)
Must have a ralf_hostname set in /etc/clearwater/config
dpkg: error processing ralf (--install):
subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead ...
Errors were encountered while processing:
ralf
root@ip-10-249-61-134:~#
```

(though I subsequently added ERROR: in front of the error to make it more obvious)

This has the https://github.com/Metaswitch/ralf/pull/112 commits included, so just ignore the main.cpp changes.