Operating System - HP-UX
1836956 Members
2430 Online
110112 Solutions
New Discussion

Package monitoring script

 
SOLVED
Go to solution
Shankar_6
Regular Advisor

Package monitoring script

Hi,

We have recently included the package montitoring script in a package.As per the script,Service guard itself should restart the processes incase process is not running instead of failover to alternative node.

When we started the package,it started without any error.But there are large number of defunc process created causing server to hang.

When we analysed in the monitoring script we have used nohup
Is the defunc processes are created because nohup is creating each time a new process when process failure happens..?

Can we avoid this by removing nohup in the script..?

Please advice.

Regards
Shankar
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Package monitoring script

Without knowing how your monitor script was written, it's not possible to say but I suspect that you have a script that runs great when stdin is a tty device (ie, an interactive session) but fails when stdin is not a tty device. Nohup itself, probably has little to do with this.
If it ain't broke, I can fix that.
Thomas J. Harrold
Trusted Contributor

Re: Package monitoring script

Remember that your application should (in most cases) be started in the "user defined run commands" section of the package control script.

Your service monitoring script will be run AFTER the user defined commands, and will need to monitor your app, and will only exit when the application is no longer running.
(this triggers the failover)

As mentioned previously, let us know more about what you are trying to accomplish, and we can help...

-tjh
I learn something new everyday. (usually because I break something new everyday)
Stephen Doud
Honored Contributor
Solution

Re: Package monitoring script

You could use the SERVICE_CMD portion of a package control script to restart the process:

#SERVICE_NAME[0]=""
#SERVICE_CMD[0]=""
#SERVICE_RESTART[0]=""

Notice the SERVICE_RESTART feature, which allows you to specify how many times you would like to restart the SERVICE_CMD.

The SERVICE_CMD could be a command, or a script that does more complex things.

The example SERVICE_CMD shown in the package control script is:
SERVICE_CMD[0]="/usr/bin/X11/xclock -display 192.10.25.54:0"

Note that there is no 'exec nohup' necessary.
Shankar_6
Regular Advisor

Re: Package monitoring script

Hi All,

Thanks for ur replies.

Issue sorted out when i changed the line that starts the daemon as below

su - aisys -c " cd to absolute path of the directory;nohup ./daemon.sh " &

Previously we are trying to nohup the deamon.sh directly as below

su - aisys -c " nohup /daemon.sh " &

I really dont know how it differs.Anyway issue resolved now..:))


Cheers,
Shankar

Shankar_6
Regular Advisor

Re: Package monitoring script

Thanks for all ur replies

Cheers
Shankar.B