Hi I am running the command /usr/bin/rsync -avO /var/lib/mysql sms@hostaa:/var/lib/ > /tmp/rsync-${TIMESTAMP}.log 2>&1 I am getting the below error in the log file mysql/ rsync: failed to set permissions on "/var/lib/mysql": Operation not permitted (1) rsync: failed to open "/var/lib/mysql/ib_logfile0", continuing: Permission denied (13) mysql/ib_logfile0 rsync: failed to open "/var/lib/mysql/ib_logfile1", continuing: Permission denied (13) mysql/ib_logfile1 rsync: failed to open "/var/lib/mysql/ibdata1", continuing: Permission denied (13) mysql/ibdata1 rsync: failed to open "/var/lib/mysql/master.info", continuing: Permission denied (13) mysql/master.info rsync: failed to open "/var/lib/mysql/SCHEDULER/ScheduleTasks.MYD", continuing: Permission denied (13) Any thing I am missing Thanks and Regards Kaushal -------------- next part -------------- HTML attachment scrubbed and removed
On Tue 25 Mar 2008, Kaushal Shriyan wrote:> > I am running the command > > /usr/bin/rsync -avO /var/lib/mysql sms@hostaa:/var/lib/ > > /tmp/rsync-${TIMESTAMP}.log 2>&1 > > I am getting the below error in the log file > > mysql/ > rsync: failed to set permissions on "/var/lib/mysql": Operation not > permitted (1)Does the "sms" user on hostaa have permission to set permissions on /var/lib/mysql? I would guess not, that's probably owned by the "mysql" user... That's the cause of your error. Paul Slootman
On Wed, Mar 26, 2008 at 6:21 PM, Matt McCutchen <matt@mattmccutchen.net> wrote:> On Tue, 2008-03-25 at 23:21 +0530, Kaushal Shriyan wrote: > > How do i set the "sms" user on hostaa to have permission to set > > permissions on > > /var/lib/mysql? > > > > I have given #setfacl -R -m u:sms:rwx /var/lib/mysql on hostaa > > #setfacl -R -m g:sms:rwx /var/lib/mysql on hostaa > > The second command is unnecessary; granting access to the user "sms" is > enough. But you also have to set the default ACL so that "sms" will > have permissions on new files created by "mysql". To do this, run the > same command plus the -d option: > > ?setfacl -R -dm u:sms:rwx /var/lib/mysql > > You should also add user "mysql" to the access and default ACLs in the > same way so that it will have access to files created by "sms". > Finally, adding "rwx" entries to the access ACLs of existing files will > turn on their S_IXGRP permission bit. To fix that bit, run: > > chmod -R g-x,g+X /var/lib/mysql > > At this point, the "failed to open" errors should go away. Rsync may > still fail to set the times of /var/lib/mysql because it is owned by > user "mysql" and only the owner of a file is allowed to set its times > arbitrarily. To get rid of that error, you can pass --omit-dir-times . > > Matt > >Hi Matt I followed your suggestion, but no luck I did ?setfacl -R -dm u:sms:rwx /var/lib/mysql on hostaa ?setfacl -R -dm u:mysql:rwx /var/lib/mysql on hostaa chmod -R g-x,g+X /var/lib/mysql on hostaa I am still getting the below error building file list ... done mysql/ rsync: failed to set permissions on "/var/lib/mysql": Operation not permitted (1) rsync: failed to set permissions on "/var/lib/mysql/.keep_dev-db_mysql-0": Operation not permitted (1) rsync: failed to set permissions on "/var/lib/mysql/host0084-bin.000001": Operation not permitted (1) rsync: failed to set permissions on "/var/lib/mysql/host0084-bin.000002": Operation not permitted (1) rsync: failed to set permissions on "/var/lib/mysql/host0084-bin.000003": Operation not permitted (1) rsync: failed to set permissions on "/var/lib/mysql/host0084-bin.index": Operation not permitted (1) rsync: failed to set permissions on "/var/lib/mysql/host0084-relay-bin.000001": Operation not permitted (1) rsync: failed to set permissions on "/var/lib/mysql/host0084-relay-bin.index": Operation not permitted (1) mysql/ib_logfile0 mysql/ib_logfile1 mysql/ibdata1 mysql/master.info rsync: failed to set permissions on "/var/lib/mysql/relay-log.info": Operation not permitted (1) Please let me know if i am missing something Thanks and Regards Kaushal
On Thu, Mar 27, 2008 at 7:56 PM, Kaushal Shriyan <kaushalshriyan@gmail.com> wrote:> > On Wed, Mar 26, 2008 at 6:21 PM, Matt McCutchen <matt@mattmccutchen.net> wrote: > > On Tue, 2008-03-25 at 23:21 +0530, Kaushal Shriyan wrote: > > > How do i set the "sms" user on hostaa to have permission to set > > > permissions on > > > /var/lib/mysql? > > > > > > I have given #setfacl -R -m u:sms:rwx /var/lib/mysql on hostaa > > > #setfacl -R -m g:sms:rwx /var/lib/mysql on hostaa > > > > The second command is unnecessary; granting access to the user "sms" is > > enough. But you also have to set the default ACL so that "sms" will > > have permissions on new files created by "mysql". To do this, run the > > same command plus the -d option: > > > > ?setfacl -R -dm u:sms:rwx /var/lib/mysql > > > > You should also add user "mysql" to the access and default ACLs in the > > same way so that it will have access to files created by "sms". > > Finally, adding "rwx" entries to the access ACLs of existing files will > > turn on their S_IXGRP permission bit. To fix that bit, run: > > > > chmod -R g-x,g+X /var/lib/mysql > > > > At this point, the "failed to open" errors should go away. Rsync may > > still fail to set the times of /var/lib/mysql because it is owned by > > user "mysql" and only the owner of a file is allowed to set its times > > arbitrarily. To get rid of that error, you can pass --omit-dir-times . > > > > Matt > > > > > > Hi Matt > > I followed your suggestion, but no luck > I did ?setfacl -R -dm u:sms:rwx /var/lib/mysql on hostaa > ?setfacl -R -dm u:mysql:rwx /var/lib/mysql on hostaa > chmod -R g-x,g+X /var/lib/mysql on hostaa > > I am still getting the below error > > building file list ... done > > mysql/ > rsync: failed to set permissions on "/var/lib/mysql": Operation not > permitted (1) > rsync: failed to set permissions on > "/var/lib/mysql/.keep_dev-db_mysql-0": Operation not permitted (1) > rsync: failed to set permissions on > "/var/lib/mysql/host0084-bin.000001": Operation not permitted (1) > rsync: failed to set permissions on > "/var/lib/mysql/host0084-bin.000002": Operation not permitted (1) > rsync: failed to set permissions on > "/var/lib/mysql/host0084-bin.000003": Operation not permitted (1) > rsync: failed to set permissions on > "/var/lib/mysql/host0084-bin.index": Operation not permitted (1) > rsync: failed to set permissions on > "/var/lib/mysql/host0084-relay-bin.000001": Operation not permitted > (1) > rsync: failed to set permissions on > "/var/lib/mysql/host0084-relay-bin.index": Operation not permitted (1) > mysql/ib_logfile0 > mysql/ib_logfile1 > mysql/ibdata1 > mysql/master.info > rsync: failed to set permissions on "/var/lib/mysql/relay-log.info": > Operation not permitted (1) > > Please let me know if i am missing something > > Thanks and Regards > > Kaushal >Hi Matt, Any clue on the issue Thanks Kaushal