Skip to content

Commit

Permalink
pkgadmin: Workaround missing /usr/local/bin path in cronjob
Browse files Browse the repository at this point in the history
Currently pmirror resides in /usr/local/bin (which is not optimal) and
/usr/local/bin is not incluided in the default path. As a
non-interactive bash or one that is called as /bin/sh (as cron does)
does not read .bashrc, we don't have /usr/local/bin in the path.
However, the pkgadmin command expected "pmirror" to be in the path.

As a workaround, until the default path is updated to include
/usr/local/bin (and /usr/sbin ?) , read our .bashrc to get all
PATHs we are used to.

Another workaround would be to set SHELL an BASH_ENV in the crontab file
to have all of the .bashrc settings.

    SHELL=/usr/bin/bash
    BASH_ENV=./.bashrc
    0 2 * * * root pkgadmin update

Another workaround would be

    0 2 * * * root PATH=/usr/local/bin:/usr/sbin:$PATH pkgadmin update
  • Loading branch information
donald committed Aug 16, 2018
1 parent b616e4b commit 9b8d1a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgadmin/crond-pkgadmin-update
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
RANDOM_DELAY=240
0 2 * * * root /usr/sbin/pkgadmin update
0 2 * * * root . ./.bashrc;pkgadmin update

0 comments on commit 9b8d1a5

Please sign in to comment.