Jenkins server time behind Linux machine - linux

I have a jenkins server 1.651.3 running on a RedHat 6.3
Linux OS time is 12:30, but Jenkins server time is 11:30
How can I syncronize Jenkins server time with Linux ? (both should show 12:30)
Note: I tried these workarounds to solve the problem - without success:
1. added
-Duser.timezone=Asia/Jerusalem
-Dorg.apache.commons.jelly.tags.fmt.timeZone=Asia/Jerusalem
to /etc/sysconfig/jenkins and restarted jenkins service
2. executed
System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'Asia/Jerusalem')
from Jenkins Script console
Any ideas?

Related

Jenkins - how do I reload remote Tomcat in Windows from Jenkins in Linux server?

I successfully built a .war file and deployed to remote Tomcat in Windows server from Jenkins in CentOS 7. Now I want to make Jenkins let the remote Windows server reload Tomcat after the .war file is successfully deployed. So I went to Execute Windows batch command and wrote the following script.
set JAVA_HOME=D:\Java\jdk1.6
cd "D:\Java\Tomcat 6"
cmd /c bin\shutdown.bat
timeout 5
cmd /c bin\startup.bat
After building the project, I realized it didn't work, as the Jenkins is in Linux and the remote Tomcat is in Windows. So finally I got to a conclusion that I might have to be able to access the remote Windows command line from the Linux shell.
Any good solutions for this?
The last log of building and deploying the .war file ended like the following.
Deploying /var/lib/jenkins/workspace/POS/target/posapi.war to container Tomcat 7.x Remote
Redeploying [/var/lib/jenkins/workspace/POS/target/posapi.war]
Undeploying [/var/lib/jenkins/workspace/POS/target/posapi.war]
Deploying [/var/lib/jenkins/workspace/POS/target/posapi.war]
Finished: SUCCESS
Does it mean that the reload is also successfully done?

How to execute a shell script after oracle started successfully

I would like to execute a shell script with non-root user while Linux system booting and oracle has been started successfully.
I tried to execute this shell in rc.local. But I found oracle start-up procedure took too much time. So when shell tried to connect to Oracle, it return failed.
On the user`s Linux server, it took several minutes to get Oracle running. I am not clear what technology they use. I found when Oracle didn`t startup finished, I can login Linux server through ssh.
In my opinion, Linux boot sequence should like following.
/etc/rc.d/rc.sysinit
/etc/rc.d/rc $RUNLEVEL
/etc/rc.d/rc.local
/bin/login
But If I add line to check if Oracle is running in rc.local, user cannot login Linux server for several minutes. I think it is improper.
Is there a better solution to solve this problem?
Any suggestion is welcome.
Use one of this solutions and configure it to "wait" for oracle listen port.
https://github.com/vishnubob/wait-for-it
Or
https://github.com/Eficode/wait-for

Cron daemon not running in debian

I am using Jessie. Cron was working fine last week. But I just checked today and found out, it's not working anymore. When I restart upstart loads my custom tasks. But if I check
sudo service --status-all
Cron is shown marked as [ - ] cron
When I execute sudo service --status-all, I get [FAIL] cron is not running ... failed! in return. Manually starting cron service executes the tasks in crontab. But, the service is not starting on boot.
There is no problem with crontab task specification. They are working fine on my other machines running Ubuntu.

How to recover crashed Jenkins from Linux server?

I have installed Jenkins on Linux server. I am using 9091 port to run Jenkins & installed SSL to that. Jenkins URL looks like following one (https://testurl.com:9091/)
When I am trying to open Jenkins it's not get opened. Jenkins log file is given below.
How to recover Jenkins & open it..?

Unable to restart rogue Jenkins on Ubuntu

I was configuring Jenkins last night to run some reporting plugins (codestyle, findbugs, cobertura). When I ran my build job it got hung up somewhere in codestyle, and the server ui became unresponsive.
Today I logged in to the server and the Jenkins log is reporting errors that look like the server ran out of memory, but more than that, I cannot seem to stop or restart the server. I have limited experience with services in linux.
Jenkins was installed on Ubuntu with atp. I have tried $ sudo /etc/init.d/jenkins restart but it reports
* Starting Jenkins Continuous Integration Server jenkins
The selected http port (8080) seems to be in use by another program
Please select another port to use for jenkins
When I try to run service jenkins status to get a pid to kill i get
2 instances of jenkins are running at the moment
but the pidfile /var/run/jenkins/jenkins.pid is missing
Running netstat and ps has identified the port being held by a jenkins instance.
How can I recover from this?
Mostly I was concerned about abruptly killing the Jenkins server while it has gone rogue. Something this tied into process with server connections and plugins makes me wary of taking a shotgun to the process.
That's exactly what I did. server jenkins status didn't work, so I got the process id from netstat -tulpn. kill -15 didn't work so I did kill -9, waited a respectful grieving period, then restarted the Jenkins service.
I will next be investigating the root problem of running out of memory in my Jenkins installation so hopefully this doesn't happen again while I am firewalled away from my server.
Where is your server hosted?
I had the same issue with AWS EC2 server.
Command lines did not work to reboot the server.
However, on AWS admin console, I did: EC2 -> restart and it works like a charm.
This may not be a solution but a workaround.
I was able to do
sudo ps aux | grep jenkins
To find a list of jenkins processes. Then I ran
sudo kill <pid>
And then finally
sudo service jenkins restart

Resources