CentOS 6.8 使用start-stop-daemon命令
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
免费下载资源
·
start-stop-daemon简介
start-stop-daemon是一个Debian体系里的一个守护进程管理软件,可以用指定的用户启停软件。
start-stop-daemon 使用:http://man7.org/linux/man-pages/man8/start-stop-daemon.8.html
start-stop-daemon 安装
- 下载dpkg_1.16.18.tar.xz链接:http://ftp.de.debian.org/debian/pool/main/d/dpkg,服务器下载比较慢,建议本地下载完成上传到服务器上,编译安装如下:
wget http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.16.18.tar.xz
tar -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 && make
find / -name start-stop-daemon # 查看start-stop-daemon位置
start-stop-daemon使用
cp /usr/local/src/dpkg-1.16.18/utils/start-stop-daemon /usr/local/sbin/
#######################################################################
#!/bin/sh
DESC="Jenkins CI Server"
NAME=jenkins
PIDFILE=/var/run/$NAME.pid
RUN_AS=jenkins
COMMAND="/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
;;
esac
exit 0
参考:http://blog.csdn.net/wangjianno2/article/details/52080299
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
已为社区贡献15条内容
所有评论(0)