[java-idp-jetty-base] 13/18: IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation
Rod Widdowson
rdw at steadingsoftware.com
Tue Oct 15 15:15:00 UTC 2024
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch dev/IDP-2297
in repository java-idp-jetty-base.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-jetty-base.git;a=commit;h=3f2fa18d7a6000d55b2ccfd7c22e62b29e957346
commit 3f2fa18d7a6000d55b2ccfd7c22e62b29e957346
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Oct 2 10:43:40 2024 +0100
IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation
https://shibboleth.atlassian.net/browse/IDP-2297
Checkpoint more work on the script to set up the system serice for jetty.
Use PR_xxx to set the parameters
Add verb EDIT to call up prunmgr
Fix a few bugs
Add the script to the module
---
.../idp/plugin/jettybase/module.properties | 5 +++
.../idp/plugin/jettybase/module/config-jetty.bat | 44 ++++++++++++++++++----
.../idp/plugin/jettybase/module/runjetty.bat | 2 -
3 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module.properties b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module.properties
index d4c7439..c96f36e 100644
--- a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module.properties
+++ b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module.properties
@@ -65,4 +65,9 @@ jetty.base.module.12.nonwindows = true
jetty.base.module.12.windows = false
jetty.base.module.12.exec = true
+jetty.base.module.13.src = /net/shibboleth/idp/plugin/jettybase/module/config-jetty.bat
+jetty.base.module.13.dest = bin/config-jetty.bat
+jetty.base.module.13.nonwindows = false
+jetty.base.module.13.windows = true
+
diff --git a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/config-jetty.bat b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/config-jetty.bat
index 5bee6a2..895225a 100644
--- a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/config-jetty.bat
+++ b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/config-jetty.bat
@@ -14,7 +14,7 @@ if not exist "%JAVA_HOME%\bin\server\jvm.dll" (
set IDP_HOME_WINDOWS=%~dp0..
set JETTY_BASE=%~dp0..\jetty-base
-set PRUNSRV=%IDP_HOME_WINDOWS%\shibd_idp\prunsrv.exe
+set PRUNSRV=%IDP_HOME_WINDOWS%\shibd_idp\amd64\prunsrv.exe
for /f "tokens=* USEBACKQ" %%F in (`type "%JETTY_BASE%\jetty.base.linux"`) do (
SET IDP_HOME_UNIX=%%F
@@ -22,7 +22,13 @@ for /f "tokens=* USEBACKQ" %%F in (`type "%JETTY_BASE%\jetty.base.linux"`) do (
if "%1" EQU "UNINSTALL" (
@echo on
- %PRUNSRV% //DS//Shibd_idp
+ %PRUNSRV% //DS/Shibd_idp
+ exit /b
+)
+
+if "%1" EQU "EDIT" (
+ @echo on
+ start %IDP_HOME_WINDOWS%\shibd_idp\prunmgr //ES/Shibd_idp
exit /b
)
@@ -34,9 +40,13 @@ if NOT "%1" EQU "INSTALL" (
if NOT "%2" EQU "" (
USERNAME=%2
SET /P PASSWORD="Password for %USERNAME%: "
- USERPASSDIRECTIVE="--ServiceUser=%USERNAME% --ServicePassword=%PASSWORD%
+ SET PR_SERVICEUSER=%USERNAME%
+ SET PR_SERVICEPASSWORD=%PASSWORD%
+) else (
+ SET PR_SERVICEUSER=LocalSystem
)
+
REM
REM First up create and configure the procrun instance which will run jetty
REM This is described in
@@ -44,13 +54,31 @@ REM https://commons.apache.org/proper/commons-daemon/procrun.html
REM And what is set comes from the jetty documentation
REM
SET PORTPASS=%random%-%random%-%random%-%random%
-SET JVMOPTIONS="++JvmOptions=-DIdpHome=%IDP_HOME_UNIX%" ++JvmOptions=-Djdk.tls.ephemeralDHKeySize=2048 ++JvmOptions=-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog "++JvmOptions=java.io.tmpdir=%JETTY_BASE%\tmp" --JvmMx=2048
-%PRUNSRV% //IS/Shibd_idp --Startup auto %USERPASSDIRECTIVE% "--LogPath=%IDP_HOME_WINDOWS%\logs" "--Classpath=%JETTY_BASE%\start.jar"
-%PRUNSRV% //ES/Shibd_idp %JVMOPTIONS%
-%PRUNSRV% //ES/Shibd_idp --StartMode=jvm --StartClass=org.eclipse.jetty.start.Main ++StartParams=STOP_PORT=8963 ++StartParams=STOP.KEY=%PORTPASS% "++StartParams=jetty.base=%JETTY_BASE" "++StartParams=jetty.logging.dir=%IDP_HOME_WINDOWS%\logs"
-%PRUNSRV% //ES/Shibd_idp --StopMode=jvm --StopClass=org.eclipse.jetty.start.Main ++StopParams---stop ++StopParams=STOP_PORT=8963 ++StopParams=STOP.KEY=%PORTPASS% "++StopParams=jetty.base=%JETTY_BASE" "++StopParams=jetty.logging.dir=%IDP_HOME_WINDOWS%\logs"
+REM
+REM Use PR_xxx for parameters to keep things legible but also to allow spaces
+SET PR_DISPLAYNAME=Shibboleth IdP Daemon
+SET PR_DESCRIPTION=Runs the Jetty Container
+SET PR_CLASSPATH=%JETTY_BASE%\start.jar
+SET PR_JVMOPTIONS=-DIdpHome=%IDP_HOME_UNIX%;-Djdk.tls.ephemeralDHKeySize=2048;-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog;-Djava.io.tmpdir=%JETTY_BASE%\tmp;-XX:+UseG1GC
+SET PR_JVMMX=2048
+SET PR_JVM=auto
+
+SET PR_LOGPATH=%IDP_HOME_WINDOWS%\logs
+SET PR_STDOUTPUT=auto
+SET PR_STDERROR=auto
+
+SET PR_STARTMODE=JVM
+SET PR_STARTCLASS=org.eclipse.jetty.start.Main
+SET PR_STARTPARAMS=STOP_PORT=8963;STOP.KEY=%PORTPASS%;jetty.base=%JETTY_BASE%;jetty.logging.dir=%IDP_HOME_WINDOWS%\logs
+
+SET PR_STOPMODE=JVM
+SET PR_STOPCLASS=org.eclipse.jetty.start.Main
+SET PR_STOPPARAMS=--stop;STOP_PORT=8963;STOP.KEY=%PORTPASS%;jetty.base=%JETTY_BASE%;jetty.logging.dir=%IDP_HOME_WINDOWS%\logs
+
+%PRUNSRV% //IS/Shibd_idp --Startup=auto
+exit /r
REM
REM With that done poke holes in the firewall using "netsh advfirewall"
REM
diff --git a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.bat b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.bat
index 1b3089c..7ea74dc 100644
--- a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.bat
+++ b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.bat
@@ -47,5 +47,3 @@ set JVM_ARGS=-Didp.home="%IDP_HOME_UNIX%" -Djdk.tls.ephemeralDHKeySize=2048 -Dor
SET JETTY_ARGS=jetty.base="%JETTY_BASE%" jetty.logging.dir="%IDP_HOME_WINDOWS%\logs"
%JAVACMD% -jar "%JETTY_HOME%/start.jar" %JVM_ARGS% %JETTY_ARGS%
-
-:dome
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list