Bug 243102 - sysutils/bareos-server: make_catalog_backup.pl can't find mysqldump
Summary: sysutils/bareos-server: make_catalog_backup.pl can't find mysqldump
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-05 03:27 UTC by Ryan
Modified: 2024-01-24 01:27 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (acm)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan 2020-01-05 03:27:30 UTC
Line 101 of /usr/local/lib/bareos/scripts/make_catalog_backup.pl calls for `mysqldump` however, when run from bconsole or on a schedule, the script fails and Bareos displays the following:

BeforeJob: sh: mysqldump: not found
Error: Runscript: BeforeJob returned non-zero status=127. ERR=Child exited with code 127

If I prepend `/usr/local/bin/` to `mysqldump` on line 101 it resolves the issue.

I have a feeling there's a better way to fix this, I'm just not sure how. I tried adding a `.profile` file exporting PATH to bareos's home directory but that didn't seem to make a difference.
Comment 1 Ryan 2020-01-05 03:32:46 UTC
Relates to bug #209811
Comment 2 Leo L. Schwab 2020-03-16 07:14:52 UTC
I bumped in to a relative of this today while setting up a new install.  My setup is using postgresql, and the log message read:

15-Mar 22:14 xxxxx JobId 5: BeforeJob: sh: pg_dump: not found

`pg_dump` was definitely installed.  I spent a few hours diagnosing it.  Essentially the problem is that rc.d launches bareos-dir with the PATH set to "/sbin:/bin:/usr/sbin:/usr/bin".  However, the postgresql11-client package installs all the utilities in /usr/local/bin, so job scripts launched from bareos-dir won't find it.

I'm not sure what the Correct Way to fix this is.  I managed to work around the issue by adding the following line to /etc/rc.conf:

bareos_dir_env="PATH=$PATH:/usr/local/sbin:/usr/local/bin"

And then restarting bareos-dir.  I then ran the catalog backup job manually from `bconsole`, which completed successfully.

Note that this trick only appears to work from within `run_rc_command` itself.  If you use `sysrc -A` to check the setting, the "$PATH" part won't be expanded correctly, instead displaying as:

bareos_dir_env: PATH=:/usr/local/sbin:/usr/local/bin
Comment 3 junemartin 2023-09-05 07:19:06 UTC
LOT Polish Airlines is situated at Terminal An at Newark Freedom Worldwide Air terminal (EWR). Explorers flying with LOT Polish Airlines can track down their registration, takeoff entryways, and different administrations inside Terminal A. LOT Polish Newark Terminal offers a scope of conveniences and offices to guarantee a smooth and lovely travel insight for travelers flying with LOT Polish Airlines.
https://airlinesbuddy.com/lot-polish-airlines-newark-liberty-airport-terminal-ewr/