Skip to content

Commit

Permalink
Merge pull request #1284
Browse files Browse the repository at this point in the history
filed: stored: deprecate `compatible` config option
  • Loading branch information
arogge committed Oct 25, 2022
2 parents a5a3dfc + 68c36df commit a629773
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 38 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -140,6 +140,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:

### Deprecated
- make_catalog_backup.pl is now a shell wrapper script which will be removed in version 23.
- marked config directive `Compatible` as deprecated [PR #1284]

### Removed
- removed the `-r` run job option. [PR #1206]
Expand Down Expand Up @@ -318,14 +319,19 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
[PR #1247]: https://github.com/bareos/bareos/pull/1247
[PR #1248]: https://github.com/bareos/bareos/pull/1248
[PR #1249]: https://github.com/bareos/bareos/pull/1249
[PR #1250]: https://github.com/bareos/bareos/pull/1250
[PR #1251]: https://github.com/bareos/bareos/pull/1251
[PR #1253]: https://github.com/bareos/bareos/pull/1253
[PR #1254]: https://github.com/bareos/bareos/pull/1254
[PR #1255]: https://github.com/bareos/bareos/pull/1255
[PR #1260]: https://github.com/bareos/bareos/pull/1260
[PR #1262]: https://github.com/bareos/bareos/pull/1262
[PR #1266]: https://github.com/bareos/bareos/pull/1266
[PR #1267]: https://github.com/bareos/bareos/pull/1267
[PR #1268]: https://github.com/bareos/bareos/pull/1268
[PR #1270]: https://github.com/bareos/bareos/pull/1270
[PR #1275]: https://github.com/bareos/bareos/pull/1275
[PR #1277]: https://github.com/bareos/bareos/pull/1277
[PR #1278]: https://github.com/bareos/bareos/pull/1278
[PR #1284]: https://github.com/bareos/bareos/pull/1284
[unreleased]: https://github.com/bareos/bareos/tree/master
28 changes: 12 additions & 16 deletions core/src/dird/dird.cc
Expand Up @@ -287,13 +287,19 @@ int main(int argc, char* argv[])
return 0;
}

if (!test_config) { /* we don't need to do this block in test mode */
if (!foreground) {
daemon_start("bareos-dir", pidfile_fd, pidfile_path);
InitStackDump(); /* grab new pid */
if (my_config->HasWarnings()) {
// messaging not initialized, so Jmsg with M_WARNING doesn't work
fprintf(stderr, _("There are configuration warnings:\n"));
for (auto& warning : my_config->GetWarnings()) {
fprintf(stderr, " * %s\n", warning.c_str());
}
}

if (!test_config && !foreground) {
daemon_start("bareos-dir", pidfile_fd, pidfile_path);
InitStackDump(); // grab new pid
}

if (InitCrypto() != 0) {
Jmsg((JobControlRecord*)nullptr, M_ERROR_TERM, 0,
_("Cryptography library initialization failed.\n"));
Expand All @@ -302,8 +308,7 @@ int main(int argc, char* argv[])
return 0;
}

if (!test_config) { /* we don't need to do this block in test mode */
/* Create pid must come after we are a daemon -- so we have our final pid */
if (!test_config) {
ReadStateFile(me->working_directory, "bareos-dir",
GetFirstPortHostOrder(me->DIRaddrs));
}
Expand Down Expand Up @@ -332,16 +337,7 @@ int main(int argc, char* argv[])
return 0;
}

if (test_config) {
if (my_config->HasWarnings()) {
/* messaging not initialized, so Jmsg with M_WARNING doesn't work */
fprintf(stderr, _("There are configuration warnings:\n"));
for (auto& warning : my_config->GetWarnings()) {
fprintf(stderr, " * %s\n", warning.c_str());
}
}
TerminateDird(0);
}
if (test_config) { TerminateDird(0); }

if (!InitializeSqlPooling()) {
Jmsg((JobControlRecord*)nullptr, M_ERROR_TERM, 0,
Expand Down
19 changes: 9 additions & 10 deletions core/src/filed/filed.cc
Expand Up @@ -207,6 +207,14 @@ int main(int argc, char* argv[])
TerminateFiled(1);
}

if (my_config->HasWarnings()) {
// messaging not initialized, so Jmsg with M_WARNING doesn't work
fprintf(stderr, _("There are configuration warnings:\n"));
for (auto& warning : my_config->GetWarnings()) {
fprintf(stderr, " * %s\n", warning.c_str());
}
}

if (!foreground && !test_config) {
daemon_start("bareos-fd", pidfile_fd, pidfile_path);
InitStackDump(); /* set new pid */
Expand All @@ -227,16 +235,7 @@ int main(int argc, char* argv[])
}
#endif

if (test_config) {
if (my_config->HasWarnings()) {
/* messaging not initialized, so Jmsg with M_WARNING doesn't work */
fprintf(stderr, _("There are configuration warnings:\n"));
for (auto& warning : my_config->GetWarnings()) {
fprintf(stderr, " * %s\n", warning.c_str());
}
}
TerminateFiled(0);
}
if (test_config) { TerminateFiled(0); }

/* Maximum 1 daemon at a time */
ReadStateFile(me->working_directory, "bareos-fd",
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/filed_conf.cc
Expand Up @@ -109,7 +109,7 @@ static ResourceItem cli_items[] = {
{"PkiCipher", CFG_TYPE_CIPHER, ITEM(res_client, pki_cipher), 0, CFG_ITEM_DEFAULT, "aes128", NULL,
"PKI Cipher used for data encryption."},
{"VerId", CFG_TYPE_STR, ITEM(res_client, verid), 0, 0, NULL, NULL, NULL},
{"Compatible", CFG_TYPE_BOOL, ITEM(res_client, compatible), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL},
{"Compatible", CFG_TYPE_BOOL, ITEM(res_client, compatible), 0, CFG_ITEM_DEPRECATED | CFG_ITEM_DEFAULT, "false", NULL, NULL},
{"MaximumBandwidthPerJob", CFG_TYPE_SPEED, ITEM(res_client, max_bandwidth_per_job), 0, 0, NULL, NULL, NULL},
{"AllowBandwidthBursting", CFG_TYPE_BOOL, ITEM(res_client, allow_bw_bursting), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL},
{"AllowedScriptDir", CFG_TYPE_ALIST_DIR, ITEM(res_client, allowed_script_dirs), 0, 0, NULL, NULL, NULL},
Expand Down
19 changes: 9 additions & 10 deletions core/src/stored/stored.cc
Expand Up @@ -246,6 +246,14 @@ int main(int argc, char* argv[])
my_config->get_base_config_path().c_str());
}

if (my_config->HasWarnings()) {
// messaging not initialized, so Jmsg with M_WARNING doesn't work
fprintf(stderr, _("There are configuration warnings:\n"));
for (auto& warning : my_config->GetWarnings()) {
fprintf(stderr, " * %s\n", warning.c_str());
}
}

if (!foreground && !test_config) {
daemon_start("bareos-sd", pidfile_fd, pidfile_path); /* become daemon */
InitStackDump(); /* pick up new pid */
Expand All @@ -258,16 +266,7 @@ int main(int argc, char* argv[])

InitReservationsLock();

if (test_config) {
if (my_config->HasWarnings()) {
/* messaging not initialized, so Jmsg with M_WARNING doesn't work */
fprintf(stderr, _("There are configuration warnings:\n"));
for (auto& warning : my_config->GetWarnings()) {
fprintf(stderr, " * %s\n", warning.c_str());
}
}
TerminateStored(0);
}
if (test_config) { TerminateStored(0); }

MyNameIs(0, (char**)nullptr, me->resource_name_); /* Set our real name */

Expand Down
2 changes: 1 addition & 1 deletion core/src/stored/stored_conf.cc
Expand Up @@ -96,7 +96,7 @@ static ResourceItem store_items[] = {
{"MaximumNetworkBufferSize", CFG_TYPE_PINT32, ITEM(res_store, max_network_buffer_size), 0, 0, NULL, NULL, NULL},
{"ClientConnectWait", CFG_TYPE_TIME, ITEM(res_store, client_wait), 0, CFG_ITEM_DEFAULT, "1800" /* 30 minutes */, NULL, NULL},
{"VerId", CFG_TYPE_STR, ITEM(res_store, verid), 0, 0, NULL, NULL, NULL},
{"Compatible", CFG_TYPE_BOOL, ITEM(res_store, compatible), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL},
{"Compatible", CFG_TYPE_BOOL, ITEM(res_store, compatible), 0, CFG_ITEM_DEPRECATED | CFG_ITEM_DEFAULT, "false", NULL, NULL},
{"MaximumBandwidthPerJob", CFG_TYPE_SPEED, ITEM(res_store, max_bandwidth_per_job), 0, 0, NULL, NULL, NULL},
{"AllowBandwidthBursting", CFG_TYPE_BOOL, ITEM(res_store, allow_bw_bursting), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL},
{"NdmpEnable", CFG_TYPE_BOOL, ITEM(res_store, ndmp_enable), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL},
Expand Down
Expand Up @@ -306,6 +306,7 @@
"datatype": "BOOLEAN",
"code": 0,
"default_value": "false",
"deprecated": true,
"equals": true
},
"MaximumBandwidthPerJob": {
Expand Down Expand Up @@ -592,6 +593,7 @@
"datatype": "BOOLEAN",
"code": 0,
"default_value": "false",
"deprecated": true,
"equals": true
},
"MaximumBandwidthPerJob": {
Expand Down
Expand Up @@ -292,6 +292,7 @@
"datatype": "BOOLEAN",
"code": 0,
"default_value": "false",
"deprecated": true,
"equals": true
},
"MaximumBandwidthPerJob": {
Expand Down

0 comments on commit a629773

Please sign in to comment.