4

Linux Service

 3 years ago
source link: https://linuxsuren.github.io/blog/os/linux/common/service/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Linux Service

Linux Service
#!/bin/sh
### BEGIN INIT INFO
# Provides: suren
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start: jenkins
# Should-Stop: jenkins
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: http://surenpi.com
# Description: http://surenpi.com
### END INIT INFO
 
case $1 in
    start)
        echo "start"
        nohup java -jar /var/www/jenkins/jenkins.war --httpPort=9099 > /var/www/jenkins/jenkins.log 2> /var/www/    jenkins/jenkins-error.log &
        ;;  
    stop)
        echo "stop"
        ;;  
    *)  
        echo "Usage: $0 (start|stop)"
        ;;  
esac

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK