Skip to content

Check that rsync is available before installto.sh starts copying - #10437

Open
dualfroz wants to merge 2 commits into
roundcube:masterfrom
dualfroz:fix/10010-installto-rsync-check
Open

dualfroz wants to merge 2 commits into
roundcube:masterfrom
dualfroz:fix/10010-installto-rsync-check

Conversation

@dualfroz

Copy link
Copy Markdown

bin/installto.sh only checked for system() and then called rsync for every directory, so without rsync it stopped halfway with rsync: not found after already touching the target. it now checks for rsync at the start and exits with a clear error before copying anything, fixes #10010

installto.sh only checked for the PHP system() function and then ran
rsync for every directory. Without rsync installed it created
public_html in the target and stopped with "rsync: command not found"
in the middle of the update. Look it up once at the start and exit
with a clear message instead.
Comment thread bin/installto.sh Resolved
Comment thread CHANGELOG.md Resolved
@dualfroz

Copy link
Copy Markdown
Author

done, it runs rsync --version now, checks shell_exec too, and the changelog entry is gone

Comment thread bin/installto.sh
rcube::raise_error('PHP shell_exec() function is required. Check disable_functions in php.ini.', false, true);
}

if (system('rsync --version > /dev/null 2>&1', $ret) === false || $ret > 0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can replace it with rcube::exec() call and skip that output redirection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a check for the rsync command within bin/installto.sh script

2 participants