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: 2025-03-09 18:12 UTC (History)
0 users

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
MARKED AS SPAM
Comment 4 jacsonmarg 2024-11-29 07:23:24 UTC
MARKED AS SPAM
Comment 5 williambaker 2024-12-05 05:33:29 UTC
MARKED AS SPAM
Comment 6 williambaker 2024-12-05 05:33:57 UTC
MARKED AS SPAM
Comment 7 williambaker 2024-12-16 04:36:48 UTC
MARKED AS SPAM
Comment 8 daisyden878 2024-12-16 09:01:19 UTC
MARKED AS SPAM
Comment 9 Joseph Haydn 2024-12-17 08:19:51 UTC
MARKED AS SPAM
Comment 10 robertgills 2025-01-09 05:18:48 UTC
MARKED AS SPAM
Comment 11 robertgills 2025-01-28 10:13:55 UTC
MARKED AS SPAM
Comment 12 robertgills 2025-01-28 10:14:43 UTC
MARKED AS SPAM
Comment 13 robertgills 2025-02-06 04:08:56 UTC
MARKED AS SPAM
Comment 14 robertgills 2025-02-06 04:12:14 UTC
MARKED AS SPAM
Comment 15 robertgills 2025-02-06 04:13:19 UTC
MARKED AS SPAM
Comment 16 robertgills 2025-02-07 06:32:54 UTC
MARKED AS SPAM