Following is what happens:
if (setgroups(gid_count, gid_list)) { rsyserr(FLOG, errno, "setgroups failed"); io_printf(f_out, "@ERROR: setgroups failed\n"); return -1; }
and from setgroups(2)
" setgroups() sets the supplementary group IDs for the calling process. Appropriate privileges (Linux: the CAP_SETGID capability) are required. "
Either CAP_SETGID is required on rsync binary or only the admin (root) user can do this, which explains why it fails for mysqld.
Following is what happens:
if (setgroups( gid_count, gid_list)) {
rsyserr(FLOG, errno, "setgroups failed");
io_printf(f_out, "@ERROR: setgroups failed\n");
return -1;
}
and from setgroups(2)
"
setgroups() sets the supplementary group IDs for the calling process. Appropriate privileges (Linux: the CAP_SETGID capability) are required.
"
Either CAP_SETGID is required on rsync binary or only the admin (root) user can do this, which explains why it fails for mysqld.