Centos/ubuntu Jenkins.war Self-startup script, Linux startup stop jar package run case

Source: Internet
Author: User

#! /bin/sh# chkconfig:2345 # Description:jenkins .... # This script would be executed *after* all the other init script S.  # You can put your own initialization stuff in here if you don ' t # want to do the full  Sys V style init stuff.  #prefix =/home/lanmps/jenkins#nohup $prefix/start_jenkins.sh >> $prefix/jenkins.log 2>&1 Here comes the wind. jenkins_root=/home/lanmps/jenkinsjenkinsfilename=jenkins.war# Stop Method stops () {    echo "stoping $ Jenkinsfilename "Ps-ef|grep $JENKINSFILENAME |awk ' {print $} ' |while read Piddo   kill-9 $pid   echo" $pid Kill "Don E}case "Instart"    echo "starting $JENKINSFILENAME" Nohup $JENKINS _root/start_jenkins.sh >> $JENKINS _root/ Jenkins.log 2>&1 &  ; Stop)  stop  ;; Restart)  stop  start  ;; Status)  ps-ef|grep $JENKINSFILENAME  ;; *)  printf ' Usage:%s {start|stop|restart|status}\n ' "$prog"  exit 1  ;; Esac

Save As Jenkins directory under jenkins.sh

Jenkins_root for the Jenkins directory

1.centos

Ln-s/home/lanmps/jenkins/jenkins.sh/etc/init.d/jenkinschkconfig--add jenkinschkconfig--level 345 Jenkins on
Starting mode
/etc/init.d/jenkins start
2.ubuntu

Ln-s/home/lanmps/jenkins/jenkins.sh/etc/init.d/jenkinsupdate-rc.d-f Jenkins Defaults
Starting mode
/etc/init.d/jenkins start

Centos/ubuntu Jenkins.war Self-startup script, Linux startup stop jar package run case

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.