Comments on: Install Jenkins on CentOS as a Service https://www.justinsilver.com/technology/linux/install-jenkins-centos-service/?utm_source=rss&utm_medium=rss&utm_campaign=install-jenkins-centos-service Technology, Travel, and Pictures Wed, 10 May 2017 21:55:16 +0000 hourly 1 https://wordpress.org/?v=6.0.1 By: Justin Silver https://www.justinsilver.com/technology/linux/install-jenkins-centos-service/#comment-1783 Sun, 20 Jul 2014 04:28:57 +0000 http://justin.ag/?p=3069#comment-1783 In reply to Mateusz.

Anytime, and thanks for reading my posts! Glad to know I’m not just talking to myself 😛

]]>
By: Mateusz https://www.justinsilver.com/technology/linux/install-jenkins-centos-service/#comment-1781 Thu, 17 Jul 2014 06:52:53 +0000 http://justin.ag/?p=3069#comment-1781 In reply to Justin Silver.

Yes 🙂 Thanks for replay and for great tutorial!

]]>
By: Justin Silver https://www.justinsilver.com/technology/linux/install-jenkins-centos-service/#comment-1780 Wed, 16 Jul 2014 16:37:08 +0000 http://justin.ag/?p=3069#comment-1780 In reply to Mateusz.

Sorry, wasn’t really thinking when I replied before. I am running CentOS 5.10, and you are correct that grep will show up in the list of running processes. The reason that we don’t have to omit “grep” in this case though is because of the regular expression used for matching – “[j]enkins.war”. Using the square brackets on the first letter uses a character match on just that letter so that “[j]enkins” will match “jenkins” but “jenkins” won’t match “[j]enkins” (which is what shows up on the output from ps). If the square brackets are omitted then you would need to include grep -v grep. Does that make sense?

]]>
By: Mateusz https://www.justinsilver.com/technology/linux/install-jenkins-centos-service/#comment-1779 Wed, 16 Jul 2014 11:05:01 +0000 http://justin.ag/?p=3069#comment-1779 In reply to Justin Silver.

Which server do you have? I never saw grep which doesn’t show it’s own process 🙂

]]>
By: Justin Silver https://www.justinsilver.com/technology/linux/install-jenkins-centos-service/#comment-1778 Tue, 15 Jul 2014 18:36:35 +0000 http://justin.ag/?p=3069#comment-1778 In reply to Mateusz.

I agree that it certainly won’t hurt to remove “grep” from the results, but I find that because the results of ps are being passed to grep that it doesn’t show up in the output. This is the output from my dev server:

[root@dev1 ~]# ps -ef | grep [j]enkins.war
jenkins  19352     1 44 14:32 ?        00:00:11 /usr/bin/java -jar /usr/local/jenkins/jenkins.war --httpListenAddress=0.0.0.0 --httpPort=8080 $
]]>
By: Mateusz https://www.justinsilver.com/technology/linux/install-jenkins-centos-service/#comment-1777 Tue, 15 Jul 2014 11:58:45 +0000 http://justin.ag/?p=3069#comment-1777 Nice tutorial!

Keep in mind that instead of using:
pid=`ps -ef | grep [j]enkins.war | wc -l`

you should use
pid=`ps -ef | grep [j]enkins.war | grep -v grep | wc -l`

Thanks!

]]>