参考文档:https://www.cnblogs.com/tinywan/p/6809879.html https://github.com/juce/sockproc https://blog.csdn.net/weixin_38652136/article/details/85775789
按照参考文档中的来做的话,shell.sock被放到了/tmp目录下,但是使用过程中,一直报文件找不到。 解决办法是将shell.sock放到其他目录。
connect() to unix:/tmp/shell.sock failed (2: No such file or directory)例如:
./sockproc /data/shell.sock chmod 0666 /data/shell.sock在lua中使用的时候更换下地址即可。
require "resty.shell"加载resty.shell模块的时候失败。参考的链接中,他resty.shell文件的拷贝看不懂,然后我是放到了跟我的nginx.conf的相对目录下的。 /resty/shell.lua 放到了这里。 也可以直接在nginx.conf里面的server标签前面直接装载模块。
lua_package_path "resty.shell的绝对路径" server {...}服务器重启后,就会报错
connect() to unix:/data/shell/shell.sock failed (111: Connection refused)所以需要重新执行
./sockproc /data/shell.sock chmod 0666 /data/shell.sock命令。 我们可以把这两个命令放到开机启动时自动执行的脚本中。参考连接https://blog.csdn.net/weixin_38652136/article/details/85775789 vim /etc/rc.d/rc.local内容如下:
touch /var/lock/subsys/local sudo /usr/local/k8s/lua/sockproc/sockproc /data/shell/shell.sock sudo chmod 0666 /data/shell/shell.sock