directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject directory-kerby git commit: DIRKRB-697 Add start/stop shell scripts for windows. Contributed by weizhenyua.
Date Fri, 04 May 2018 03:38:12 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk 9dd908b65 -> a975eedad


DIRKRB-697 Add start/stop shell scripts for windows. Contributed by weizhenyua.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/a975eeda
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/a975eeda
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/a975eeda

Branch: refs/heads/trunk
Commit: a975eedad68998d84816c85f80bb61ff1a43f09c
Parents: 9dd908b
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri May 4 11:35:28 2018 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri May 4 11:35:28 2018 +0800

----------------------------------------------------------------------
 kerby-dist/has-dist/bin/start-has.cmd | 101 +++++++++++++++++++++++++++++
 kerby-dist/has-dist/bin/stop-has.cmd  |  35 ++++++++++
 2 files changed, 136 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/a975eeda/kerby-dist/has-dist/bin/start-has.cmd
----------------------------------------------------------------------
diff --git a/kerby-dist/has-dist/bin/start-has.cmd b/kerby-dist/has-dist/bin/start-has.cmd
new file mode 100644
index 0000000..aa0c107
--- /dev/null
+++ b/kerby-dist/has-dist/bin/start-has.cmd
@@ -0,0 +1,101 @@
+@echo off
+
+@rem Licensed to the Apache Software Foundation (ASF) under one
+@rem or more contributor license agreements.  See the NOTICE file
+@rem distributed with this work for additional information
+@rem regarding copyright ownership.  The ASF licenses this file
+@rem to you under the Apache License, Version 2.0 (the
+@rem "License"); you may not use this file except in compliance
+@rem with the License.  You may obtain a copy of the License at
+@rem
+@rem     http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+setlocal
+set CONF_DIR=%1%
+set WORK_DIR=%2%
+
+@rem Pid file to save pid numbers
+set pid=C:\WINDOWS\Temp\has.pid 
+set APP_MAIN=org.apache.kerby.has.server.HasServer
+
+@rem Reset HAS_CONF_DIR and HAS_WORK_DIR if CONF_DIR or WORK_DIR not null
+if not "%CONF_DIR%" == "" (
+  @rem if this is an exist folder
+  if not exist "%CONF_DIR%" (
+    echo. [ERROR] %CONF_DIR% is not a directory
+    call:usage
+    GOTO END
+  )
+) else (
+  if not "%HAS_CONF_DIR%" == "" (
+    if exist "%HAS_CONF_DIR%" (
+      set CONF_DIR=%HAS_CONF_DIR%
+    )
+  ) else (
+    echo. [ERROR] HAS_CONF_DIR is null or not a directory
+    GOTO END
+  )
+)
+
+if not "%WORK_DIR%" == "" (
+  if not exist "%WORK_DIR%" (
+    echo. "[ERROR] %WORK_DIR% is not a directory"
+    call:usage
+    GOTO END
+  )
+) else (
+  if not "%HAS_WORK_DIR%" == "" (
+    if exist "%HAS_WORK_DIR%" (
+      WORK_DIR=%HAS_WORK_DIR%
+    )
+  ) else (
+    echo. [ERROR] HAS_WORK_DIR is null or not a directory
+    GOTO END
+  )
+)
+
+@rem Get HAS_HOME directory
+set bin="%~dp0"
+set HAS_HOME="%~dp0\.."
+@rem cd %HAS_HOME%
+
+for %%a in (%*) do (
+  if -D == %%a (
+    set DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,address=8010,server=y,suspend=n
+  )
+)
+
+set args=%CONF_DIR% %WORK_DIR%
+
+echo [INFO] conf_dir=%CONF_DIR%
+echo [INFO] work_dir=%WORK_DIR%
+
+echo Starting HAS server...
+
+@rem Start HAS server
+start /b java %DEBUG%  ^
+-classpath %HAS_HOME%\target\lib\*;%HAS_HOME%\.  -DHAS_LOGFILE=has ^
+org.apache.kerby.has.server.HasServer -start %args% 
+jps | findstr "HasServer" > %pid%
+endlocal
+jps
+echo Starting HAS server finish 
+GOTO:DONE
+
+:usage
+echo "Usage: start-has.cmd <conf_dir> <working_dir>"
+echo "    Example:"
+echo "        start-has.cmd conf work"
+GOTO:EOF
+
+:END
+echo &pause&goto:eof
+GOTO:EOF
+
+:DONE
+

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/a975eeda/kerby-dist/has-dist/bin/stop-has.cmd
----------------------------------------------------------------------
diff --git a/kerby-dist/has-dist/bin/stop-has.cmd b/kerby-dist/has-dist/bin/stop-has.cmd
new file mode 100644
index 0000000..eb7cd64
--- /dev/null
+++ b/kerby-dist/has-dist/bin/stop-has.cmd
@@ -0,0 +1,35 @@
+@echo off
+
+@rem Licensed to the Apache Software Foundation (ASF) under one
+@rem or more contributor license agreements.  See the NOTICE file
+@rem distributed with this work for additional information
+@rem regarding copyright ownership.  The ASF licenses this file
+@rem to you under the Apache License, Version 2.0 (the
+@rem "License"); you may not use this file except in compliance
+@rem with the License.  You may obtain a copy of the License at
+@rem
+@rem     http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+set pid=C:\WINDOWS\Temp\has.pid
+
+SETLOCAL ENABLEDELAYEDEXPANSION 
+
+if exist %pid% (
+  echo "Stopping HasServer using %pid%..."
+) else (
+  echo "Stopping HasServer using jps grep ..."
+  jps | findstr "HasServer" > %pid%
+)
+
+For /f "tokens=1* delims=:" %%i in ('Type %pid%^|Findstr /n ".*"') do (
+  set pid_line=%%j
+  echo "going to kill !pid_line:~0,-10!"
+  taskkill /pid !pid_line:~0,-10! -t -f
+)
+del %pid%
+


Mime
View raw message