1748140 Members
3662 Online
108758 Solutions
New Discussion юеВ

Re: script problem

 
SOLVED
Go to solution
Domenico_5
Respected Contributor

Re: script problem

in attach there is the script

it doesn't use a volume mounted after.

Carlos Fernandez Riera
Honored Contributor

Re: script problem

Ah ...


If you are trying do write something like a daemond you will need to trap HUP signal..


trap - HUP

unsupported
harry d brown jr
Honored Contributor

Re: script problem

Does nrpe restart itself as a daemon?

/usr/local/nrpe/nrpe -d /usr/local/nrpe/nrpe.cfg > /dev/null 2>&1


or should you add the ability to launch this in the background?


live free or die
harry
Live Free or Die
Carlos Fernandez Riera
Honored Contributor

Re: script problem

sorry:


trap "" 1


By the moment comment out :

/usr/local/nrpe/nrpe -d /usr/local/nrpe/nrpe.cfg # > /dev/null 2>&1


unsupported
Mladen Despic
Honored Contributor

Re: script problem

It looks like nrpe may depend on some networking functions.
If so, you won't be able to start it in a single-user mode. But you can do:

init 2

from the single user mode and then test the startup script manually.

Or, as suggested earlier, test it at run level 4.
Domenico_5
Respected Contributor

Re: script problem

for Carlos

Good Idea!!!!!!!!!!!!!!!!!!

nrpe have two options -d standalone daemon and -i inetd

so if I use -i and edit my inetd.conf it run.

Now if I want to check in rc3 where i must insert trap "" 1?


Deepak Extross
Honored Contributor

Re: script problem

Interesting thread..seems to me that your process gets a SIGHUP and therefore terminates.
Try replacing
/usr/local/nrpe/nrpe -d /usr/local/nrpe/nrpe.cfg > /dev/null 2>&1
with
nohup /usr/local/nrpe/nrpe -d /usr/local/nrpe/nrpe.cfg > /dev/null 2>&1 &

Good Luck!
Carlos Fernandez Riera
Honored Contributor
Solution

Re: script problem


...
trap "" 1
/usr/local/nrpe/nrpe -d /usr/local/nrpe/nrpe.cfg & # > /dev/null 2>&1

...



unsupported
Domenico_5
Respected Contributor

Re: script problem

Carlos

Deepak


Good work !!!!!!! Great

tnx for all