title: Lua can't import a module and says file not found but the file exists
body: <p>i'm trying to run a lua script from inside haproxy that imports the &quot;pgmoon&quot; library.  i can import pgmoon and get as far as opening a socket, but then i run into this:</p>
  <pre><code>[ALERT] 082/234313 (8) : Lua function 'queue-request': runtime error: /usr/local/share/lua/5.3/pgmoon/init.lua:269: module 'pgmoon.crypto' not found:
  no field package.preload['pgmoon.crypto']
  no file '/usr/local/share/lua/5.3/pgmoon/crypto.lua'
  no file '/usr/local/share/lua/5.3/pgmoon/crypto/init.lua'
  no file '/usr/local/lib/lua/5.3/pgmoon/crypto.lua'
  no file '/usr/local/lib/lua/5.3/pgmoon/crypto/init.lua'
  no file '/usr/share/lua/5.3/pgmoon/crypto.lua'
  no file '/usr/share/lua/5.3/pgmoon/crypto/init.lua'
  no file './pgmoon/crypto.lua'
  no file './pgmoon/crypto/init.lua'
  no file '/usr/local/lib/lua/5.3/pgmoon/crypto.so'
  no file '/usr/lib/x86_64-linux-gnu/lua/5.3/pgmoon/crypto.so'
  no file '/usr/lib/lua/5.3/pgmoon/crypto.so'
  no file '/usr/local/lib/lua/5.3/loadall.so'
  no file './pgmoon/crypto.so'
  no file '/usr/local/lib/lua/5.3/pgmoon.so'
  no file '/usr/lib/x86_64-linux-gnu/lua/5.3/pgmoon.so'
  no file '/usr/lib/lua/5.3/pgmoon.so'
  no file '/usr/local/lib/lua/5.3/loadall.so'
  no file './pgmoon.so' from [C] global 'require', /usr/local/share/lua/5.3/pgmoon/init.lua:269 C function line 267 ..., /usr/local/share/lua/5.3/pgmoon/init.lua:211 method 'connect', /usr/local/haproxy/queue-request.lua:38 C function line 25.
  </code></pre>
  <p>however, there <em>is</em> a file at <code>/usr/local/share/lua/5.3/pgmoon/crypto.lua</code>, this is what <code>ls</code> shows:</p>
  <pre><code># ls -la /usr/local/share/lua/5.3/pgmoon/          
  total 60
  drwxr-xr-x 1 root root  4096 Mar 24 23:42 .
  drwxr-xr-x 1 root root  4096 Mar 24 23:00 ..
  -rw-r--r-- 1 root root  2880 Mar 24 23:00 arrays.lua
  -rw-r--r-- 1 root root  1130 Mar 24 23:00 bit.lua
  -rw-r--r-- 1 root root  1587 Mar 24 23:00 cqueues.lua
  -rw-r--r-- 1 root root   654 Mar 24 23:00 crypto.lua
  -rw-r--r-- 1 root root  2084 Mar 24 23:00 hstore.lua
  -rw-r--r-- 1 root root 20127 Mar 24 23:00 init.lua
  -rw-r--r-- 1 root root   665 Mar 24 23:00 json.lua
  -rw-r--r-- 1 root root  2728 Mar 24 23:42 socket.lua
  -rw-r--r-- 1 root root   457 Mar 24 23:00 util.lua
  </code></pre>
  <p>i could see it being permissions-related, if the haproxy user couldn't access a root owned file, but by the time it gets here it's already executed init.lua which has imported socket.lua and they've all got the same permissions...
  Anybody know why lua thinks there is no file at crypto.lua?</p>