Use the start-stop-daemon command on CentOS 6.8

Source: Internet
Author: User
Tags jenkins ci

Use the start-stop-daemon command on CentOS 6.8
Introduction to start-stop-daemon

Start-stop-daemon is a daemon management software in the Debian system. You can use a specified user to start or stop the software.
Start-stop-daemon use: http://man7.org/linux/man-pages/man8/start-stop-daemon.8.html

Start-stop-daemon Installation
  • Download dpkg_1.16.18.tar. xz link: Upload:
Wget http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.16.18.tar.xztar-xf dpkg_1.16.18.tar.xz & cd dpkg_1.16.18. /configure # configure: error: no curses library found yum install ncurses-devel-y. /configure & makefind/-name start-stop-daemon # view the start-stop-daemon position
Start-stop-daemon
cp /usr/local/src/dpkg-1.16.18/utils/start-stop-daemon /usr/local/sbin/########################################################################!/bin/shDESC="Jenkins CI Server"NAME=jenkinsPIDFILE=/var/run/$NAME.pidRUN_AS=jenkinsCOMMAND="/usr/bin/java -- -jar /home/jenkins/jenkins.war"d_start() {    start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --chuid $RUN_AS --exec $COMMAND}d_stop() {    start-stop-daemon --stop --quiet --pidfile $PIDFILE    if [ -e $PIDFILE ]        then rm $PIDFILE    fi}case $1 in    start)    echo -n "Starting $DESC: $NAME"    d_start    echo "."    ;;    stop)    echo -n "Stopping $DESC: $NAME"    d_stop    echo "."    ;;    restart)    echo -n "Restarting $DESC: $NAME"    d_stop    sleep 1    d_start    echo "."    ;;    *)    echo "usage: $NAME {start|stop|restart}"    exit 1    ;;esacexit 0

Reference: http://blog.csdn.net/wangjianno2/article/details/52080299

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.