diff options
| author | reger <reger18@arcor.de> | 2013-12-26 05:07:26 +0100 |
|---|---|---|
| committer | reger <reger18@arcor.de> | 2013-12-26 05:07:26 +0100 |
| commit | 7bdc10c1a078c9a4534fc69e11526c8f6f56417f (patch) | |
| tree | 5c0e0f963ea7c6420fd8529131fa3596cb090418 /installYaCyWindowsService.bat | |
| parent | e05320b776d7ae5db6393c2b35ddad4a7ce74229 (diff) | |
added Windows Service installer
- used Apache procrun as it has a small footprint and comes with a GUI to edit the service settings
see http://commons.apache.org/proper/commons-daemon/procrun.html
- added the service runner exe file under addon/windowsService
as is (without renaming the exe files)
- included installYaCyWindowsService.bat and uninstallYaCyWindowsService.bat to main directory
- which chooses the native exe according to the processor_architecture
Diffstat (limited to 'installYaCyWindowsService.bat')
| -rw-r--r-- | installYaCyWindowsService.bat | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/installYaCyWindowsService.bat b/installYaCyWindowsService.bat new file mode 100644 index 000000000..d5c11e807 --- /dev/null +++ b/installYaCyWindowsService.bat @@ -0,0 +1,46 @@ +@Echo Off
+title YaCy Windows Service Install
+
+:STARTJAVA
+REM set the Java options
+set javaopts=-Xss256k;-XX:MaxPermSize=256m;-XX:-UseGCOverheadLimit;-XX:+UseAdaptiveSizePolicy;-Djava.net.preferIPv4Stack=true;-Djava.awt.headless=true;-Dfile.encoding=UTF-8
+
+REM set max Java heap memory (in MB)
+set jmx=800
+set jms=180
+set servicedesc="P2P SearchEngine"
+
+Rem This target is used to read java runtime parameters out of the yacy config file
+:GETSTARTOPTS
+REM for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\yacy.conf) do (
+REM if "%%i"=="javastart_Xmx" set jmx=%%j
+REM if "%%i"=="javastart_Xms" set jms=%%j
+REM )
+
+Rem choose service runner executable according to processor architecture
+set exepath=addon\windowsService
+if /I "%PROCESSOR_ARCHITECTURE%"=="AMD64" set exepath=addon\windowsService\amd64
+if /I "%PROCESSOR_ARCHITECTURE%"=="IA64" set exepath=addon\windowsService\ia64
+
+Echo JRE Parameters:%javacmd%
+Echo Startpath %~dp0
+
+REM Install YaCy as Windows Service
+%exepath%\prunsrv.exe //IS//YaCy --Jvm=auto --StartMode=jvm --StartClass=net.yacy.yacy --Classpath=htroot;lib/yacycore.jar --StartPath=%~dp0 --JvmOptions=%javaopts% --Startup=auto --JvmMx=%jmx% --JvmMs=%jms% --StopMode=jvm --StopClass=net.yacy.yacy --StopParams=-shutdown --Description=%servicedesc%
+
+if not errorlevel 1 goto installed
+echo Failed installing '%SERVICE_NAME%' service
+goto end
+
+:installed
+REM Start Service manager to check/edit YaCy Service settings
+REM start addon\windowsService\prunmgr.exe //ES//YaCy
+
+Echo start the YaCy service
+%exepath%\prunsrv.exe //ES//YaCy
+
+Echo wait some seconds for YaCy to startup
+timeout /T 10
+explorer http://localhost:8090/
+
+:end
\ No newline at end of file |
