title: User permissions reading a file in Ubuntu
body: <p>I have a simple statement I want to run inside a consul HA script. Consul uses the permissions consul:consul for user:group. But the statement I want to run inside a consul script is a log file from a MySQl datadir with permissions mysql:mysql. When I run the statement outside the consul script using sudo, its runs just fine as expected. But when run inside the consul script, it gives me permission errors. So I changed the permissions to the mysql log file to chmod 755, and added my consul user to the mysql group. But even after doing that, I still cannot read the mysql log file inside my consul script and still getting the permission error. But when I log into the terminal as a consul user using su consul, I can access the mysql log file with no problems. So I am puzzled while I cannot access the file inside the consul script. So here is the simple statement I want to run inside the consul script:</p>
  
  <pre><code>ST=$(less /srv/mysql/*.err |grep 'State transfer');
  </code></pre>
  
  <p>And the error I am getting is:</p>
  
  <pre><code>/srv/mysql/db-test-1.err: Permission denied
  </code></pre>