Update fail if /var/mail is symlink

  • Hi, found a little problem while upgrading from 1.1.5 to 1.1.20. In my case /var/mail is a symlink to another raid. Error message:


    Code
    1. autoinstaller::Functions::_installFiles: /bin/cp: cannot overwrite
    2. non-directory `/var/mail' with directory `/tmp/imscp/var/mail'
    3. autoinstaller::Functions::install: An error occured while performing
    4. installation steps
    5. iMSCP::Debug::END: Exit code: 1


    Of course i could remove the symlink and copy the whole mail directory to /var, but maybe someone has a "better" solution. Maybe i could edit ..autoinstaller/Layout/Debian.xml (SYSTEM_MAIL_VIRTUAL)?


    Thanks for your help :)

  • Hello ;



    Give me some minute to test something.


    Edit:


    I'm able to reproduce:


    Shell-Script
    1. root@trusty:~# ls
    2. test tree truetest
    3. root@trusty:~# cp -fR /root/tree/* /
    4. cp: cannot overwrite non-directory ‘/root/test’ with directory ‘/root/tree/root/test’
    5. root@trusty:~#


    Give me some time to find a workaround ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Re;


    Shell-Script
    1. root@trusty:~# ls
    2. test tree truetest usr
    3. root@trusty:~# rsync -K -a /root/tree/* /
    4. root@trusty:~#


    Do the job as expected. I'll see if I can replace the cp command by rsync easily ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Re;


    How to fix for your current version:


    1. Install the rsync package if not already there
    2. Edit the autoinstaller/Functions.pm file inside the i-MSCP archive and change the line 814 by:


    Perl
    1. $rs = execute("/usr/bin/rsync -K -a $main::{'INST_PREF'}/* /", \$stdout, \$stderr);


    Save the file and once it's done, rerun the i-MSCP installer ( perl imscp-autoinstall -d ). This fix will be part of next release.


    Thank for your report.


    Edit: Updated line number according the 1.1.x branch ( previous was for the 1.2.x branch )

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206