|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Automatic start of process after Boot-up
I have following problem:
My process "my_test" is automatically started during Boot-up of Computer. But then after 3-5 seconds, terminates without any traceback or error log. When I start this process with the same script, it runs without problems. It seems to me, they are not influence of other running processes. Are any system restrictions or specific parameters which are different in Boot phase and in logged user's session ? (HP-UX) The script looks : cd /my_folder/exe ./my_test >../out/my_test.log 2>&1 & Thanks Vilo |
|
#2
|
|||
|
|||
|
It would help to know a bit more about what your process does but, depending on when in the boot up sequence your process starts there may be services that it is counting on that have not started yet.
For example, maybe your process connects to another host to do something. That would require that networking was started and maybe your name service like DNS or NIS. Or maybe it connects to a database that isn't up yet. Again, it would help to understand your process a little better to assist in debugging this. The key is that don't assume that all of the services that you have available to you in a normal multi-user run level are available during the early stages of booting. |
|
#3
|
|||
|
|||
|
My process reads from shared memory ( always without problem), creates message queue and waits for messages from other local processes (ipc). It receives some messages and then terminates - not always in the same place ( checking my print ut in output file). Programm is a mixture of C (main, some subroutines) and Fortran (calculations) - rather big one.
Are parameters like "maxtsiz","maxdsiz" user independent ? |
|
#4
|
|||
|
|||
|
Yes, there are a number of differences
> cd /my_folder/exe > ./my_test >../out/my_test.log 2>&1 & Suggestions: - Add shell i.e. "#!/bin/sh" - Always use full path i.e. "/my_folder/exe/my_test" - Move output to folder in or under current directory i.e. "/myfolder/exe/my_test > /myfolder/exe/out/my_test.log" For HP-UX look in /etc/rc.log for startup/shutdown scripts error messages. |
|
#5
|
|||
|
|||
|
The solution is to use command "nohup" - it works 100%.
[ nohup ./my_test >../out/my_test.log 2>&1 & ] That's why, system administrator started my script under my user "abcd": su - abcd /home/abcd/start_my_test.sh When the script (start_my_test.sh) finished, then user "abcd" was logged out and his child (my_test), although running in background, got a signal to interrupt. "Nohup" means "no hangup" - process continues to run also after its parents is dead. Such process takes then as parent "init" process (pid=1). |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Automatic start of process after Boot-up |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|