Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to understand start_daemon in the following /etc/init.d/nagios-nrpe-server startup script:

  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 $?
        ;;

In particular, when I start this service it isn't writing a PID file as expected, thus the stop service nagios-nrpe-server command is not working (I need to manually kill the processes).

I'm trying to figure out how to trouble shoot the problem, but I can't run start_daemon ... from the command line.

I want to reproduce what the script is doing manually so I can work on what the problem is.

share|improve this question
    
The ultimate solution to this problem, in case someone finds this post and is experiencing the same issue with the NRPE daemon, was to fix the PID setting in /etc/nrpe.cfg –  David Parks Mar 26 '12 at 10:43

2 Answers 2

up vote 2 down vote accepted

It's a shell function in /lib/lsb/init-functions. You should see . /lib/lsb/init-functions earlier in the init script.

share|improve this answer
    
Aha! Sneaky buggers. I see where it's coming from now! Thanks. –  David Parks Mar 26 '12 at 10:42

It looks like as it was function call in the shell script.

Check the bash manual (man bash) and search for „shell function definition” (/ command).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.