#48 md5sum failed on Mac OS X Lion / Snow Leopard

v3.0_testing
closed-invalid
nobody
3
2011-09-15
2011-09-15
Philipp
No

If you execute install.sh on a Lion or Snow Leopard you get an md5sum failed:

###

### Checking archive files for existence, readability and integrity.

automysqlbackup ... exists and is readable ... md5sum failed :(

###

I copied also from a Linux server over scp to my macs and I had always md5sum faild.

Discussion

  • Philipp
    Philipp
    2011-09-15

    • summary: md5sum faild on Mac OS X Lion / Snow Leopard --> md5sum failed on Mac OS X Lion / Snow Leopard
    • priority: 5 --> 7
     
  • Philipp
    Philipp
    2011-09-15

    System Version: Mac OS X 10.6.8 (10K549)
    Kernel Version: Darwin 10.8.0

     
  • PittaGurneyi
    PittaGurneyi
    2011-09-15

    Hi, I need more information.
    Please add the output of:
    grep 'precheck_files=( automysqlbackup' install.sh
    md5sum automysqlbackup

    Please also test the latter on the Linux server, if possible. There isn't much room for possible errors here, since I just checked the files in our archive - they are just fine.

    Perhaps you can modify one line of install.sh

    if echo "${precheck_files[$((2*$i+1))]} ${precheck_files[$((2*$i))]}" | md5sum --check >/dev/null 2>&1; then

    into

    if echo "${precheck_files[$((2*$i+1))]} ${precheck_files[$((2*$i))]}" | md5sum --check; then

    then run it again and see if you get an error from md5sum.
    Also an md5sum --help output would be good to see, if the --check routine doesn't exist on your system.

     
  • PittaGurneyi
    PittaGurneyi
    2011-09-15

    • labels: --> 2471126
    • milestone: --> 2188848
     
  • Philipp
    Philipp
    2011-09-15

    I search a litte bit and found out that Mac OS X didn’t have the md5sum installed by default. Only md5 is installed where you can create an md5 hash and md5 hash noch --check routine.

     
  • Philipp
    Philipp
    2011-09-15

    • labels: 2471126 -->
    • milestone: 2188848 -->
     
  • PittaGurneyi
    PittaGurneyi
    2011-09-15

    • labels: --> compatibility
    • milestone: --> v3.0_testing
    • priority: 7 --> 3
    • status: open --> open-invalid
     
  • PittaGurneyi
    PittaGurneyi
    2011-09-15

    Well I'll just add a check in the install.sh to see if md5sum is there or not. Could you just clarify: Is md5sum --check available?

     
  • PittaGurneyi
    PittaGurneyi
    2011-09-15

    • status: open-invalid --> closed-invalid
     
  • PittaGurneyi
    PittaGurneyi
    2011-09-15

    Okay, I'm going to close this but leave it open for comment posting. Please be so kind and answer my last question.

     
  • Philipp
    Philipp
    2011-09-30

    md5sum --check
    -bash: md5sum: command not found

     
  • PittaGurneyi
    PittaGurneyi
    2012-01-25

    I just took another look at this and there seems to be "openssl md5 file_name" available on osx. If one would replace

    if echo "${precheck_files[$((2*$i+1))]} ${precheck_files[$((2*$i))]}" | md5sum --check >/dev/null 2>&1; then
    printf "md5sum okay :)\n"
    else
    printf "md5sum failed :(\n"
    exit 1
    fi

    with

    md5_sum=$(openssl md5 "${precheck_files[$((2*$i))]}")
    md5_sum=${md5_sum##*= }
    if [[ "${precheck_files[$((2*$i+1))]}" = "${md5_sum}" ]]; then
    printf "md5sum okay :)\n"
    else
    printf "md5sum failed :(\n"
    exit 1
    fi

    in the install.sh script, this should work.

    However this relies on the fact, that the output openssl produces is of the form

    MD5(path/to/file)= 234890234890
    where there is a = followed by a single space before the actual md5 sum.

    If people using osx would test this and come back to me with the result, i could make changes for the next version.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here


    Anonymous
    2012-06-08

    It seems you just need to replace

    md5sum --check

    with

    md5 -r

    For when running under MacOSX.

    Cheers,

    Brooke

     
  • John Robertson
    John Robertson
    2012-11-05

    I had the same problem on pair.com running install.sh under ssh (under Linux @ pair). So I tried your mod:

    md5_sum=$(openssl md5 "${precheck_files[$((2*$i))]}")
    md5_sum=${md5_sum##*= }
    if [[ "${precheck_files[$((2*$i+1))]}" = "${md5_sum}" ]]; then
    printf "md5sum okay :)\n"
    else
    printf "md5sum failed :(\n"
    exit 1
    fi

    And that worked just fine. I did find this Apache note about md5 issues that you may not be aware of:

    http://ant.apache.org/manual/Tasks/checksum.html

     
  • John Robertson
    John Robertson
    2012-11-05

    I had the same problem on pair.com running install.sh under ssh (under Linux @ pair). So I tried your mod:
    md5_sum=$(openssl md5 "${precheck_files[$((2*$i))]}")
    md5_sum=${md5_sum##*= }
    if [[ "${precheck_files[$((2*$i+1))]}" = "${md5_sum}" ]]; then
    printf "md5sum okay :)\n"
    else
    printf "md5sum failed :(\n"
    exit 1
    fi

    And that worked just fine. I did find a reference to Apache comments on problems with md5 here:

    http://ant.apache.org/manual/Tasks/checksum.html