#1156 Issue closed: Create prep script for RECOVERY_UPDATE_URL required programs

Labels: enhancement, fixed / solved / done

gdha opened issue at 2017-01-06 07:25:

  • rear version (/usr/sbin/rear -V): 1.19-git
  • Brief description of the issue: RECOVERY_UPDATE_URL="http://my_internal_server/$HOSTNAME.rear_config.tgz"
  • Work-around, if any: add REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" curl ) to local.conf

I think it would be beneficial if there was a prep script which does this for you (automate as much as possible)

jsmeix commented at 2017-01-09 09:13:

Yes, I forgot to put that on my todo list.
The standard REQUIRED_PROGS (i.e. currently 'curl')
for RECOVERY_UPDATE_URL should be automated.

jsmeix commented at 2017-03-16 13:41:

According to
https://github.com/rear/rear/issues/1229#issuecomment-286772308
that reads (excerpt)

@schlomo commented
...
BTW, I would also not mind if ReaR would
take along curl and its SSL libraries if curl is present.
I think that curl is such a useful tool that we should
consider that (although wget is not included by default).

I think I will simply add 'curl' to the default PROGS array
because I also think that in the ReaR recovery system
there should be by default a program so that the user
can download things from remote whenever needed.

schlomo commented at 2017-03-16 14:10:

You'll probably also would want to take along the https support libs.

Thanks a lot, Schlomo

Am 16.03.2017 2:41 nachm. schrieb "Johannes Meixner" <
notifications@github.com>:

According to
#1229 (comment)
https://github.com/rear/rear/issues/1229#issuecomment-286772308
that reads (excerpt)

@schlomo commented
...
BTW, I would also not mind if ReaR would
take along curl and its SSL libraries if curl is present.
I think that curl is such a useful tool that we should
consider that (although wget is not included by default).

I think I will simply add 'curl' to the default PROGS array
because I also think that in the ReaR recovery system
there should be by default a program so that the user
can download things from remote whenever needed.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/rear/rear/issues/1156#issuecomment-287059852, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGMCJcKVhcXbBXgZ_d7gddk3tpNfsbeks5rmTwJgaJpZM4LcePq
.

didacog commented at 2017-03-16 14:31:

Then, The code on usr/share/rear/init/default/010_set_drlm_env.sh

PROGS=( "${PROGS[@]}" curl )

# Needed for curl (HTTPs)
COPY_AS_IS=( ${COPY_AS_IS[@]} /etc/ssl/certs/* /etc/pki/* )

LIBS=(
    "${LIBS[@]}"
    /lib*/libnsspem.so*
    /usr/lib*/libnsspem.so*
    /lib*/libfreebl*.so*
    /usr/lib*/libfreebl*.so*
    /lib*/libnss3.so*
    /usr/lib*/libnss3.so*
    /lib*/libnssutil3.so*
    /usr/lib*/libnssutil3.so*
    /lib*/libsoftokn3.so*
    /usr/lib*/libsoftokn3.so*
    /lib*/libsqlite3.so*
    /usr/lib*/libsqlite3.so*
    /lib*/libfreeblpriv3.so*
    /usr/lib*/libfreeblpriv3.so*
    /lib*/libssl.so*
    /usr/lib*/libssl.so*
    /lib*/libnssdbm3.so*
    /usr/lib*/libnssdbm3.so*
)

Should be moved to a default place.

The code I've posted here is tested on SLES, Debian and RHEL (nss) with HTTP & HTTPS.

gdha commented at 2017-03-16 14:48:

@didacog Why were the libraries not picked up automatically? I'm pretty sure curl does not need /lib*/libsqlite3.so*

didacog commented at 2017-03-16 14:50:

@gdha in RHEL/CentOS curl is compiled with NSS support and the certs for NSS are stored in sqlite DB in /etc/pki/nss/.... I've tested hard until with all those libraries worked.

jsmeix commented at 2017-03-16 14:55:

FYI:
In a ReaR recovery system made on SLES12 SP2 system
with plain 'curl' added to PROGS but without any specially
included additional libs, i.e. made with the changes in
https://github.com/rear/rear/pull/1248
I get

# for l in libnsspem libfreebl libnss3 libnssutil3 libsoftokn3 libsqlite3 libfreeblpriv3 libssl libnssdbm3 ; do find / | grep $l ; done

/lib64/libssl.so.1.0.0

didacog commented at 2017-03-16 14:57:

In SLES and debian/ubuntu less libs are needed, but for RHEL/CentOS some are required by NSS and I've added more for SSL and also COPY_AS_IS=( ${COPY_AS_IS[@]} /etc/ssl/certs/* /etc/pki/* )

jsmeix commented at 2017-03-16 14:59:

I did
https://github.com/rear/rear/pull/1248
as a hopefully first step in the right direction
which works for me with plain 'curl' with plain HTTP.

I know nothing at all about whatever special
https support libs for curl so that I cannot help
in any way to get that properly implemented.

If possible I would like @didacog to implement
special https support libs for curl properly via
a separated pull request.

didacog commented at 2017-03-16 15:23:

Without SSL also are required for RHEL/CentOS (nss):

LIBS=(
    "${LIBS[@]}"
    /usr/lib*/libsoftokn3.so*
    /usr/lib*/libsqlite3.so*
    /lib*/libfreeblpriv3.so*
    /usr/lib*/libfreeblpriv3.so*
)

jsmeix commented at 2017-03-17 08:28:

With https://github.com/rear/rear/pull/1248 merged
I close this particular issue as "fixed/solved/done".
Further adaptions and enhancements for advanced
'curl' functionality like HTTPS support need to be done
via separated issues and separated pull requests.

didacog commented at 2017-03-22 16:58:

@gdha @jsmeix

to set default LIBS, ... for curl (SSL) the correct location is usr/share/rear/conf/GNU/Linux.conf?

In that case i will send a PR with:

# Needed for curl (HTTPs)
COPY_AS_IS=( ${COPY_AS_IS[@]} /etc/ssl/certs/* /etc/pki/* )

LIBS=(
    "${LIBS[@]}"
    /lib*/libnsspem.so*
    /usr/lib*/libnsspem.so*
    /lib*/libfreebl*.so*
    /usr/lib*/libfreebl*.so*
    /lib*/libnss3.so*
    /usr/lib*/libnss3.so*
    /lib*/libnssutil3.so*
    /usr/lib*/libnssutil3.so*
    /lib*/libsoftokn3.so*
    /usr/lib*/libsoftokn3.so*
    /lib*/libsqlite3.so*
    /usr/lib*/libsqlite3.so*
    /lib*/libfreeblpriv3.so*
    /usr/lib*/libfreeblpriv3.so*
    /lib*/libssl.so*
    /usr/lib*/libssl.so*
    /lib*/libnssdbm3.so*
    /usr/lib*/libnssdbm3.so*
)

in usr/share/rear/conf/GNU/Linux.conf

and I will remove them from usr/share/rear/init/default/010_set_drlm_env.sh

Regards,


[Export of Github issue for rear/rear.]