Operating System - HP-UX
1820054 Members
2959 Online
109608 Solutions
New Discussion юеВ

Re: My process is getting killed at system reboot

 
Randeep Kaur
New Member

My process is getting killed at system reboot

Hi,
I am working on HP-UX B.11.11 9000/800 machine.
I have an application which is configured to start at the system reboot. For this I have created an /etc/rc.confing.d/myprog file and also provided a /sbin/init.d/myprog file containing start-stop details for my application. The run level for it is 2 with placeholder 910.
The behavior of my application is that as it gets started, it daemonize a process which waits for a set time to come to proceed further. But by the time the system reboot completes, while my application is still in wait period, it gets killed. I am unable to find out the reason for the same.
I also tried with a dummy program that daemonize in similar fashion like my application process and waits for a set period, but it doesn't get killed after system reboot completes.
Can somebody helps in this regard and give me some clue for this behavior?

Thanks,
Randeep.

5 REPLIES 5
Wim Rombauts
Honored Contributor

Re: My process is getting killed at system reboot

What is the final run-level you are trying to boot ? 3 ? Then try to boot your system to run-level 2 only, and see if your program still runs.
Start your program with "tusc -fko ". If you don't have tusc on your system, it is a free tool that you can download and install.
This tusc trace me be lengthy, but at the end, it would probably give a hint of what it is that made the program to stop.
A. Clay Stephenson
Acclaimed Contributor

Re: My process is getting killed at system reboot

This is a guess since I didn't write your code but I assume that "wait for a set time" means that you are using the sleep() function. You should be aware that any caught signal (not just SIGALRM) terminates the sleep. I suspect that your daemon is catching a signal and then starts trying to serve requests before the system is ready. You may also not be doing all the required step to properly daemonize the process. For instance, did you fork() and then call setsid()?
If it ain't broke, I can fix that.
Randeep Kaur
New Member

Re: My process is getting killed at system reboot

I took the tusc trace while my application starts and when it is killed. But there was nothing useful that I could find in that. The application exited with status 0 and with no message regarding any signal that it might have received and which was responsible for it being killed....:(
Randeep Kaur
New Member

Re: My process is getting killed at system reboot

My application is using pause() function. For daemonization, it is using fork() function. Everything works fine till daemonization and start of waiting period. And this the scenario which i had used in my dummy program also. But my application's process gets killed..:( whereas the dummy program keeps running and ends to completion successfully.
Randeep Kaur
New Member

Re: My process is getting killed at system reboot

SIGHUP was not properly handled in my application because of which the process was getting killed as the user log out.
Anyways, thanks for the help...:)