Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 15/01/2025, à 17:04

Hada de la Luna

22.04 LTS : installation Jenkins et problème de version Java utilisée

Bonjour à tous

Voici un résumé de la situation et les éléments nécessaires pour appréhender le problème Jenkins :

Situation actuelle

  • Jenkins est installé mais ne démarre pas correctement

  • Le service tente d'utiliser Java 11 au lieu de Java 17 qui est requis

  • Java 17 est installé sur le système mais n'est pas utilisé par Jenkins

  • Le service Jenkins échoue au démarrage avec une erreur de version Java incompatible

  • Comme je ne sais pas si les autres logiciels qui utilisent Java 11 supporteraient 17, l'installation de 17 est «à coté» de 11

Pour vérifier l'état du service Jenkins :

:~$ sudo systemctl status jenkins
[sudo] Mot de passe de hada : 
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor prese>
     Active: active (running) since Wed 2025-01-15 12:45:33 CET; 4h 7min ago
   Main PID: 105337 (java)
      Tasks: 54 (limit: 38092)
     Memory: 686.2M
        CPU: 29.401s
     CGroup: /system.slice/jenkins.service
             └─105337 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/ja>

janv. 15 12:45:30 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: Thi>
janv. 15 12:45:30 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: ***>
janv. 15 12:45:30 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: ***>
janv. 15 12:45:30 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: ***>
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: 202>
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: 202>
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Started >
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: 202>
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: 202>
janv. 15 13:28:26 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.>
lines 1-20/20 (END)...skipping...
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2025-01-15 12:45:33 CET; 4h 7min ago
   Main PID: 105337 (java)
      Tasks: 54 (limit: 38092)
     Memory: 686.2M
        CPU: 29.401s
     CGroup: /system.slice/jenkins.service
             └─105337 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080

janv. 15 12:45:30 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
janv. 15 12:45:30 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: *************************************************************
janv. 15 12:45:30 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: *************************************************************
janv. 15 12:45:30 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: *************************************************************
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: 2025-01-15 11:45:33.251+0000 [id=54]        INFO        jenkins.InitReactorRunner$1#onAttained: Completed initialization
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: 2025-01-15 11:45:33.261+0000 [id=25]        INFO        hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Started Jenkins Continuous Integration Server.
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: 2025-01-15 11:45:33.917+0000 [id=70]        INFO        h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tas>
janv. 15 12:45:33 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[105337]: 2025-01-15 11:45:33.917+0000 [id=70]        INFO        hudson.util.Retrier#start: Performed the action check updates server successfully at>
janv. 15 13:28:26 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Current command vanished from the unit file, execution of the command list won't be resumed.

Pour consulter les logs Jenkins :

:~$ sudo journalctl -u jenkins.service
[sudo] Mot de passe de hada : 
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1642]: Runni>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1642]: Suppo>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1642]: See h>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Failed t>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Stopped >
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2252]: Runni>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2252]: Suppo>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2252]: See h>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.>
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Failed t>
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.>
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Stopped >
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting>
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2470]: Runni>
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2470]: Suppo>
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2470]: See h>
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.>
lines 1-23...skipping...
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting Jenkins Continuous Integration Server...
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1642]: Running with Java 11 from /usr/lib/jvm/java-11-openjdk-amd64, which is older than the minimum required version (Java 17).
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1642]: Supported Java versions are: [17, 21]
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1642]: See https://jenkins.io/redirect/java-support/ for more information.
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Failed with result 'exit-code'.
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Failed to start Jenkins Continuous Integration Server.
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 1.
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Stopped Jenkins Continuous Integration Server.
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting Jenkins Continuous Integration Server...
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2252]: Running with Java 11 from /usr/lib/jvm/java-11-openjdk-amd64, which is older than the minimum required version (Java 17).
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2252]: Supported Java versions are: [17, 21]
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2252]: See https://jenkins.io/redirect/java-support/ for more information.
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Failed with result 'exit-code'.
janv. 13 08:15:22 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Failed to start Jenkins Continuous Integration Server.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 2.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Stopped Jenkins Continuous Integration Server.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting Jenkins Continuous Integration Server...
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2470]: Running with Java 11 from /usr/lib/jvm/java-11-openjdk-amd64, which is older than the minimum required version (Java 17).
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2470]: Supported Java versions are: [17, 21]
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2470]: See https://jenkins.io/redirect/java-support/ for more information.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Failed with result 'exit-code'.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Failed to start Jenkins Continuous Integration Server.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 3.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Stopped Jenkins Continuous Integration Server.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting Jenkins Continuous Integration Server...
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2653]: Running with Java 11 from /usr/lib/jvm/java-11-openjdk-amd64, which is older than the minimum required version (Java 17).
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2653]: Supported Java versions are: [17, 21]
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[2653]: See https://jenkins.io/redirect/java-support/ for more information.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Failed with result 'exit-code'.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Failed to start Jenkins Continuous Integration Server.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 4.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Stopped Jenkins Continuous Integration Server.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting Jenkins Continuous Integration Server...
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[3108]: Running with Java 11 from /usr/lib/jvm/java-11-openjdk-amd64, which is older than the minimum required version (Java 17).
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[3108]: Supported Java versions are: [17, 21]
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[3108]: See https://jenkins.io/redirect/java-support/ for more information.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Failed with result 'exit-code'.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Failed to start Jenkins Continuous Integration Server.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 5.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Stopped Jenkins Continuous Integration Server.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Start request repeated too quickly.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Failed with result 'exit-code'.
janv. 13 08:15:23 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Failed to start Jenkins Continuous Integration Server.
-- Boot 18f5e7e8802d43f19b69ed17baf5c51d --
janv. 13 17:25:15 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Starting Jenkins Continuous Integration Server...
janv. 13 17:25:16 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1641]: Running with Java 11 from /usr/lib/jvm/java-11-openjdk-amd64, which is older than the minimum required version (Java 17).
janv. 13 17:25:16 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1641]: Supported Java versions are: [17, 21]
janv. 13 17:25:16 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF jenkins[1641]: See https://jenkins.io/redirect/java-support/ for more information.
janv. 13 17:25:16 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
janv. 13 17:25:16 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: jenkins.service: Failed with result 'exit-code'.
lines 1-55

Pour vérifier la configuration du service Jenkins :

:~$ sudo systemctl cat jenkins
[sudo] Mot de passe de hada : 
# /lib/systemd/system/jenkins.service
#
# This file is managed by systemd(1). Do NOT edit this file manually!
# To override these settings, run:
#
#     systemctl edit jenkins
#
# For more information about drop-in files, see:
#
#     https://www.freedesktop.org/software/systemd/man/systemd.unit.html
#

[Unit]
Description=Jenkins Continuous Integration Server
Requires=network.target
After=network.target
StartLimitBurst=5
StartLimitIntervalSec=5m

[Service]
Type=notify
NotifyAccess=main
ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Djava.awt.headless=true >
lines 1-23...skipping...
# /lib/systemd/system/jenkins.service
#
# This file is managed by systemd(1). Do NOT edit this file manually!
# To override these settings, run:
#
#     systemctl edit jenkins
#
# For more information about drop-in files, see:
#
#     https://www.freedesktop.org/software/systemd/man/systemd.unit.html
#

[Unit]
Description=Jenkins Continuous Integration Server
Requires=network.target
After=network.target
StartLimitBurst=5
StartLimitIntervalSec=5m

[Service]
Type=notify
NotifyAccess=main
ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war $JENKINS_ARGS
Restart=on-failure
SuccessExitStatus=143

# Configures the time to wait for start-up. If Jenkins does not signal start-up
# completion within the configured time, the service will be considered failed
# and will be shut down again. Takes a unit-less value in seconds, or a time span
# value such as "5min 20s". Pass "infinity" to disable the timeout logic.
#TimeoutStartSec=90

# Unix account that runs the Jenkins daemon
# Be careful when you change this, as you need to update the permissions of
# $JENKINS_HOME, $JENKINS_LOG, and (if you have already run Jenkins)
# $JENKINS_WEBROOT.
User=jenkins
Group=jenkins

# Directory where Jenkins stores its configuration and workspaces
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
WorkingDirectory=/var/lib/jenkins

# Location of the Jenkins WAR
#Environment="JENKINS_WAR=/usr/share/java/jenkins.war"

# Location of the exploded WAR
Environment="JENKINS_WEBROOT=%C/jenkins/war"

# Location of the Jenkins log. By default, systemd-journald(8) is used.
#Environment="JENKINS_LOG=%L/jenkins/jenkins.log"

# The Java home directory. When left empty, JENKINS_JAVA_CMD and PATH are consulted.
#Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"

lines 1-55

Pour vérifier l'installation de Java 17 :

$ ls -l /usr/lib/jvm/java-17-openjdk-amd64
total 32
drwxr-xr-x  2 root root 4096 janv. 15 12:31 bin
drwxr-xr-x  4 root root 4096 janv. 15 12:31 conf
lrwxrwxrwx  1 root root   42 oct.  22 08:09 docs -> ../../../share/doc/openjdk-17-jre-headless
drwxr-xr-x  3 root root 4096 janv. 15 12:31 include
drwxr-xr-x  2 root root 4096 janv. 15 12:31 jmods
drwxr-xr-x 72 root root 4096 janv. 15 12:31 legal
drwxr-xr-x  5 root root 4096 janv. 15 12:31 lib
drwxr-xr-x  3 root root 4096 janv. 15 12:31 man
-rw-r--r--  1 root root 1235 oct.  22 08:09 release

Pour tenter un démarrage manuel de Jenkins avec Java 17 :

:~$ sudo -u jenkins /usr/lib/jvm/java-17-openjdk-amd64/bin/java -jar /usr/share/java/jenkins.war
[sudo] Mot de passe de hada : 
Running from: /usr/share/java/jenkins.war
webroot: /var/lib/jenkins/.jenkins/war
2025-01-15 15:58:06.866+0000 [id=1]	INFO	winstone.Logger#logInternal: Beginning extraction from war file
2025-01-15 15:58:06.911+0000 [id=1]	WARNING	o.e.j.ee9.nested.ContextHandler#setContextPath: Empty contextPath
2025-01-15 15:58:06.955+0000 [id=1]	INFO	org.eclipse.jetty.server.Server#doStart: jetty-12.0.16; built: 2024-12-09T21:02:54.535Z; git: c3f88bafb4e393f23204dc14dc57b042e84debc7; jvm 17.0.13+11-Ubuntu-2ubuntu122.04
2025-01-15 15:58:06.963+0000 [id=1]	INFO	org.eclipse.jetty.server.Server#doStop: Stopped oejs.Server@29176cc1{STOPPING}[12.0.16,sto=0]
2025-01-15 15:58:06.963+0000 [id=1]	INFO	winstone.Logger#logInternal: Jetty shutdown successfully
java.io.IOException: Failed to start Jetty
	at Jenkins Main ClassLoader//winstone.Launcher.<init>(Launcher.java:194)
	at Jenkins Main ClassLoader//winstone.Launcher.main(Launcher.java:490)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at executable.Main.main(Main.java:335)
Caused by: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:313)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.Server.lambda$doStart$0(Server.java:569)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.Server.doStart(Server.java:565)
	at Jenkins Main ClassLoader//org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
	at Jenkins Main ClassLoader//winstone.Launcher.<init>(Launcher.java:190)
	... 6 more
Caused by: java.net.BindException: Adresse déjà utilisée
	at java.base/sun.nio.ch.Net.bind0(Native Method)
	at java.base/sun.nio.ch.Net.bind(Net.java:555)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
	... 21 more
2025-01-15 15:58:06.964+0000 [id=1]	SEVERE	winstone.Logger#logInternal: Container startup failed
java.net.BindException: Adresse déjà utilisée
	at java.base/sun.nio.ch.Net.bind0(Native Method)
	at java.base/sun.nio.ch.Net.bind(Net.java:555)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
Caused: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:313)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.Server.lambda$doStart$0(Server.java:569)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.Server.doStart(Server.java:565)
	at Jenkins Main ClassLoader//org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
	at Jenkins Main ClassLoader//winstone.Launcher.<init>(Launcher.java:190)
Caused: java.io.IOException: Failed to start Jetty
	at Jenkins Main ClassLoader//winstone.Launcher.<init>(Launcher.java:194)
	at Jenkins Main ClassLoader//winstone.Launcher.main(Launcher.java:490)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at executable.Main.main(Main.java:335)

Help !
Comment faire que Jenkins utilise Java 17 ?


Hada de la Luna :o)

Hors ligne

#2 Le 15/01/2025, à 17:46

soshy

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

Première chose, c'est bien java 17 qui est utilisé pour lancer ton service

ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Djava.awt.headless=true

Donc c'est pas ça l'erreur.

L'erreur c'est

java.io.IOException: Failed to start Jetty
[...]
Caused by: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080

Autrement dit, tu as déjà (probablement déjà) quelque chose qui écoute sur le port 8080 et jetty qui veut lui aussi utiliser ce même port ne peut donc pas.

Tu dois pouvoir trouver ce qui utilise le port avec par exemple

sudo ss -tulp | grep :8080

Dernière modification par soshy (Le 15/01/2025, à 17:47)

Hors ligne

#3 Le 15/01/2025, à 21:47

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

$ sudo ss -tulp | grep :8080
[sudo] Mot de passe de hada : 
:~$

ce qui est passablement étrange

j'ai aussi pensé aux conteneurs

docker ps -a
CONTAINER ID   IMAGE                                          COMMAND                  CREATED       STATUS                     PORTS                                                                                                               NAMES
75091ae1946f   debian_ssh:latest                              "/usr/sbin/sshd -D"      2 days ago    Exited (0) 29 hours ago                                                                                                                        node-3
a9d5459fc63f   debian_ssh:latest                              "/usr/sbin/sshd -D"      2 days ago    Exited (0) 29 hours ago                                                                                                                        node-2
c63572b548eb   debian_ssh:latest                              "/usr/sbin/sshd -D"      2 days ago    Exited (0) 29 hours ago                                                                                                                        node-1
6906b10e722a   debian_ssh:latest                              "/usr/sbin/sshd -D"      2 days ago    Exited (0) 29 hours ago                                                                                                                        node-1-old
2d5e9651d8ae   nextcloud:latest                               "/entrypoint.sh apac…"   9 days ago    Up 5 hours                 0.0.0.0:8282->80/tcp, [::]:8282->80/tcp                                                                             next_app_1
b3c764f3c54c   registry.dagger.io/engine:v0.15.1              "dagger-entrypoint.s…"   12 days ago   Up 5 hours                                                                                                                                     dagger-engine-v0.15.1
0989abdbec55   gitlab/gitlab-ce:latest                        "/assets/wrapper"        4 weeks ago   Up 5 hours (healthy)       0.0.0.0:22->22/tcp, :::22->22/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:8181->80/tcp, [::]:8181->80/tcp   gitlabmaison
8e0f883aa0e2   diouxx/glpi                                    "/opt/glpi-start.sh"     5 weeks ago   Exited (137) 5 weeks ago                                                                                                                       glpi
3c7f363e4741   mariadb:10.7                                   "docker-entrypoint.s…"   5 weeks ago   Exited (0) 5 weeks ago                                                                                                                         mariadb
6e670eae2d1f   portainer/portainer                            "/portainer"             5 weeks ago   Up 5 hours                 8000/tcp, 9443/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp                                                       trusting_moore
f15c73d7e6b7   ghcr.io/home-assistant/home-assistant:stable   "/init"                  5 weeks ago   Up 5 hours                                                                                                                                     homeassistant
101a58c946af   mariadb                                        "docker-entrypoint.s…"   5 weeks ago   Up 5 hours                 3306/tcp                                                                                                            next_db_1
d45081c074ae   hello-world                                    "/hello"                 5 weeks ago   Exited (0) 5 weeks ago                                                                                                                         fervent_boyd

mais je n'en vois aucun sur 8080 (sauf erreur)

En cherchant dans ma mémoire puis dans mes marques page, je pense que mon conteneur nextcloud était sur le port 8080 (marque-page nextcloud à «http://localhost:8080/») et je l'ai changé car en conflit avec autre chose que j'ai installé (à cet instant ne me rappelle pas quoi)

Bref, peut être changer le port chez Jenkins ? Si oui, comment et pour quel port ?

Dernière modification par Hada de la Luna (Le 15/01/2025, à 23:42)


Hada de la Luna :o)

Hors ligne

#4 Le 16/01/2025, à 10:12

soshy

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

Surpreneant. Je reste persuadé que le port n'est pas libre...
Que donne

sudo ss -tulpn 

?

Je pense que tu dois avoir un truc avec 8080 dans le fichier /lib/systemd/system/jenkins.service à vérifier, montre le contenu.
Mais je pense qu'il suffirait d'y remplacer 8080 par un autre port libre sur ta machine.
Puis

sudo systemctl daemon-reload
sudo systemctl start jenkins.service

Dernière modification par soshy (Le 16/01/2025, à 11:13)

Hors ligne

#5 Le 16/01/2025, à 10:20

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

:~$ sudo ss -tulpn 
[sudo] Mot de passe de hada : 
Netid         State          Recv-Q         Send-Q                                             Local Address:Port                    Peer Address:Port         Process                                             
udp           UNCONN         0              0                                                        0.0.0.0:46300                        0.0.0.0:*             users:(("python3",pid=5369,fd=59))                 
udp           UNCONN         0              0                                                        0.0.0.0:47472                        0.0.0.0:*             users:(("python3",pid=5369,fd=73))                 
udp           UNCONN         0              0                                                   10.152.199.1:53                           0.0.0.0:*             users:(("dnsmasq",pid=5622,fd=8))                  
udp           UNCONN         0              0                                                     10.163.8.1:53                           0.0.0.0:*             users:(("dnsmasq",pid=4839,fd=8))                  
udp           UNCONN         0              0                                                  127.0.0.53%lo:53                           0.0.0.0:*             users:(("systemd-resolve",pid=1752,fd=13))         
udp           UNCONN         0              0                                                 0.0.0.0%lxdbr0:67                           0.0.0.0:*             users:(("dnsmasq",pid=5622,fd=4))                  
udp           UNCONN         0              0                                               0.0.0.0%incusbr0:67                           0.0.0.0:*             users:(("dnsmasq",pid=4839,fd=4))                  
udp           UNCONN         0              0                                                        0.0.0.0:32946                        0.0.0.0:*             users:(("Discord",pid=195866,fd=126))              
udp           UNCONN         0              0                                                        0.0.0.0:32961                        0.0.0.0:*             users:(("python3",pid=5369,fd=69))                 
udp           UNCONN         0              0                                                        0.0.0.0:33180                        0.0.0.0:*             users:(("python3",pid=5369,fd=72))                 
udp           UNCONN         0              0                                                        0.0.0.0:33278                        0.0.0.0:*             users:(("avahi-daemon",pid=1928,fd=14))            
udp           UNCONN         0              0                                                        0.0.0.0:33538                        0.0.0.0:*             users:(("python3",pid=5369,fd=42))                 
udp           UNCONN         0              0                                                        0.0.0.0:17500                        0.0.0.0:*             users:(("dropbox",pid=11030,fd=67))                
udp           UNCONN         0              0                                                        0.0.0.0:51011                        0.0.0.0:*             users:(("python3",pid=5369,fd=51))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=64))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=63))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=58))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=60))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=57))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=33))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=31))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=29))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=28))                 
udp           UNCONN         0              0                                                        0.0.0.0:1900                         0.0.0.0:*             users:(("python3",pid=5369,fd=26))                 
udp           UNCONN         0              0                                                        0.0.0.0:51964                        0.0.0.0:*             users:(("Discord",pid=195866,fd=123))              
udp           UNCONN         0              0                                                        0.0.0.0:36112                        0.0.0.0:*             users:(("python3",pid=5369,fd=37))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12365,fd=206))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12365,fd=204))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12365,fd=188))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12365,fd=176))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12365,fd=136))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12365,fd=102))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12435,fd=145))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12435,fd=144))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12435,fd=143))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12435,fd=142))                 
udp           UNCONN         0              0                                                    224.0.0.251:5353                         0.0.0.0:*             users:(("brave",pid=12435,fd=139))                 
udp           UNCONN         0              0                                                   10.152.199.1:5353                         0.0.0.0:*             users:(("python3",pid=5369,fd=20))                 
udp           UNCONN         0              0                                                     10.163.8.1:5353                         0.0.0.0:*             users:(("python3",pid=5369,fd=19))                 
udp           UNCONN         0              0                                                     172.18.0.1:5353                         0.0.0.0:*             users:(("python3",pid=5369,fd=17))                 
udp           UNCONN         0              0                                                     172.19.0.1:5353                         0.0.0.0:*             users:(("python3",pid=5369,fd=16))                 
udp           UNCONN         0              0                                                     172.17.0.1:5353                         0.0.0.0:*             users:(("python3",pid=5369,fd=15))                 
udp           UNCONN         0              0                                                        0.0.0.0:5353                         0.0.0.0:*             users:(("avahi-daemon",pid=1928,fd=12))            
udp           UNCONN         0              0                                                        0.0.0.0:54764                        0.0.0.0:*             users:(("python3",pid=5369,fd=62))                 
udp           UNCONN         0              0                                                        0.0.0.0:56655                        0.0.0.0:*             users:(("python3",pid=5369,fd=56))                 
udp           UNCONN         0              0                                                        0.0.0.0:40332                        0.0.0.0:*             users:(("python3",pid=5369,fd=34))                 
udp           UNCONN         0              0                                                        0.0.0.0:58830                        0.0.0.0:*             users:(("python3",pid=5369,fd=40))                 
udp           UNCONN         0              0                                                        0.0.0.0:43335                        0.0.0.0:*             users:(("python3",pid=5369,fd=61))                 
udp           UNCONN         0              0                                                        0.0.0.0:59895                        0.0.0.0:*             users:(("python3",pid=5369,fd=80))                 
udp           UNCONN         0              0                                                        0.0.0.0:60086                        0.0.0.0:*             users:(("python3",pid=5369,fd=70))                 
udp           UNCONN         0              0                                                        0.0.0.0:43937                        0.0.0.0:*             users:(("python3",pid=5369,fd=39))                 
udp           UNCONN         0              0                                                              *:47220                              *:*             users:(("python3",pid=5369,fd=85))                 
udp           UNCONN         0              0                                                              *:47933                              *:*             users:(("firefox",pid=19366,fd=178))               
udp           UNCONN         0              0                                         [fd42:28:24f7:888f::1]:53                              [::]:*             users:(("dnsmasq",pid=5622,fd=10))                 
udp           UNCONN         0              0                                       [fd42:ad31:61bf:83ad::1]:53                              [::]:*             users:(("dnsmasq",pid=4839,fd=10))                 
udp           UNCONN         0              0                                                  [::]%incusbr0:547                             [::]:*             users:(("dnsmasq",pid=4839,fd=6))                  
udp           UNCONN         0              0                                                    [::]%lxdbr0:547                             [::]:*             users:(("dnsmasq",pid=5622,fd=6))                  
udp           UNCONN         0              0                                                              *:33342                              *:*             users:(("python3",pid=5369,fd=41))                 
udp           UNCONN         0              0                                                              *:49883                              *:*             users:(("python3",pid=5369,fd=74))                 
udp           UNCONN         0              0                                                              *:33730                              *:*             users:(("python3",pid=5369,fd=79))                 
udp           UNCONN         0              0                                                              *:33912                              *:*             users:(("python3",pid=5369,fd=71))                 
udp           UNCONN         0              0                                                              *:1900                               *:*             users:(("python3",pid=5369,fd=25))                 
udp           UNCONN         0              0                                                              *:1900                               *:*             users:(("python3",pid=5369,fd=27))                 
udp           UNCONN         0              0                                                              *:1900                               *:*             users:(("python3",pid=5369,fd=18))                 
udp           UNCONN         0              0                                                              *:1900                               *:*             users:(("python3",pid=5369,fd=32))                 
udp           UNCONN         0              0                                                              *:1900                               *:*             users:(("python3",pid=5369,fd=76))                 
udp           UNCONN         0              0                                                              *:1900                               *:*             users:(("python3",pid=5369,fd=78))                 
udp           UNCONN         0              0                                                              *:1900                               *:*             users:(("python3",pid=5369,fd=75))                 
udp           UNCONN         0              0                                                              *:1900                               *:*             users:(("python3",pid=5369,fd=83))                 
udp           UNCONN         0              0                                                              *:34906                              *:*             users:(("python3",pid=5369,fd=30))                 
udp           UNCONN         0              0                                                              *:35234                              *:*             users:(("firefox",pid=19366,fd=187))               
udp           UNCONN         0              0                                                              *:51765                              *:*             users:(("firefox",pid=19366,fd=168))               
udp           UNCONN         0              0                                                              *:53215                              *:*             users:(("python3",pid=5369,fd=47))                 
udp           UNCONN         0              0                                                           [::]:5353                            [::]:*             users:(("avahi-daemon",pid=1928,fd=13))            
udp           UNCONN         0              0                                                              *:5353                               *:*             users:(("python3",pid=5369,fd=14))                 
udp           UNCONN         0              0                              [fe80::42:6aff:fee0:582e]%docker0:5353                            [::]:*             users:(("python3",pid=5369,fd=21))                 
udp           UNCONN         0              0                      [fe80::42:57ff:fe08:2f41]%br-98fc7e4e4b3e:5353                            [::]:*             users:(("python3",pid=5369,fd=22))                 
udp           UNCONN         0              0                                       [fd42:ad31:61bf:83ad::1]:5353                            [::]:*             users:(("python3",pid=5369,fd=23))                 
udp           UNCONN         0              0                                         [fd42:28:24f7:888f::1]:5353                            [::]:*             users:(("python3",pid=5369,fd=24))                 
udp           UNCONN         0              0                                                              *:55365                              *:*             users:(("python3",pid=5369,fd=86))                 
udp           UNCONN         0              0                                                           [::]:55740                           [::]:*             users:(("avahi-daemon",pid=1928,fd=15))            
udp           UNCONN         0              0                                                              *:56219                              *:*             users:(("firefox",pid=19366,fd=170))               
udp           UNCONN         0              0                                                              *:39951                              *:*             users:(("python3",pid=5369,fd=77))                 
udp           UNCONN         0              0                                                              *:56484                              *:*             users:(("python3",pid=5369,fd=81))                 
udp           UNCONN         0              0                                                              *:40450                              *:*             users:(("firefox",pid=19366,fd=191))               
udp           UNCONN         0              0                                                              *:41641                              *:*             users:(("python3",pid=5369,fd=35))                 
udp           UNCONN         0              0                                                              *:59534                              *:*             users:(("firefox",pid=19366,fd=164))               
udp           UNCONN         0              0                                                              *:60404                              *:*             users:(("firefox",pid=19366,fd=179))               
udp           UNCONN         0              0                                                              *:45576                              *:*             users:(("python3",pid=5369,fd=36))                 
tcp           LISTEN         0              4096                                                   127.0.0.1:9050                         0.0.0.0:*             users:(("tor",pid=2125,fd=6))                      
tcp           LISTEN         0              128                                                   172.18.0.1:40000                        0.0.0.0:*             users:(("python3",pid=5369,fd=53))                 
tcp           LISTEN         0              128                                                   172.19.0.1:40000                        0.0.0.0:*             users:(("python3",pid=5369,fd=55))                 
tcp           LISTEN         0              4096                                                   127.0.0.1:11984                        0.0.0.0:*             users:(("go2rtc",pid=9295,fd=7))                   
tcp           LISTEN         0              4096                                                     0.0.0.0:8282                         0.0.0.0:*             users:(("docker-proxy",pid=4864,fd=4))             
tcp           LISTEN         0              4096                                               127.0.0.53%lo:53                           0.0.0.0:*             users:(("systemd-resolve",pid=1752,fd=14))         
tcp           LISTEN         0              4096                                                     0.0.0.0:9000                         0.0.0.0:*             users:(("docker-proxy",pid=4845,fd=4))             
tcp           LISTEN         0              128                                                    127.0.0.1:631                          0.0.0.0:*             users:(("cupsd",pid=49576,fd=8))                   
tcp           LISTEN         0              32                                                    10.163.8.1:53                           0.0.0.0:*             users:(("dnsmasq",pid=4839,fd=9))                  
tcp           LISTEN         0              128                                                 10.152.199.1:40000                        0.0.0.0:*             users:(("python3",pid=5369,fd=52))                 
tcp           LISTEN         0              128                                                    127.0.0.1:17603                        0.0.0.0:*             users:(("dropbox",pid=11030,fd=94))                
tcp           LISTEN         0              128                                                    127.0.0.1:17600                        0.0.0.0:*             users:(("dropbox",pid=11030,fd=90))                
tcp           LISTEN         0              4096                                                   127.0.0.1:18554                        0.0.0.0:*             users:(("go2rtc",pid=9295,fd=5))                   
tcp           LISTEN         0              4096                                                     0.0.0.0:8001                         0.0.0.0:*             users:(("hplip-printer-a",pid=3598,fd=4))          
tcp           LISTEN         0              4096                                                     0.0.0.0:8000                         0.0.0.0:*             users:(("ps-printer-app",pid=2053,fd=4))           
tcp           LISTEN         0              4096                                                     0.0.0.0:8181                         0.0.0.0:*             users:(("docker-proxy",pid=4933,fd=4))             
tcp           LISTEN         0              128                                                      0.0.0.0:8123                         0.0.0.0:*             users:(("python3",pid=5369,fd=9))                  
tcp           LISTEN         0              4096                                                     0.0.0.0:22                           0.0.0.0:*             users:(("docker-proxy",pid=4919,fd=4))             
tcp           LISTEN         0              128                                                      0.0.0.0:17500                        0.0.0.0:*             users:(("dropbox",pid=11030,fd=66))                
tcp           LISTEN         0              128                                                   172.17.0.1:40000                        0.0.0.0:*             users:(("python3",pid=5369,fd=49))                 
tcp           LISTEN         0              511                                                    127.0.0.1:6463                         0.0.0.0:*             users:(("Discord",pid=195866,fd=128))              
tcp           LISTEN         0              32                                                  10.152.199.1:53                           0.0.0.0:*             users:(("dnsmasq",pid=5622,fd=9))                  
tcp           LISTEN         0              128                                                   10.163.8.1:40000                        0.0.0.0:*             users:(("python3",pid=5369,fd=54))                 
tcp           LISTEN         0              128                                                        [::1]:631                             [::]:*             users:(("cupsd",pid=49576,fd=7))                   
tcp           LISTEN         0              128                          [fe80::216:3eff:fe85:ab78]%incusbr0:40000                           [::]:*             users:(("python3",pid=5369,fd=68))                 
tcp           LISTEN         0              4096                                                        [::]:8282                            [::]:*             users:(("docker-proxy",pid=4873,fd=4))             
tcp           LISTEN         0              4096                                                           *:8444                               *:*             users:(("lxd",pid=4142,fd=23))                     
tcp           LISTEN         0              4096                                                           *:8443                               *:*             users:(("incusd",pid=4273,fd=23))                  
tcp           LISTEN         0              4096                                                        [::]:9000                            [::]:*             users:(("docker-proxy",pid=4857,fd=4))             
tcp           LISTEN         0              128                            [fe80::42:6aff:fee0:582e]%docker0:40000                           [::]:*             users:(("python3",pid=5369,fd=48))                 
tcp           LISTEN         0              32                                      [fd42:ad31:61bf:83ad::1]:53                              [::]:*             users:(("dnsmasq",pid=4839,fd=11))                 
tcp           LISTEN         0              128                                       [fd42:28:24f7:888f::1]:40000                           [::]:*             users:(("python3",pid=5369,fd=67))                 
tcp           LISTEN         0              4096                                                        [::]:8001                            [::]:*             users:(("hplip-printer-a",pid=3598,fd=5))          
tcp           LISTEN         0              4096                                                        [::]:8000                            [::]:*             users:(("ps-printer-app",pid=2053,fd=5))           
tcp           LISTEN         0              4096                                                        [::]:8181                            [::]:*             users:(("docker-proxy",pid=4940,fd=4))             
tcp           LISTEN         0              50                                                             *:8080                               *:*             users:(("java",pid=2045,fd=8))                     
tcp           LISTEN         0              128                                                         [::]:8123                            [::]:*             users:(("python3",pid=5369,fd=10))                 
tcp           LISTEN         0              4096                                                        [::]:22                              [::]:*             users:(("docker-proxy",pid=4927,fd=4))             
tcp           LISTEN         0              4096                                                        [::]:443                             [::]:*             users:(("docker-proxy",pid=4984,fd=4))             
tcp           LISTEN         0              128                    [fe80::42:57ff:fe08:2f41]%br-98fc7e4e4b3e:40000                           [::]:*             users:(("python3",pid=5369,fd=66))                 
tcp           LISTEN         0              128                                                         [::]:17500                           [::]:*             users:(("dropbox",pid=11030,fd=63))                
tcp           LISTEN         0              4096                                                           *:18555                              *:*             users:(("go2rtc",pid=9295,fd=6))                   
tcp           LISTEN         0              128                                     [fd42:ad31:61bf:83ad::1]:40000                           [::]:*             users:(("python3",pid=5369,fd=50))                 
tcp           LISTEN         0              32                                        [fd42:28:24f7:888f::1]:53                              [::]:*             users:(("dnsmasq",pid=5622,fd=11))                 
tcp           LISTEN         0              128                            [fe80::216:3eff:fe86:d8e5]%lxdbr0:40000                           [::]:*             users:(("python3",pid=5369,fd=65)) 

lib/systemd/system/jenkins.service:

#
# This file is managed by systemd(1). Do NOT edit this file manually!
# To override these settings, run:
#
#     systemctl edit jenkins
#
# For more information about drop-in files, see:
#
#     https://www.freedesktop.org/software/systemd/man/systemd.unit.html
#

[Unit]
Description=Jenkins Continuous Integration Server
Requires=network.target
After=network.target
StartLimitBurst=5
StartLimitIntervalSec=5m

[Service]
Type=notify
NotifyAccess=main
ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war $JENKINS_ARGS
Restart=on-failure
SuccessExitStatus=143

# Configures the time to wait for start-up. If Jenkins does not signal start-up
# completion within the configured time, the service will be considered failed
# and will be shut down again. Takes a unit-less value in seconds, or a time span
# value such as "5min 20s". Pass "infinity" to disable the timeout logic.
#TimeoutStartSec=90

# Unix account that runs the Jenkins daemon
# Be careful when you change this, as you need to update the permissions of
# $JENKINS_HOME, $JENKINS_LOG, and (if you have already run Jenkins)
# $JENKINS_WEBROOT.
User=jenkins
Group=jenkins

# Directory where Jenkins stores its configuration and workspaces
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
WorkingDirectory=/var/lib/jenkins

# Location of the Jenkins WAR
#Environment="JENKINS_WAR=/usr/share/java/jenkins.war"

# Location of the exploded WAR
Environment="JENKINS_WEBROOT=%C/jenkins/war"

# Location of the Jenkins log. By default, systemd-journald(8) is used.
#Environment="JENKINS_LOG=%L/jenkins/jenkins.log"

# The Java home directory. When left empty, JENKINS_JAVA_CMD and PATH are consulted.
#Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"

# The Java executable. When left empty, JAVA_HOME and PATH are consulted.
#Environment="JENKINS_JAVA_CMD=/etc/alternatives/java"

# Arguments for the Jenkins JVM
Environment="JAVA_OPTS=-Djava.awt.headless=true"

# Unix Domain Socket to listen on for local HTTP requests. Default is disabled.
#Environment="JENKINS_UNIX_DOMAIN_PATH=/run/jenkins/jenkins.socket"

# IP address to listen on for HTTP requests.
# The default is to listen on all interfaces (0.0.0.0).
#Environment="JENKINS_LISTEN_ADDRESS="

# Port to listen on for HTTP requests. Set to -1 to disable.
# To be able to listen on privileged ports (port numbers less than 1024),
# add the CAP_NET_BIND_SERVICE capability to the AmbientCapabilities
# directive below.
Environment="JENKINS_PORT=8080"

# IP address to listen on for HTTPS requests. Default is disabled.
#Environment="JENKINS_HTTPS_LISTEN_ADDRESS="

# Port to listen on for HTTPS requests. Default is disabled.
# To be able to listen on privileged ports (port numbers less than 1024),
# add the CAP_NET_BIND_SERVICE capability to the AmbientCapabilities
# directive below.
#Environment="JENKINS_HTTPS_PORT=443"

# Path to the keystore in JKS format (as created by the JDK's keytool).
# Default is disabled.
#Environment="JENKINS_HTTPS_KEYSTORE=/path/to/keystore.jks"

# Password to access the keystore defined in JENKINS_HTTPS_KEYSTORE.
# Default is disabled.
#Environment="JENKINS_HTTPS_KEYSTORE_PASSWORD=s3cR3tPa55w0rD"

# IP address to listen on for HTTP2 requests. Default is disabled.
#Environment="JENKINS_HTTP2_LISTEN_ADDRESS="

# HTTP2 port to listen on. Default is disabled.
# To be able to listen on privileged ports (port numbers less than 1024),
# add the CAP_NET_BIND_SERVICE capability to the AmbientCapabilities
# directive below.
#Environment="JENKINS_HTTP2_PORT="

# Controls which capabilities to include in the ambient capability set for the
# executed process. Takes a whitespace-separated list of capability names, e.g.
# CAP_SYS_ADMIN, CAP_DAC_OVERRIDE, CAP_SYS_PTRACE. Ambient capability sets are
# useful if you want to execute a process as a non-privileged user but still
# want to give it some capabilities. For example, add the CAP_NET_BIND_SERVICE
# capability to be able to listen on privileged ports (port numbers less than
# 1024).
#AmbientCapabilities=CAP_NET_BIND_SERVICE

# Debug level for logs. The higher the value, the more verbose. 5 is INFO.
#Environment="JENKINS_DEBUG_LEVEL=5"

# Set to true to enable logging to /var/log/jenkins/access_log.
#Environment="JENKINS_ENABLE_ACCESS_LOG=false"

# Servlet context (important if you want to use reverse proxying)
#Environment="JENKINS_PREFIX=/jenkins"

# Arbitrary additional arguments to pass to Jenkins.
# Full option list: java -jar jenkins.war --help
#Environment="JENKINS_OPTS="

# Maximum core file size. If unset, the value from the OS is inherited.
#LimitCORE=infinity

# Maximum file size. If unset, the value from the OS is inherited.
#LimitFSIZE=infinity

# File descriptor limit. If unset, the value from the OS is inherited.
#LimitNOFILE=8192

# Maximum number of processes. If unset, the value from the OS is inherited.
#LimitNPROC=32768

# Set the umask to control the permission bits of files that Jenkins creates.
#
# 0027 makes files read-only for group and inaccessible for others, which some
# security sensitive users might consider beneficial, especially if Jenkins
# is running on a server that is used for multiple purposes. Beware that 0027
# permissions would interfere with sudo scripts that run on the controller
# (see JENKINS-25065).
#
# Note also that the particularly sensitive parts of $JENKINS_HOME (such as
# credentials) are always written without 'other' access. So the umask values
# only affect job configuration, build records, etc.
#
# If unset, the value from the OS is inherited, which is normally 0022.
# The default umask comes from pam_umask(8) and /etc/login.defs.
#UMask=0022

[Install]
WantedBy=multi-user.target

Dernière modification par Hada de la Luna (Le 16/01/2025, à 10:22)


Hada de la Luna :o)

Hors ligne

#6 Le 16/01/2025, à 10:27

soshy

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

tcp           LISTEN         0              50                                                             *:8080                               *:*             users:(("java",pid=2045,fd=8))                     

Tu as bien un process qui écoute sur le port 8080, et donc il n'est pas libre.

Dans le fichier, je pense que tu peux changer le port ici par un qui serait libre

Environment="JENKINS_PORT=8080"

Hors ligne

#7 Le 16/01/2025, à 10:55

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

j'ai édité le fichier en root

par contre:

$ sudo systemctl daemon reload
Unknown command verb daemon.

Hada de la Luna :o)

Hors ligne

#8 Le 16/01/2025, à 11:13

soshy

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

Erreur de ma part, il faut un tiret

sudo systemctl daemon-reload

Hors ligne

#9 Le 16/01/2025, à 11:27

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

Merci, c'est fait et:

$ sudo systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor prese>
     Active: active (running) since Wed 2025-01-15 17:28:03 CET; 17h ago
   Main PID: 2045 (java)
      Tasks: 55 (limit: 38092)
     Memory: 304.8M
        CPU: 1min 4.424s
     CGroup: /system.slice/jenkins.service
             └─2045 /usr/lib/jvm/java-17-openjdk-amd64/bin/java -Djava.awt.head>

janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]:         >
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]:         >
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]:         >
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]:         >
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]:         >
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]:         >
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]:         >
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]: 2025-01->
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF java[2045]: 2025-01->
janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Started >
lines 1-20/20 (END)

Hada de la Luna :o)

Hors ligne

#10 Le 16/01/2025, à 12:01

soshy

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

A priori ça tourne

janv. 15 17:28:03 hada-ASUS-TUF-Gaming-F17-FX706HF-FX706HF systemd[1]: Started

Mais je trouve ça bizarre l'heure à laquelle c'est indiqué. Peut être que jenkins fonctionnait déjà sur le port 8080 et que tu essayais de le relancer une 2nd fois sur le même port, ce qui logiquement fait planter le tentatives successives...

Au pire fait un

sudo systemctl stop jenkins.service
sudo systemctl start jenkins.service

Puis tente d'acceder à localhost:8080 et/ou localhost:le_nouveau_port_que_tu_as_mis

Hors ligne

#11 Le 16/01/2025, à 12:14

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

c'est fait, sauf que

  • localhost:8080 =» Jenkins

  • localhost:45576 => rien du tout

dans /etc/default/jenkins je change aussi le port pour :

# Port for HTTP connector (default 45576; disable with -1)
HTTP_PORT=45576

toujours pas: on me dit d'éditer en root «/etc/systemd/system/jenkins.service.d/override.conf» qui n'existe pas (ni le répertoire jenkins.service.d d'ailleurs) et y ajouter:

[Service]
Environment="JENKINS_PORT=45576"

mais comme la source est très apocryphe, j'hésite à créer le répertoire et le fichier à la main… des idées?

Dernière modification par Hada de la Luna (Le 16/01/2025, à 13:11)


Hada de la Luna :o)

Hors ligne

#12 Le 16/01/2025, à 13:35

ylag

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

Bonjour,

Pour créer un fichier override pour le service jenkins :

sudo systemctl edit jenkins.service

... tu y colles les lignes requises, puis sauvegarde du fichier.
Ensuite, je ferais :

sudo systemctl daemon-reload
sudo systemctl restart jenkins.service

Je dis ça de mémoire, ne pouvant le tester présentement.

A+

Dernière modification par ylag (Le 16/01/2025, à 13:39)

Hors ligne

#13 Le 16/01/2025, à 14:18

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

fait avec:

[Service]
Environment="JENKINS_PORT=45576"
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
ExecStart=
ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war $JENKINS_ARGS

et ne change rien au niveau de «localhost:8080 => Jenkins» «localhost:45576 => rien du tout»

pour le cas où, j'ai aussi fait:

$ sudo ufw allow 45576
[sudo] Mot de passe de hada : 
Les règles ont été mises à jour
Les règles ont été mises à jour (IPv6)

ne change rien au niveau de «localhost:8080 => Jenkins» «localhost:45576 => rien du tout»

Dernière modification par Hada de la Luna (Le 16/01/2025, à 14:21)


Hada de la Luna :o)

Hors ligne

#14 Le 16/01/2025, à 14:23

ylag

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

Bonjour,

As-tu tenté avec seulement ces deux lignes dans le fichier override :

[Service]
Environment="JENKINS_PORT=45576"

Sinon, désolé pour la fausse piste ...

A+

Dernière modification par ylag (Le 16/01/2025, à 14:30)

Hors ligne

#15 Le 16/01/2025, à 14:25

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

oui, j'ai déjà fait ça et cela ne fonctionnait pas…

Dernière modification par Hada de la Luna (Le 16/01/2025, à 14:25)


Hada de la Luna :o)

Hors ligne

#16 Le 16/01/2025, à 14:42

iznobe

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

Bonjour ,
vu :

c'est fait, sauf que

    localhost:8080 =» Jenkins

ce que je ferais , pour verifier l' hypothese de @soshy dans une 1er temps ( voir les commandes deja données precedemment ) :
j 'arreterai jenkins .
je verifierai alors si le port 8080 est toujours en activité .
+ si oui , c' est qu ' il y a un autre service utilisant ce port
du coup je referais "localhost:8080 " pour voir ce que c ' est ,
+ si non je remettrai alors le port par defaut et tout ce qui a  été modifié depuis comme c' etait avant .
on ne se lance pas a mon avis , a modifier les services sans une bonne raison et d' etre sur que ce soit necessaire .

En fonction du resultat du test ci-dessus , il faudra aviser .


retour COMPLET et utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#17 Le 16/01/2025, à 15:53

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

pour 8080 c'est TCP qui occupe la place, je préfère ne pas le tripoter

j'avais choisi 45576 en le pensant inoccupé mais:

$ sudo netstat -tuln | grep 45576
[sudo] Mot de passe de hada : 
udp6       0      0 :::45576                :::*
$ sudo lsof -i :45576
[sudo] Mot de passe de hada : 
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
python3 5369 root   36u  IPv6  41469      0t0  UDP *:4557

comment cela se fait il ?

je rechange le port de Jenkins ? si oui, comment être sure de choisir un qui lui soit réservé ?

Dernière modification par Hada de la Luna (Le 16/01/2025, à 15:55)


Hada de la Luna :o)

Hors ligne

#18 Le 16/01/2025, à 16:14

soshy

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

Si tu peux configurer le port à plusieurs endroits :
- le fichier de config jenkins /etc/default/jenkins
- le fichier de config du service jenkins /lib/systemd/system/jenkins.service (qui passe par une variable d'environnement)
Il y en a forcément un qui est prioritaire sur l'autre. Et a parier, je dirais le fichier de confguration /etc/default/jenkins est prioritaire.

Donc ce que j'ai proposé, tout comme l'overide de @ylag ne servent surement à rien.
Quand tu modifies le fichier de configuration, il faut relancer jenkins pour que ce soit pris en compte.

sudo systemctl stop jenkins.service
sudo systemctl start jenkins.service

Question bête, si tu as jenkins accessible et qui fonctionne, pourquoi chercher plus loin ? Moi je remettrai tout par défaut et j'utiliserai le 8080 puisqu'à priori ça fonctionne.

Hors ligne

#19 Le 16/01/2025, à 16:18

iznobe

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

pour 8080 c'est TCP qui occupe la place, je préfère ne pas le tripoter

j'avais choisi 45576 en le pensant inoccupé mais:

$ sudo netstat -tuln | grep 45576
[sudo] Mot de passe de hada : 
udp6       0      0 :::45576                :::*

$ sudo lsof -i :45576
[sudo] Mot de passe de hada : 
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
python3 5369 root   36u  IPv6  41469      0t0  UDP *:4557

comment cela se fait il ?

le service jenkins etait bien stoppé avant de faire la lecture des ports ???

Dernière modification par iznobe (Le 16/01/2025, à 16:18)


retour COMPLET et utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#20 Le 16/01/2025, à 16:21

Hada de la Luna

Re : 22.04 LTS : installation Jenkins et problème de version Java utilisée

parce que avant la modification de port, il n'avait pas l'air de fonctionner

je vais un truc idiot, carrément redémarrer la machine et voir comment ça se comporte et si cela reste pareil, je remet 8080? c'est sans raison logique mais bon, c'est un peu pénible quand même de rester bloquée là

en redémarrant tout, cela reste «localhost:8080 => Jenkins et localhost:45576 => rien du tout»

je fais un retour à 8080 dans les 3 fichiers du coup.

lib/systemd/system/jenkins.service:

#
# This file is managed by systemd(1). Do NOT edit this file manually!
# To override these settings, run:
#
#     systemctl edit jenkins
#
# For more information about drop-in files, see:
#
#     https://www.freedesktop.org/software/systemd/man/systemd.unit.html
#

[Unit]
Description=Jenkins Continuous Integration Server
Requires=network.target
After=network.target
StartLimitBurst=5
StartLimitIntervalSec=5m

[Service]
Type=notify
NotifyAccess=main
ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war $JENKINS_ARGS
Restart=on-failure
SuccessExitStatus=143

# Configures the time to wait for start-up. If Jenkins does not signal start-up
# completion within the configured time, the service will be considered failed
# and will be shut down again. Takes a unit-less value in seconds, or a time span
# value such as "5min 20s". Pass "infinity" to disable the timeout logic.
#TimeoutStartSec=90

# Unix account that runs the Jenkins daemon
# Be careful when you change this, as you need to update the permissions of
# $JENKINS_HOME, $JENKINS_LOG, and (if you have already run Jenkins)
# $JENKINS_WEBROOT.
User=jenkins
Group=jenkins

# Directory where Jenkins stores its configuration and workspaces
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
WorkingDirectory=/var/lib/jenkins

# Location of the Jenkins WAR
#Environment="JENKINS_WAR=/usr/share/java/jenkins.war"

# Location of the exploded WAR
Environment="JENKINS_WEBROOT=%C/jenkins/war"

# Location of the Jenkins log. By default, systemd-journald(8) is used.
#Environment="JENKINS_LOG=%L/jenkins/jenkins.log"

# The Java home directory. When left empty, JENKINS_JAVA_CMD and PATH are consulted.
#Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"

# The Java executable. When left empty, JAVA_HOME and PATH are consulted.
#Environment="JENKINS_JAVA_CMD=/etc/alternatives/java"

# Arguments for the Jenkins JVM
Environment="JAVA_OPTS=-Djava.awt.headless=true"

# Unix Domain Socket to listen on for local HTTP requests. Default is disabled.
#Environment="JENKINS_UNIX_DOMAIN_PATH=/run/jenkins/jenkins.socket"

# IP address to listen on for HTTP requests.
# The default is to listen on all interfaces (0.0.0.0).
#Environment="JENKINS_LISTEN_ADDRESS="

# Port to listen on for HTTP requests. Set to -1 to disable.
# To be able to listen on privileged ports (port numbers less than 1024),
# add the CAP_NET_BIND_SERVICE capability to the AmbientCapabilities
# directive below.
Environment="JENKINS_PORT=8080"

# IP address to listen on for HTTPS requests. Default is disabled.
#Environment="JENKINS_HTTPS_LISTEN_ADDRESS="

# Port to listen on for HTTPS requests. Default is disabled.
# To be able to listen on privileged ports (port numbers less than 1024),
# add the CAP_NET_BIND_SERVICE capability to the AmbientCapabilities
# directive below.
#Environment="JENKINS_HTTPS_PORT=443"

# Path to the keystore in JKS format (as created by the JDK's keytool).
# Default is disabled.
#Environment="JENKINS_HTTPS_KEYSTORE=/path/to/keystore.jks"

# Password to access the keystore defined in JENKINS_HTTPS_KEYSTORE.
# Default is disabled.
#Environment="JENKINS_HTTPS_KEYSTORE_PASSWORD=s3cR3tPa55w0rD"

# IP address to listen on for HTTP2 requests. Default is disabled.
#Environment="JENKINS_HTTP2_LISTEN_ADDRESS="

# HTTP2 port to listen on. Default is disabled.
# To be able to listen on privileged ports (port numbers less than 1024),
# add the CAP_NET_BIND_SERVICE capability to the AmbientCapabilities
# directive below.
#Environment="JENKINS_HTTP2_PORT="

# Controls which capabilities to include in the ambient capability set for the
# executed process. Takes a whitespace-separated list of capability names, e.g.
# CAP_SYS_ADMIN, CAP_DAC_OVERRIDE, CAP_SYS_PTRACE. Ambient capability sets are
# useful if you want to execute a process as a non-privileged user but still
# want to give it some capabilities. For example, add the CAP_NET_BIND_SERVICE
# capability to be able to listen on privileged ports (port numbers less than
# 1024).
#AmbientCapabilities=CAP_NET_BIND_SERVICE

# Debug level for logs. The higher the value, the more verbose. 5 is INFO.
#Environment="JENKINS_DEBUG_LEVEL=5"

# Set to true to enable logging to /var/log/jenkins/access_log.
#Environment="JENKINS_ENABLE_ACCESS_LOG=false"

# Servlet context (important if you want to use reverse proxying)
#Environment="JENKINS_PREFIX=/jenkins"

# Arbitrary additional arguments to pass to Jenkins.
# Full option list: java -jar jenkins.war --help
#Environment="JENKINS_OPTS="

# Maximum core file size. If unset, the value from the OS is inherited.
#LimitCORE=infinity

# Maximum file size. If unset, the value from the OS is inherited.
#LimitFSIZE=infinity

# File descriptor limit. If unset, the value from the OS is inherited.
#LimitNOFILE=8192

# Maximum number of processes. If unset, the value from the OS is inherited.
#LimitNPROC=32768

# Set the umask to control the permission bits of files that Jenkins creates.
#
# 0027 makes files read-only for group and inaccessible for others, which some
# security sensitive users might consider beneficial, especially if Jenkins
# is running on a server that is used for multiple purposes. Beware that 0027
# permissions would interfere with sudo scripts that run on the controller
# (see JENKINS-25065).
#
# Note also that the particularly sensitive parts of $JENKINS_HOME (such as
# credentials) are always written without 'other' access. So the umask values
# only affect job configuration, build records, etc.
#
# If unset, the value from the OS is inherited, which is normally 0022.
# The default umask comes from pam_umask(8) and /etc/login.defs.
#UMask=0022

[Install]
WantedBy=multi-user.target

/etc/default/jenkins  :

# Defaults for Jenkins automation server

# Pulled in from the init script; makes things easier.
NAME=jenkins

# Arguments to pass to Java
JAVA_ARGS="-Djava.awt.headless=true"

# Allow graphs etc. to work even when an X server is present
#JAVA_ARGS="-Xmx256m"

# Make Jenkins listen on IPv4 address
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true"

# Specify the path to Java 17
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64

PIDFILE=/var/run/$NAME/$NAME.pid

# User and group to be invoked as (default to jenkins)
JENKINS_USER=$NAME
JENKINS_GROUP=$NAME

# Location of the Jenkins war file
JENKINS_WAR=/usr/share/java/$NAME.war

# Jenkins home location
JENKINS_HOME=/var/lib/$NAME

# Set this to false if you don't want Jenkins to run by itself
RUN_STANDALONE=true

# Log location. This may be a syslog facility.priority
JENKINS_LOG=/var/log/$NAME/$NAME.log
#JENKINS_LOG=daemon.info

# Whether to enable web access logging or not.
JENKINS_ENABLE_ACCESS_LOG="no"

# OS LIMITS SETUP
MAXOPENFILES=8192

# Set the umask to control permission bits of files that Jenkins creates.
#UMASK=027

# Port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080

# Servlet context, important if you want to use apache proxying
PREFIX=/$NAME

# Arguments to pass to Jenkins.
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT --javaHome=$JAVA_HOME"
sudo systemctl edit jenkins.service
[Service]
Environment="JENKINS_PORT=8080"
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
ExecStart=
ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Djava.awt.headless=true >
:~$ sudo systemctl daemon-reload
[sudo] Mot de passe de hada : 

:~$ sudo systemctl start jenkins.service

localhost:8080:
Capture-d-cran-du-2025-01-16-16-57-55.png

Bref, encore un effet délètere du mantra de la «pédagogie active» ou «donne un TP à faire sans aucun cours, au mieux une "démonstration" à 200 mots la minute et fait ensuite garderie». aucune idée pourquoi ça fonctionne mais pas le temps de creuser car doit rendre le TP…

Dernière modification par Hada de la Luna (Le 16/01/2025, à 17:13)


Hada de la Luna :o)

Hors ligne