linux - User permissions reading a file in Ubuntu -
i have simple statement want run inside consul ha script. consul uses permissions consul:consul user:group. statement want run inside consul script log file mysql datadir permissions mysql:mysql. when run statement outside consul script using sudo, runs fine expected. when run inside consul script, gives me permission errors. changed permissions mysql log file chmod 755, , added consul user mysql group. after doing that, still cannot read mysql log file inside consul script , still getting permission error. when log terminal consul user using su consul, can access mysql log file no problems. puzzled while cannot access file inside consul script. here simple statement want run inside consul script:
st=$(less /srv/mysql/*.err |grep 'state transfer');
and error getting is:
/srv/mysql/db-test-1.err: permission denied
Comments
Post a Comment