From 2aa74c2eb9fca905095769b9599cae97dc20917e Mon Sep 17 00:00:00 2001 From: fangshunjian Date: Thu, 18 Oct 2018 16:02:47 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9nc=20=E5=91=A8?= =?UTF-8?q?=E6=9C=9F=E5=90=AF=E5=8A=A8=20=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E6=89=A7=E8=A1=8C=E7=9A=84=20bug=EF=BC=8C=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=20./=20,=E7=AC=AC=E4=B8=89=E6=96=B9=E7=9B=91=E6=B5=8B?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=20=E8=B5=8B=E4=BA=88=20777=20=E6=9D=83?= =?UTF-8?q?=E9=99=90=202=E3=80=81=E4=BF=AE=E6=94=B9=20log4j=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=20error=20=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=AD=A3=E7=A1=AE=E8=BE=93=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + bin/log4j.properties.svntmp | 15 --------------- src/com/nis/nmsclient/common/Common.java | 3 ++- .../nis/nmsclient/thread/socket/SSLServer.java | 3 ++- src/log4j.properties | 3 +-- 5 files changed, 6 insertions(+), 19 deletions(-) create mode 100644 .gitignore delete mode 100644 bin/log4j.properties.svntmp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e56e04 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bin diff --git a/bin/log4j.properties.svntmp b/bin/log4j.properties.svntmp deleted file mode 100644 index c5aa4c7..0000000 --- a/bin/log4j.properties.svntmp +++ /dev/null @@ -1,15 +0,0 @@ -log4j.rootLogger = debug,stdout,logfile - -log4j.appender.stdout = org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout.ConversionPattern = %d %p [%c] [%t] - <%m>%n -log4j.appender.stdout.layout = org.apache.log4j.PatternLayout - -#----------------------debug--------------------- - -log4j.appender.logfile = org.apache.log4j.RollingFileAppender -log4j.appender.logfile.MaxFileSize = 50MB -log4j.appender.logfile.MaxBackupIndex = 20 - -log4j.appender.logfile.File = ./nc_logs/nmsclient.log -log4j.appender.logfile.layout.ConversionPattern = %d %p [%c] [%t] - <%m>%n -log4j.appender.logfile.layout = org.apache.log4j.PatternLayout diff --git a/src/com/nis/nmsclient/common/Common.java b/src/com/nis/nmsclient/common/Common.java index 7b56c16..cb8e26d 100644 --- a/src/com/nis/nmsclient/common/Common.java +++ b/src/com/nis/nmsclient/common/Common.java @@ -421,7 +421,8 @@ public class Common { if (os.startsWith("Windows")) { command = scriptFile.getCanonicalPath(); } else if (os.startsWith("Linux")) { - command = "./ " + scriptFile.getCanonicalFile(); +// command = "./ " + scriptFile.getCanonicalFile(); + command = scriptFile.getCanonicalPath(); } setInfo.setProcessPath(command); // 设置执行命令 setInfo.setProcessSearchKeyCode(scriptFile.getName()); // 搜索关键字 diff --git a/src/com/nis/nmsclient/thread/socket/SSLServer.java b/src/com/nis/nmsclient/thread/socket/SSLServer.java index 27852f8..88b0368 100644 --- a/src/com/nis/nmsclient/thread/socket/SSLServer.java +++ b/src/com/nis/nmsclient/thread/socket/SSLServer.java @@ -32,6 +32,7 @@ import com.nis.nmsclient.thread.task.TaskReqHandle; import com.nis.nmsclient.util.DateUtil; import com.nis.nmsclient.util.FileUtil; import com.nis.nmsclient.util.FileWrUtil; +import com.nis.nmsclient.util.ProcessUtil; import com.nis.nmsclient.util.Utils; /** @@ -203,7 +204,7 @@ public class SSLServer implements Runnable { this.sendMessageByChar(SUCCESS); this.bpReceiveFileByBath(pluginDir.getCanonicalPath()); this.sendMessageByChar(SUCCESS); - + ProcessUtil.permit(777, pluginDir);//赋予执行权限 } else if(SERVER_FILE_PUSH.equalsIgnoreCase(msg)){//任务操作:文件推送 this.sendMessageByChar(SUCCESS); String str = this.receiveMessageByChar(); diff --git a/src/log4j.properties b/src/log4j.properties index 3bffcbc..5dc7440 100644 --- a/src/log4j.properties +++ b/src/log4j.properties @@ -1,4 +1,4 @@ -log4j.rootLogger = debug,stdout,logfile +log4j.rootLogger = debug,stdout,logfile,errorLog log4j.appender.stdout = org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout.ConversionPattern = %d %p [%l] [%t] - <%m>%n @@ -15,7 +15,6 @@ log4j.appender.logfile.layout.ConversionPattern = %d %p [%l] [%t] - <%m>%n log4j.appender.logfile.layout = org.apache.log4j.PatternLayout #----------------------error--------------------- -log4j.logger.errorLog = warn,errorLog log4j.appender.errorLog = org.apache.log4j.RollingFileAppender log4j.appender.errorLog.MaxFileSize = 50MB log4j.appender.errorLog.Append = true