]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/lua/doc: fix luajson example
authorYuval Lifshitz <ylifshit@ibm.com>
Tue, 4 Jul 2023 15:38:04 +0000 (15:38 +0000)
committerYuval Lifshitz <ylifshit@redhat.com>
Thu, 5 Oct 2023 14:21:32 +0000 (17:21 +0300)
Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
doc/radosgw/lua-scripting.rst

index be5619041535976b0b60c4ff34f4af08136cc0e6..9f32dac1a49717cfe960c463b27f30a8c1f34d98 100644 (file)
@@ -460,16 +460,23 @@ First we should add the following packages to the allowlist:
 
 ::
 
-  # radosgw-admin script-package add --package=luajson
+  # radosgw-admin script-package add --package=lua-cjson --allow-compilation
   # radosgw-admin script-package add --package=luasocket --allow-compilation
 
 
-Then, do a restart for the radosgw and upload the following script to the ``postrequest`` context:
+Then, run a server to listen on the Unix socket. For example, use "netcat":
+
+::
+
+  # rm -f /tmp/socket       
+  # nc -vklU /tmp/socket
+
+And last, do a restart for the radosgw and upload the following script to the ``postrequest`` context:
 
 .. code-block:: lua
 
   if Request.RGWOp == "get_obj" then
-    local json = require("json")
+    local json = require("cjson")
     local socket = require("socket")
     local unix = require("socket.unix")
     local s = assert(unix())