0

I am trying to run the command java -jar jenkins.war. It successfully runs, and I am able to access it via http://localhost:8080.

But when I type CTRL+C from the command line, the jenkins service goes down.

Can anybody tell me what the issue could be?

LOG
-
-bash-4.1$ java -jar jenkins.war 
Running from: /home/htr/temp/jenkins.war
webroot: $user.home/.jenkins
Oct 16, 2018 6:02:18 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Oct 16, 2018 6:02:18 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-winstone-2.9
Oct 16, 2018 6:02:21 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
Jenkins home directory: /home/htr/.jenkins found at: $user.home/.jenkins
Oct 16, 2018 6:02:22 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started SelectChannelConnector@0.0.0.0:8080
Oct 16, 2018 6:02:22 AM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Oct 16, 2018 6:02:22 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Oct 16, 2018 6:02:22 AM hudson.init.impl.InstallUncaughtExceptionHandler init
INFO: Succesfully installed a global UncaughtExceptionHandler.
Oct 16, 2018 6:02:23 AM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Oct 16, 2018 6:02:23 AM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Oct 16, 2018 6:02:23 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Oct 16, 2018 6:02:23 AM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Oct 16, 2018 6:02:26 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Oct 16, 2018 6:02:26 AM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 44513
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Oct 16, 2018 6:02:26 AM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Oct 16, 2018 6:02:26 AM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running
Oct 16, 2018 6:04:33 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 127,379 ms

jenkins version : 1.654

java version:
openjdk ve**strong text**rsion "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

Can anybody tell me whether I need to run jenkins as a sudo user or if it's due to another problem?

pushkin
  • 9,575
  • 15
  • 51
  • 95
  • Welcome to Stackoverflow. Please edit your question and write a problem description. What are you doing? What programming language is this - add the relevant tag! For guidance please read [how to ask questions](https://stackoverflow.com/help/how-to-ask) and [how to create a minimal example](https://stackoverflow.com/help/mcve) – 5th Oct 16 '18 at 14:27
  • You are running Jenkins as a foregroung process instead of a background process. Install jenkins as a service. Plenty of tutorials available online – ben5556 Oct 16 '18 at 18:55

3 Answers3

1

You probably should install it as a service, but giving credit to this post.

Start jenkins in the background

There is the option to run it in the background.

0

you've installed it as a stand alone server. Leave that terminal as it is if you want to keep your jenkins running. For doing other stuff, open a separate terminal/cmd.

nicks91
  • 85
  • 2
  • 7
0

you can install it as a service, it runs in background and start when machine starts. you can also change the port in which it starts. default being 8080

Install Jenkins as a service

also if you have problems installing it as a service, try to start the jenkins initially from cmd opened in administrator mode, then do the above steps.

user5722923
  • 33
  • 1
  • 5