File tree 2 files changed +11
-5
lines changed
runner-core/src/main/java/org/apache/apisix/plugin/runner/server
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,15 @@ Note: If you see some error logs like
64
64
phase_func(): failed to connect to the unix socket unix:/tmp/runner.sock: permission denied
65
65
` ` `
66
66
67
- in the `error.log` of APISIX, you can change the permissions of this file for debug, execute commands like
68
-
69
- ` ` ` shell
70
- chmod 766 /tmp/runner.sock
67
+ in the `error.log` of APISIX, ensure the APISIX user is provided rights on the socket. This can be done
68
+ for instance by using a common group. Example :
69
+
70
+ ` ` ` bash
71
+ groupadd apisix_group
72
+ usermod -aG apisix_group apisix
73
+ usermod -aG apisix_group java_plugin_runner
74
+ chown java_plugin_runner:apisix_group /tmp/runner.sock
75
+ chmod 760 /tmp/runner.sock
71
76
` ` `
72
77
73
78
To get more detailed debugging information, you can modify the output level of the log.
Original file line number Diff line number Diff line change 32
32
import org .springframework .beans .factory .annotation .Value ;
33
33
import org .springframework .boot .CommandLineRunner ;
34
34
import org .springframework .stereotype .Component ;
35
+
35
36
import com .google .common .cache .Cache ;
36
37
import io .netty .bootstrap .ServerBootstrap ;
37
38
import io .netty .channel .ChannelFuture ;
@@ -114,7 +115,7 @@ public void start(String path) throws Exception {
114
115
try {
115
116
initServerBootstrap (bootstrap );
116
117
ChannelFuture future = bootstrap .bind (new DomainSocketAddress (path )).sync ();
117
- Runtime .getRuntime ().exec ("chmod 777 " + socketFile );
118
+ Runtime .getRuntime ().exec ("chmod 700 " + socketFile );
118
119
logger .warn ("java runner is listening on the socket file: {}" , socketFile );
119
120
120
121
future .channel ().closeFuture ().sync ();
You can’t perform that action at this time.
0 commit comments