--- bareos-dir.orig 2017-08-16 16:07:37.049664000 -0500 +++ bareos-dir 2017-08-17 09:44:56.801804000 -0500 @@ -30,10 +30,28 @@ command=/usr/local/sbin/bareos-dir command_args="-c ${bareos_dir_config}" pidfile="${bareos_dir_pidfile}" +bconsole_command=/usr/local/bin/bconsole start_precmd="bareos_start_precmd" +restart_precmd="bareos_dir_configtest" +reload_precmd="bareos_dir_configtest" +reload_cmd="bareos_dir_reload" +configtest_cmd="bareos_dir_configtest" bareos_start_precmd() { [ -d "${pidfile%/*}" ] || install -d -o bareos -g bareos ${pidfile%/*} + bareos_dir_configtest } +bareos_dir_configtest() { + echo "Performing sanity check on ${bareos_dir_config} configuration:" + eval ${command} -t +} + +bareos_dir_reload() { + echo "Performing a graceful reload" + # bconsole always exits with 0, so we can't check the return status for success. + echo "reload" | ${bconsole_command} +} + +extra_commands="reload configtest" run_rc_command "$1"