#1879 Issue closed: 400_restore_duplicity.sh does unconditioned 'export HOSTNAME=$(hostname)'

Labels: cleanup, fixed / solved / done, minor bug

jsmeix opened issue at 2018-07-25 08:32:

  • ReaR version ("/usr/sbin/rear -V"):
    current master code

  • Brief description of the issue:
    In restore/DUPLICITY/default/400_restore_duplicity.sh there is

if [ "$BACKUP_PROG" = "duplicity" ]; then
...
    export HOSTNAME=$(hostname)

which means if at this point the HOSTNAME is not what hostname outputs
then the current HOSTNAME value is changed to what hostname outputs
not only while 400_restore_duplicity.sh runs but
also for all subsequent scripts that run afterwards.

This conflicts with how the HOSTNAME variable is meant to be used in ReaR.

By default he HOSTNAME value is set in default.conf as

HOSTNAME="$( hostname -s 2>/dev/null || uname -n | cut -d. -f1 )"

which could be different compared to HOSTNAME=$(hostname).

Additionally the HOSTNAME value can be specified different by the user
as he likes or needs in his particular case in his etc/rear/local.conf

  • Work-around, if any:
    Use a different Duplicity specific variable name.

jsmeix commented at 2018-07-25 08:33:

@Lukey3332
could you have a look here because you use Duplicity?

jsmeix commented at 2018-07-25 08:36:

According to
git log -p --follow usr/share/rear/restore/DUPLICITY/default/400_restore_duplicity.sh
the HOSTNAME=$(hostname) exists since the beginning via
https://github.com/rear/rear/commit/992df3e35094d935a9711740440e8b93b6c95776

jsmeix commented at 2018-07-26 07:02:

With https://github.com/rear/rear/pull/1880 merged
this issue should be fixed.


[Export of Github issue for rear/rear.]