diff options
author | jim-p <jimp@pfsense.org> | 2015-02-09 12:17:20 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-02-09 12:17:20 -0500 |
commit | 8f19e12bcf8d47e7311f0cb86f31811538253674 (patch) | |
tree | c0bef6c9c82d6a22fe9db66c3f8020512ea09f81 | |
parent | 785cd2be24936b3ae7e44253417f1e2ff5a70ea5 (diff) | |
download | pfsense-packages-8f19e12bcf8d47e7311f0cb86f31811538253674.tar.gz pfsense-packages-8f19e12bcf8d47e7311f0cb86f31811538253674.tar.bz2 pfsense-packages-8f19e12bcf8d47e7311f0cb86f31811538253674.zip |
Some misc fixes for bacula-client to use proper paths for configuration and binaries.
-rw-r--r-- | config/bacula-client/bacula-client.inc | 37 | ||||
-rw-r--r-- | pkg_config.10.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 2 |
4 files changed, 23 insertions, 20 deletions
diff --git a/config/bacula-client/bacula-client.inc b/config/bacula-client/bacula-client.inc index 233de4b6..f14c4e5c 100644 --- a/config/bacula-client/bacula-client.inc +++ b/config/bacula-client/bacula-client.inc @@ -38,16 +38,18 @@ /* ========================================================================== */ require_once("config.inc"); require_once("util.inc"); - + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); if ($pf_version > 2.0) define('BACULA_LOCALBASE', '/usr/pbi/bacula-' . php_uname("m")); else - define('BACULA_LOCALBASE','/usr/local'); - + define('BACULA_LOCALBASE','/usr/local'); + +define('BACULA_STARTUP_SCRIPT', '/usr/local/etc/rc.d/bacula-fd.sh'); + function baculaclient_custom_php_install_command(){ global $g, $config; - baculaclient_custom_php_write_config(); + baculaclient_custom_php_write_config(); } function baculaclient_custom_php_deinstall_command(){ @@ -56,10 +58,10 @@ function baculaclient_custom_php_deinstall_command(){ conf_mount_rw(); // 1. Delete our config file - unlink_if_exists(BACULA_LOCALBASE."/etc/bacula-fd.conf"); + unlink_if_exists(BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf"); // 2. Re-run sshd config generation script - exec(BACULA_LOCALBASE . "/etc/rc.d/bacula-fd.sh stop"); + exec(BACULA_STARTUP_SCRIPT . " stop"); conf_mount_ro(); } @@ -71,11 +73,12 @@ function baculaclient_custom_php_write_config(){ if (file_exists($startup_file)){ $startup_script=file_get_contents($startup_file); $startup_script=preg_replace("/NO/","YES",$startup_script); - $startup_script=preg_replace("@/usr/local/etc/bacula-fd.conf@",BACULA_LOCALBASE."/etc/bacula-fd.conf",$startup_script); - $startup_script=preg_replace("@" . BACULA_LOCALBASE . "/etc/bacula/bacula-fd.conf@",BACULA_LOCALBASE."/etc/bacula-fd.conf",$startup_script); - file_put_contents("{$startup_file}.sh",$startup_script,LOCK_EX); + $startup_script=preg_replace("@/usr/local/sbin/bacula-fd@",BACULA_LOCALBASE."/sbin/bacula-fd",$startup_script); + $startup_script=preg_replace("@/usr/local/etc/bacula-fd.conf@",BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf",$startup_script); + $startup_script=preg_replace("@/usr/local/etc/bacula/bacula-fd.conf@",BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf",$startup_script); + file_put_contents(BACULA_STARTUP_SCRIPT,$startup_script,LOCK_EX); // Ensure bacula-fd has a+rx - exec("chmod a+rx {$startup_file}.sh"); + exec("chmod a+rx " . BACULA_STARTUP_SCRIPT); } //check config @@ -85,7 +88,7 @@ function baculaclient_custom_php_write_config(){ // create Director switch ($bc['type']){ case "Director": - $baculaclient_conf .= "Director { \n\t Name = {$bc['director']}-dir #{$bc['description']}\n\t Password = \"{$bc['password']}\"\n\t}\n"; + $baculaclient_conf .= "Director { \n\t Name = {$bc['director']}-dir #{$bc['description']}\n\t Password = \"{$bc['password']}\"\n\t}\n"; Break; case "Monitor": $baculaclient_conf .= "Director { \n\t Name = {$bc['director']}-mon #{$bc['description']}\n\t Password = \"{$bc['password']}\"\n\t Monitor = yes\n\t}\n"; @@ -95,24 +98,24 @@ function baculaclient_custom_php_write_config(){ $baculaclient_conf .= "Director { \n\t Name = {$bc['director']}-mon #{$bc['description']}\n\t Password = \"{$bc['password']}\"\n\t Monitor = yes\n\t}\n"; $LocalDirector = $bc['director']; } - + } - + // create Messages $baculaclient_conf .= "Messages { \n\t Name = Standard \n\t director = {$LocalDirector}-dir = all, !skipped, !restored\n\t}\n"; // create FielDaemon - + if (is_array($config['installedpackages']['baculaclientfd']['config'])){ $port = $config['installedpackages']['baculaclientfd']['config'][0]['port']; $jobs = $config['installedpackages']['baculaclientfd']['config'][0]['jobs']; } else{ $port="9102"; - $jobs="20"; + $jobs="20"; } $baculaclient_conf .= "FileDaemon { \n\t Name = {$LocalDirector}-fd #\n\t FDport = {$port}\n\t WorkingDirectory = /var/db/bacula\n\t Pid Directory = /var/run\n\tMaximum Concurrent Jobs = {$jobs}\n\t}\n"; - file_put_contents(BACULA_LOCALBASE."/etc/bacula-fd.conf",$baculaclient_conf,LOCK_EX); - exec(BACULA_LOCALBASE . "/etc/rc.d/bacula-fd.sh restart"); + file_put_contents(BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf",$baculaclient_conf,LOCK_EX); + exec(BACULA_STARTUP_SCRIPT . " restart"); // Mount Read-only conf_mount_ro(); } diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 20744cf0..3c408272 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -1216,7 +1216,7 @@ <descr><![CDATA[Bacula is a set of Open Source, computer programs that permit you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds.]]></descr> <website>http://www.bacula.org/</website> <category>Services</category> - <version>7.0.5 pkg v 1.0.4</version> + <version>7.0.5 pkg v 1.0.5</version> <status>Stable</status> <required_version>2.2</required_version> <config_file>https://packages.pfsense.org/packages/config/bacula-client/bacula-client.xml</config_file> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 83f44513..6b827539 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1636,7 +1636,7 @@ <descr><![CDATA[Bacula is a set of Open Source, computer programs that permit you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds.]]></descr> <website>http://www.bacula.org/</website> <category>Services</category> - <version>5.2.12_3 pkg v 1.0.4</version> + <version>5.2.12_3 pkg v 1.0.5</version> <status>Stable</status> <required_version>2.0</required_version> <config_file>https://packages.pfsense.org/packages/config/bacula-client/bacula-client.xml</config_file> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 58474f9b..f272e7e9 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1623,7 +1623,7 @@ <descr><![CDATA[Bacula is a set of Open Source, computer programs that permit you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds.]]></descr> <website>http://www.bacula.org/</website> <category>Services</category> - <version>5.2.12_3 pkg v 1.0.4</version> + <version>5.2.12_3 pkg v 1.0.5</version> <status>Stable</status> <required_version>2.0</required_version> <config_file>https://packages.pfsense.org/packages/config/bacula-client/bacula-client.xml</config_file> |