-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I change the jenkins listening port? #659
Comments
Hello, class{ 'jenkins':
Please advice, if you are going to fix this soon. |
Unfortunately, the upstream debian and redhat packaging use different sysconf values.
There's not much we can do until the upstream packaging is fixed. I would be happy to accept a doc PR. |
🐧 Linux Using 🟠Ubuntu 20.04LTS, tried to modify the port number from +:~$ systemctl start jenkins.service
Job for jenkins.service failed because the control process exited with error code.
See "systemctl status jenkins.service" and "journalctl -xe" for details.
+:~$ systemctl status jenkins.service
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: failed (Result: exit-code) since Sun 2021-10-31 16:19:42 JST; 10s ago
Docs: man:systemd-sysv-generator(8)
Process: 154642 ExecStart=/etc/init.d/jenkins start (code=exited, status=7)
!Warning: The unit file, source configuration file or drop-ins of jenkins.service changed on di>
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: failed (Result: exit-code) since Sun 2021-10-31 16:19:42 JST; 3min 1s ago
Docs: man:systemd-sysv-generator(8)
Process: 154642 ExecStart=/etc/init.d/jenkins start (code=exited, status=7)
Oct 31 16:19:41 Scibrokes-Trading systemd[1]: Starting LSB: Start Jenkins at boot time...
Oct 31 16:19:41 Scibrokes-Trading jenkins[154642]: Correct java version found
Oct 31 16:19:41 Scibrokes-Trading jenkins[154642]: * Starting Jenkins Automation Server jenki>
Oct 31 16:19:41 Scibrokes-Trading jenkins[154642]: The selected http port (8080) on address 0.>
Oct 31 16:19:41 Scibrokes-Trading jenkins[154642]: Please select another address/port combinat>
-Oct 31 16:19:42 Scibrokes-Trading jenkins[154642]: ...fail!
Oct 31 16:19:42 Scibrokes-Trading systemd[1]: jenkins.service: Control process exited, code=ex>
-Oct 31 16:19:42 Scibrokes-Trading systemd[1]: jenkins.service: Failed with result 'exit-code'.
-Oct 31 16:19:42 Scibrokes-Trading systemd[1]: Failed to start LSB: Start Jenkins at boot time.
+:~$ systemctl daemon-reload
+:~$sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
time
ated)
un 2021-10-31 16:24:13 JST; 45s ago
tarting LSB: Start Jenkins at boot time...
7]: Correct java version found
7]: * Starting Jenkins Automation Server jenkins
-7]: The selected http port (8080) on address 0.0.0.0 seems to be in use by another program
-7]: Please select another address/port combination to use for jenkins
-7]: ...fail!
jenkins.service: Control process exited, code=exited, status=7/NOTRUNNING
jenkins.service: Failed with result 'exit-code'.
-failed to start LSB: Start Jenkins at boot time. Reference: |
May try to
The error still there and then changed port number as below and works. :~$ sudo micro /etc/default/jenkins
:~$ sudo service jenkins restart
:~$ sudo systemctl status jenkins
:~$ #and then update the system
:~$ sudo apt update
:~$ apt list --upgradable
:~$ sudo apt upgrade
|
I installed apache tomcat from puppetforge labs which was running at port 8080.
I did some testing and installed jenkins from puppetforge which puppet agent shows as running and doesnt throw any error in catalog as port 8080 is used by Java/tomcat
Puppet agent logs
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for arjunp5.mylabserver.com
Info: Applying configuration version '1477200872'
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/Archive[credentials.hpi]/ensure: replace archive: /var/lib/jenkins/plugins/credentials.hpi from (sha1)e099761bcc712d4f750444913e4fa3d07dbc66e2 to (sha1)
Info: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/Archive[credentials.hpi]: Scheduling refresh of Service[jenkins]
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/owner: owner changed 'root' to 'jenkins'
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/group: group changed 'root' to 'jenkins'
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/seluser: seluser changed 'unconfined_u' to 'system_u'
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/seltype: seltype changed 'user_tmp_t' to 'var_lib_t'
Notice: /Stage[main]/Jenkins::Service/Service[jenkins]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Jenkins::Service/Service[jenkins]: Unscheduling refresh on Service[jenkins]
When I checked the status also , its showing running
[root@arjunp5 opt]# /etc/rc.d/init.d/jenkins restart
Restarting jenkins (via systemctl): [ OK ]
[root@arjunp5 opt]# /etc/rc.d/init.d/jenkins status
● jenkins.service - LSB: Jenkins Continuous Integration Server
Loaded: loaded (/etc/rc.d/init.d/jenkins)
Active: active (exited) since Sun 2016-10-23 05:24:13 UTC; 6s ago
Docs: man:systemd-sysv-generator(8)
Process: 5123 ExecStop=/etc/rc.d/init.d/jenkins stop (code=exited, status=0/SUCCESS)
Process: 5129 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
Oct 23 05:24:12 arjunp5.mylabserver.com systemd[1]: Starting LSB: Jenkins Continuous Integration Server...
Oct 23 05:24:12 arjunp5.mylabserver.com runuser[5131]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
Oct 23 05:24:13 arjunp5.mylabserver.com jenkins[5129]: Starting Jenkins [ OK ]
Oct 23 05:24:13 arjunp5.mylabserver.com systemd[1]: Started LSB: Jenkins Continuous Integration Server.
When I start manually from jenkins , it shows below error
[root@arjunp5 opt]# java -jar /usr/lib/jenkins/jenkins.war
Running from: /usr/lib/jenkins/jenkins.war
webroot: $user.home/.jenkins
Oct 23, 2016 5:28:13 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized @646ms
Oct 23, 2016 5:28:13 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Oct 23, 2016 5:28:15 AM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
Oct 23, 2016 5:28:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-9.2.z-SNAPSHOT
Oct 23, 2016 5:28:16 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Jenkins home directory: /root/.jenkins found at: $user.home/.jenkins
Oct 23, 2016 5:28:17 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started w.@652a7737{/,file:/root/.jenkins/war/,AVAILABLE}{/root/.jenkins/war}
Oct 23, 2016 5:28:17 AM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: FAILED ServerConnector@50fe837a{HTTP/1.1}{0.0.0.0:8080}: java.net.BindException: Address already in use
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
Actually my 8080 port is already in use ,which is not captured during jenkins status / not in puppet catalog , when i killed my tomcat Java process , tried puppet agent -t , it showed same puppet log , but now jenkins was actually running
[root@arjunp5 opt]# netstat -tulpn | grep :8080
tcp6 0 0 :::8080 :::* LISTEN 2127/java
[root@arjunp5 opt]# netstat -plten |grep java
tcp6 0 0 :::8009 :::* LISTEN 1002 52705 2127/java
tcp6 0 0 :::8080 :::* LISTEN 1002 52701 2127/java
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 1002 52719 2127/java
[root@arjunp5 opt]# kill -9 2127
[root@arjunp5 opt]# netstat -plten |grep java
[root@arjunp5 opt]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for arjunp5.mylabserver.com
Info: Applying configuration version '1477200872'
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/Archive[credentials.hpi]/ensure: replace archive: /var/lib/jenkins/plugins/credentials.hpi from (sha1)e099761bcc712d4f750444913e4fa3d07dbc66e2 to (sha1)
Info: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/Archive[credentials.hpi]: Scheduling refresh of Service[jenkins]
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/owner: owner changed 'root' to 'jenkins'
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/group: group changed 'root' to 'jenkins'
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/seluser: seluser changed 'unconfined_u' to 'system_u'
Notice: /Stage[main]/Jenkins::Config/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/seltype: seltype changed 'user_tmp_t' to 'var_lib_t'
Notice: /Stage[main]/Jenkins::Service/Service[jenkins]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Jenkins::Service/Service[jenkins]: Unscheduling refresh on Service[jenkins]
Notice: Applied catalog in 2.34 seconds
So , Puppet module " Jenkins " doesnt check if the Port 8080 is already in use or not ?
The text was updated successfully, but these errors were encountered: