Recently, I deployed a java project on the windows platform to linux. During installation and testing, I encountered the cannot restore segment prot after reloc: Permission denied problem.
Recently, gearman is used. Since the server in C language has never been compiled (it seems to be a boost problem ). So I want to use the server of java version. But I did not expect to encounter some problems.
First, run the following command:
The code is as follows: |
Copy code |
Java-jar java-gearman-service-0.5.jar |
The following message is displayed:
Java/nio/channels/CompletionHandler
Java-gearman-service-0.5
Usage:
Java [jvm options]-jar java-gearman-service-0.5.jar [server options]
Options:
-P PORT -- port = PORT Defines what port number the server will listen on (Default: 4730)
-L LEVEL -- logger = LEVEL Specifies the logging level (Default: 0)
-V -- version Display the version of java gearman service and exit
-? -- Help Print this help menu and exit
Java/nio/channels/CompletionHandler
Java-gearman-service-0.5
Usage: java [jvm options]-jar java-gearman-service-0.5.jar [server options]
Options:-p PORT -- port = PORT Defines what port number the server will listen on (Default: 4730)-l LEVEL -- logger = LEVEL Specifies the logging level (Default: 0) -v -- version Display the version of java gearman service and exit -? -- Help Print this help menu and exit
Then I found the problem on the internet and found it was SELinux, so I had to solve it.
Method 1:
Find/etc/sysconfig/selinux, and change SELINUX to SELINUX = disabled by default. If it is already disabled, you do not need to change it. You can also comment SELINUX = enforcing and add a new line SELINUX = disabled. Save and exit. Continue debugging. If this problem persists, use method 2.
Method 2:
The code is as follows: |
Copy code |
Chcon-t texrel_shlib_t For example: chcon-t texrel_shlib_t/path/name. so |
Method 3:
To solve the problem, follow these steps:
First, edit the configuration file:/etc/selinux/config.
Find the following content:
The code is as follows: |
Copy code |
# This file controls the state of SELinux on the system. # SELINUX = can take one of these three values: # Enforcing-SELinux security policy is enforced. # Permissive-SELinux prints warnings instead of enforcing. # Disabled-SELinux is fully disabled. # SELINUX = enforcing Remove the comment of # SELINUX = enforcing and add the following line: SELINUX = disabled |
Save and exit. The same error is returned. Run the following command:
The code is as follows: |
Copy code |
Chcon-t texrel_shlib_t/usr/local/jdk1.7.0 _ 01/jre/lib/i386/server/libjvm. so |
Note: in the error message, the system prompts which file will be written after an error occurs.
My own problem is
Add the last line of the/etc/profile file
JAVA_HOME = jdk path
CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar
PATH = $ PATH: $ HOME/bin: $ JAVA_HOME/jre/bin
Export PATH JAVA_HOME CLASSPATH
The solution is to modify the/etc/selinux/config file under the root user,
The code is as follows: |
Copy code |
Change SELINUX = enforcing to SELINUX = disabled. |
Then, save and shut down, and restart the machine.
In addition, this can solve this problem. I first tried method 1 and the result did not work. Then GG searched for the problem and executed the command when SELinux was disable, it will certainly solve this problem.