安装

  1. git clone git://github.com/bmc/daemonize.git
  2. sh configure && make && sudo make install
  3. which daemonize

示例

  1. # 后台启动prometheus
  2. daemonize -c /data/prometheus/ /data/prometheus/up.sh

up.sh内容如下:

  1. /data/prometheus/prometheus --web.listen address="0.0.0.0:9090" --web.read-timeout=5m --web.max connections=10 --storage.tsdb.retention=15d --storage.tsdb.path="data/" --query.max-concurrency=20 --query.timeout=2m