什么是 start_daemon?

Dav*_*rks 6 startup command-line init.d services

我试图在以下 /etc/init.d/nagios-nrpe-server 启动脚本中了解 start_daemon:

  start)
        if [ "$INETD" = 1 ]; then
                exit 1
        fi
        log_daemon_msg "Starting $DESC" "$NAME"
        start_daemon -p $PIDDIR/nrpe.pid $NICENESS $DAEMON  -c $CONFIG -d $DAEMON_OPTS
        log_end_msg $?
        ;;
Run Code Online (Sandbox Code Playgroud)

特别是,当我启动此服务时,它没有按预期写入 PID 文件,因此该stop service nagios-nrpe-server命令不起作用(我需要手动终止进程)。

我试图弄清楚如何解决问题,但我无法从命令行运行start_daemon ...

我想手动重现脚本正在执行的操作,以便我可以解决问题所在。

tum*_*eed 6

它是/lib/lsb/init-functions. 您应该. /lib/lsb/init-functions在前面的 init 脚本中看到。