CentOS下安装使用start-stop-daemon

CentOS是没有start-stop-daemon的,因为start-stop-daemon在debian的dpkg包里。要安装的话,需要自己折腾。

相关命令如下:

wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz

tar zxf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz

mv apps/sys-utils/start-stop-daemon-IR1_9_18-2/ ./

rm -rf apps

cd start-stop-daemon-IR1_9_18-2/

cc start-stop-daemon.c -o start-stop-daemon

cp start-stop-daemon /usr/local/bin/start-stop-daemon

至此安装完成。可以看到:

[root@localhost ~]# start-stop-daemon –help
start-stop-daemon 1.9.18 for Debian – small and fast C version written by
Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>, public domain.

Usage:
  start-stop-daemon -S|–start options … — arguments …
  start-stop-daemon -K|–stop options …
  start-stop-daemon -H|–help
  start-stop-daemon -V|–version

Options (at least one of –exec|–pidfile|–user is required):
  -x|–exec <executable>        program to start/check if it is running
  -p|–pidfile <pid-file>       pid file to check
  -c|–chuid <name|uid[:group|gid]>
                change to this user/group before starting process
  -u|–user <username>|<uid>    stop processes owned by this user
  -n|–name <process-name>      stop processes with this name
  -s|–signal <signal>          signal to send (default TERM)
  -a|–startas <pathname>       program to start (default is <executable>)
  -N|–nicelevel <incr>         add incr to the process’s nice level
  -b|–background               force the process to detach
  -m|–make-pidfile             create the pidfile before starting
  -R|–retry <schedule>         check whether processes die, and retry
  -t|–test                     test mode, don’t do anything
  -o|–oknodo                   exit status 0 (not 1) if nothing done
  -q|–quiet                    be more quiet
  -v|–verbose                  be more verbose
Retry <schedule> is <item>|/<item>/… where <item> is one of
-<signal-num>|[-]<signal-name>  send that signal
<timeout>                       wait that many seconds
forever                         repeat remainder forever
or <schedule> may be just <timeout>, meaning <signal>/<timeout>/KILL/<timeout>

Exit status:  0 = done      1 = nothing done (=> 0 if –oknodo)
              3 = trouble   2 = with –retry, processes wouldn’t die

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值